/* V22: V21 visual completion plus mobile reference placement and themed focus.
   No global shell, navigation, Download, form-contract or validation overrides. */
.s2-register-document .register-layout {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
}

/* Match Download's standalone icon / title / subtitle / divider. */
.s2-register-document .s2-register-title {
  gap: 14px;
  margin: 0 0 24px;
  padding: 0 0 17px;
  border-bottom: 1px solid var(--s14-line);
}
.s2-register-document .s2-register-title > div { min-width: 0; }
.s2-register-document .s2-register-title .s17-register-icon { border-radius: 7px; }
.s2-register-document .s17-register-icon svg { stroke-width: 1.7; }

html:not([data-active-view]) body.s2-register-document .register-card {
  max-width: none;
  padding: 26px !important;
  background: linear-gradient(145deg, #242526, #1e1f20) !important;
  border: 1px solid #3f4043 !important;
  border-top-color: #713039 !important;
  border-radius: 6px !important;
  box-shadow: inset 0 1px #ffffff03 !important;
}
.s2-register-document .register-grid {
  gap: 16px 20px !important;
  align-items: stretch;
}
/* Persistent compact labels retain context after a value is entered. */
.s2-register-document .s19-field-label {
  position: absolute;
  z-index: 2;
  top: 6px;
  left: 16px;
  width: auto;
  height: auto;
  max-width: calc(100% - 32px);
  margin: 0;
  padding: 0;
  border: 0;
  overflow: visible;
  clip-path: none;
  white-space: nowrap;
  color: #97999c;
  font: 700 8px/1.2 Arial, sans-serif;
  letter-spacing: .09em;
  text-transform: uppercase;
  pointer-events: none;
}
html:not([data-active-view]) body.s2-register-document .field input,
html:not([data-active-view]) body.s2-register-document .reference-trigger {
  height: 50px !important;
  background: #19191b !important;
  border-color: #46464a !important;
  border-radius: 4px !important;
}
html:not([data-active-view]) body.s2-register-document .field input::placeholder {
  font: 400 13px/1.4 Arial, sans-serif;
  color: #bdbdc3 !important;
  opacity: 1;
}
html:not([data-active-view]) body.s2-register-document .field input {
  padding-top: 15px !important;
  padding-bottom: 2px !important;
}
.s2-register-document .secret-action {
  width: 42px;
  height: 50px;
  border-left-color: #ffffff09;
}
.s2-register-document .generate-secret { right: 42px; }
html:not([data-active-view]) body.s2-register-document .field:has(.toggle-password) input {
  padding-right: 54px !important;
}
html:not([data-active-view]) body.s2-register-document .field.has-generator input {
  padding-right: 96px !important;
}
.s2-register-document .delete-code-caption {
  position: absolute;
  z-index: 1;
  top: 6px;
  left: 16px;
  right: 12px;
  min-height: 0;
  margin: 0;
  font: 400 11px/14px Arial, sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
html:not([data-active-view]) body.s2-register-document .delete-code-field input {
  padding-top: 17px !important;
  letter-spacing: .06em;
}
.s2-register-document .reference-trigger {
  padding: 15px 34px 2px 16px;
  font-size: 13px;
}
.s2-register-document .reference-compass { display: none; }
.s2-register-document .reference-chevron { bottom: 23px; }
.s2-register-document .reference-field.is-open .reference-chevron { bottom: 20px; }
.s2-register-document .agreement { margin: 22px 0 17px; }
.s2-register-document .agreement strong { color: var(--s14-muted); }
.s2-register-document .s19-complete {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px 20px;
  padding-top: 18px;
}
.s2-register-document .submit-button {
  min-height: 50px;
  transition: transform .15s ease, border-color .18s ease, box-shadow .18s ease, filter .18s ease !important;
}
html:not([data-active-view]) body.s2-register-document .submit-button:hover {
  background: linear-gradient(#a43b47, #812832) !important;
  border-color: #c2646e !important;
  box-shadow: inset 0 1px rgba(255,255,255,.07), 0 7px 20px rgba(65,8,15,.18) !important;
}
.s2-register-document .login-note { margin-top: 10px; }

@media (max-width: 760px) {
  .s2-register-document .register-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .s2-register-document .s19-complete { grid-template-columns: minmax(0, 1fr); }
  .s2-register-document .captcha-wrap { justify-content: center; }
  .s2-register-document .login-note { text-align: center; }
}
@media (max-width: 480px) {
  html:not([data-active-view]) body.s2-register-document .register-card { padding: 20px 14px !important; }
  .s2-register-document .s2-register-title { margin-bottom: 20px; gap: 12px; }
  .s2-register-document .s2-register-title p { font-size: 12px; }
  html:not([data-active-view]) body.s2-register-document .field input::placeholder { font-size: 11px; }
  .s2-register-document .agreement { font-size: 12px; }
}
/* Keep the existing long PIN/password hints readable on narrow phones. */
@media (max-width: 360px) {
  .s2-register-document .secret-action { width: 32px; }
  .s2-register-document .generate-secret { right: 32px; }
  html:not([data-active-view]) body.s2-register-document .field.has-generator input {
    padding-left: 14px !important;
    padding-right: 74px !important;
  }
}

/* Reference menu and agreement content use one restrained graphite/wine
   scrollbar system. Horizontal scrollbars are never needed here. */
html[data-active-view="register"],
html[data-active-view="register"] body {
  background: #171719 !important;
}
html[data-active-view="register"] #inner-page-shell {
  background:
    radial-gradient(ellipse at 28% 0%, #29292b 0%, #1d1d1f 43%, #171719 100%) !important;
}
.s2-register-document .s2-register-title .s17-register-icon {
  border-color: #574247;
  background: linear-gradient(145deg, #2d292b, #252527);
  color: #d0c8ca;
}
html:not([data-active-view]) body.s2-register-document .reference-menu {
  box-sizing: border-box;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  padding: 5px 4px 5px 5px;
  border-color: #4b4c50 !important;
  background: #202123 !important;
  box-shadow: 0 16px 36px rgba(0,0,0,.42) !important;
  scrollbar-width: thin;
  scrollbar-color: #6f3038 #18191b;
}
html:not([data-active-view]) body.s2-register-document .reference-menu::-webkit-scrollbar,
.s2-register-document .membership-content::-webkit-scrollbar,
.registration-membership-content::-webkit-scrollbar {
  width: 6px;
  height: 0;
}
html:not([data-active-view]) body.s2-register-document .reference-menu::-webkit-scrollbar-track,
.s2-register-document .membership-content::-webkit-scrollbar-track,
.registration-membership-content::-webkit-scrollbar-track {
  background: #18191b;
}
html:not([data-active-view]) body.s2-register-document .reference-menu::-webkit-scrollbar-thumb,
.s2-register-document .membership-content::-webkit-scrollbar-thumb,
.registration-membership-content::-webkit-scrollbar-thumb {
  border: 1px solid #18191b;
  border-radius: 999px;
  background: #6f3038;
}
html:not([data-active-view]) body.s2-register-document .reference-menu::-webkit-scrollbar-thumb:hover,
.s2-register-document .membership-content::-webkit-scrollbar-thumb:hover,
.registration-membership-content::-webkit-scrollbar-thumb:hover {
  background: #91404a;
}
html:not([data-active-view]) body.s2-register-document .reference-option {
  position: relative;
  border-radius: 3px;
  color: #d5d5d7 !important;
}
html:not([data-active-view]) body.s2-register-document .reference-option:is(:hover,:focus-visible,.is-active) {
  background: #2d2e31 !important;
}
html:not([data-active-view]) body.s2-register-document .reference-option[aria-selected="true"] {
  background: #31272a !important;
  box-shadow: inset 2px 0 #a83b48;
  color: #fff !important;
}

/* Direct /Register fallback. Embedded registration uses the parent modal. */
.s2-register-document .membership-backdrop { background: rgba(8,8,9,.76) !important; }
.s2-register-document .membership-dialog {
  border-color: #4c4d50 !important;
  border-top-color: #8f3540 !important;
  background: #202123 !important;
}
.s2-register-document .membership-head { background: #232426; }
.s2-register-document .membership-content {
  background: #202123 !important;
  scrollbar-color: #6f3038 #18191b !important;
}

/* Parent-shell agreement modal covers the real viewport, avoiding a black
   rectangular overlay limited to the embedded form. */
.registration-membership-modal[hidden] { display: none !important; }
.registration-membership-modal {
  position: fixed;
  z-index: 1400;
  inset: 0;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: clamp(12px, 3vw, 32px);
}
.registration-membership-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(8,9,10,.78);
  backdrop-filter: blur(2px);
}
.registration-membership-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0,1fr);
  width: min(760px, 100%);
  max-height: min(760px, calc(100svh - clamp(24px, 6vw, 64px)));
  overflow: hidden;
  border: 1px solid #4c4d50;
  border-top: 2px solid #913640;
  border-radius: 7px;
  background: #202123;
  box-shadow: 0 30px 90px rgba(0,0,0,.7);
  color: #dedee0;
}
.registration-membership-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  box-sizing: border-box;
  padding: 12px 16px 12px 20px;
  border-bottom: 1px solid #3d3e41;
  background: linear-gradient(110deg, #28292b, #222325);
}
.registration-membership-mark {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #b13240;
  box-shadow: 0 0 12px rgba(177,50,64,.45);
}
.registration-membership-head h2 {
  min-width: 0;
  margin: 0;
  color: #eeeef0;
  font: 400 clamp(20px, 3vw, 25px)/1.2 Georgia, serif;
}
.registration-membership-close {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  margin-left: auto;
  padding: 0;
  border: 1px solid #4b4c50;
  border-radius: 5px;
  background: #292a2d;
  color: #d8d8da;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.registration-membership-close:hover {
  border-color: #8d454e;
  background: #34282b;
  color: #fff;
}
.registration-membership-close:focus-visible {
  outline: 2px solid #a85a64;
  outline-offset: 3px;
  border-color: #8d454e;
  box-shadow: 0 0 0 1px rgba(168,90,100,.12);
}
.registration-membership-content {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: clamp(20px, 3vw, 30px);
  background: radial-gradient(circle at 50% 0, rgba(128,31,42,.07), transparent 34%), #202123;
  color: #d0d0d3;
  font: 400 14px/1.75 Arial, sans-serif;
  scrollbar-width: thin;
  scrollbar-color: #6f3038 #18191b;
}
.registration-membership-content > :first-child { margin-top: 0; }
.registration-membership-content > :last-child { margin-bottom: 0; }
.registration-membership-content img,
.registration-membership-content table { max-width: 100%; }
html.registration-membership-open,
body.registration-membership-open { overflow: hidden !important; }

@media (max-width: 600px) {
  .registration-membership-modal { padding: 8px; }
  .registration-membership-dialog {
    width: 100%;
    max-height: calc(100svh - 16px);
    border-radius: 5px;
  }
  .registration-membership-head { min-height: 58px; padding: 8px 10px 8px 15px; }
  .registration-membership-head h2 { font-size: 20px; }
  .registration-membership-close { width: 40px; height: 40px; flex-basis: 40px; }
  .registration-membership-content { padding: 18px 16px 24px; font-size: 14px; line-height: 1.72; }
}
