.sentinel-lead {
  --lead-track: #2a5a42;
  --lead-glass: rgba(245, 245, 243, .76);
  --lead-control: rgba(255, 255, 255, .84);
  --lead-edge: rgba(255, 255, 255, .9);
  --lead-shadow: rgba(22, 25, 30, .07);
  --lead-control-edge: rgba(22, 25, 30, .08);
  min-height: 100svh;
  position: relative;
  padding: 0;
  background: var(--bg);
  scroll-margin-top: 0;
  overflow-anchor: none;
}

.lead-sticky {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 72px 40px calc(130px + env(safe-area-inset-bottom, 0px));
  background: var(--bg);
}

[data-theme="dark"] .sentinel-lead {
  --lead-track: #4c8066;
  --lead-glass: rgba(35, 38, 43, .78);
  --lead-control: rgba(255, 255, 255, .065);
  --lead-edge: rgba(255, 255, 255, .12);
  --lead-shadow: rgba(0, 0, 0, .2);
  --lead-control-edge: rgba(255, 255, 255, .16);
}

.lead-layout {
  position: relative;
  display: grid;
  width: min(100%, 760px);
  min-height: min(620px, calc(100svh - 202px));
  isolation: isolate;
}

.lead-panel {
  grid-area: 1 / 1;
  align-self: center;
  position: relative;
  min-width: 0;
  text-align: center;
}

.lead-panel[hidden] {
  display: block;
  visibility: hidden;
  pointer-events: none;
}

.lead-result-actions[hidden] {
  display: flex;
  visibility: hidden;
  pointer-events: none;
}

.lead-reset[hidden] {
  display: none;
}

.lead-entry {
  --lead-entry-focus: var(--lead-focus, 1);
  --lead-entry-action: var(--lead-action, 1);
  padding: 56px 0;
}

.lead-entry:focus-within {
  --lead-entry-focus: 1;
  --lead-entry-action: 1;
}

.lead-entry h2 {
  opacity: calc(.75 + .25 * var(--lead-entry-focus));
  transform: translateY(calc(18px * (1 - var(--lead-entry-focus))));
}

.lead-entry .lead-form {
  transform: translateY(calc(24px * (1 - var(--lead-entry-focus)))) scale(calc(.97 + .03 * var(--lead-entry-focus)));
}

.lead-entry .lead-submit {
  opacity: calc(.6 + .4 * var(--lead-entry-action));
  transform: translateY(calc(8px * (1 - var(--lead-entry-action))));
}

.lead-work {
  padding: 32px 24px;
}

.lead-outline {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  fill: none;
  z-index: 2;
}

.lead-entry h2 {
  text-wrap: balance;
  font-size: clamp(58px, 5.5vw, 78px);
  font-weight: 250;
  line-height: 1.04;
  max-width: 18ch;
  margin: 0 auto 28px;
}

.sentinel-lead [data-lead-focus]:focus {
  outline: 0;
}

.lead-scope {
  text-wrap: balance;
  font-size: 17px;
  margin: 0 auto 38px;
  max-width: 38ch;
}

.lead-form {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 760px;
  padding: 28px 32px;
  margin: 0 auto;
  text-align: left;
  border-radius: 26px;
  background: var(--lead-glass);
  box-shadow: 0 8px 26px var(--lead-shadow);
  backdrop-filter: blur(20px) saturate(110%);
  -webkit-backdrop-filter: blur(20px) saturate(110%);
}

.lead-field {
  flex: 1;
  min-width: 0;
}

.lead-field label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--muted);
}

.lead-field input {
  display: block;
  width: 100%;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 24px;
  font-weight: 300;
  line-height: 1.5;
}

.lead-field input::placeholder {
  color: var(--dim);
  opacity: 1;
}

.lead-submit.button {
  width: auto;
  min-height: 60px;
  padding: 16px 24px;
  border: 1px solid var(--lead-control-edge);
  border-radius: 22px;
  background: var(--lead-control);
  color: var(--text);
  box-shadow: 0 3px 10px var(--lead-shadow), inset 0 1px 1px var(--lead-edge);
  flex-shrink: 0;
  gap: 18px;
  white-space: nowrap;
}

.lead-submit.button:hover {
  background: var(--lead-control);
  border-color: var(--line-strong);
}

.lead-authorisation {
  text-wrap: balance;
  max-width: 66ch;
  margin: 22px auto 0;
  color: var(--dim);
  font-size: 12px;
  line-height: 1.7;
}

.lead-authorisation a {
  display: inline;
  white-space: nowrap;
  text-decoration: underline;
  text-underline-offset: 3px;
  margin-left: 5px;
}

.lead-consent {
  max-width: 66ch;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.lead-consent summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 44px;
  padding: 8px 0;
  cursor: pointer;
  list-style: none;
}

.lead-consent summary::-webkit-details-marker {
  display: none;
}

.lead-consent summary::after {
  content: '+';
  flex-shrink: 0;
  font-size: 18px;
}

.lead-consent[open] summary::after {
  content: '−';
}

.lead-consent p {
  margin: 10px 0 0;
  text-align: left;
  font-size: 13px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.lead-consent + .lead-authorisation {
  margin-top: 8px;
}

.lead-error,
.lead-live-status {
  max-width: 54ch;
  margin: 18px auto 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.lead-error:empty,
.lead-live-status:empty {
  display: none;
}

.lead-progress-ring {
  position: relative;
  width: min(100%, 400px, 49svh);
  aspect-ratio: 1;
  margin: 0 auto;
}

.lead-ring-track {
  stroke: var(--lead-track);
  stroke-width: 1;
  opacity: 0;
}

.lead-ring-gold {
  stroke: var(--gold);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.lead-current-action {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 66%;
  font-size: clamp(23px, 2.5vw, 32px);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: -.035em;
  margin: 0;
}

.lead-result-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.lead-result-actions .button {
  border-radius: 28px;
  font-size: 13px;
}

.lead-reset {
  margin-top: 26px;
  min-height: 44px;
  padding: 10px 4px;
  background: transparent;
  border: 0;
  color: var(--dim);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 5px;
}

.lead-announcement {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 650px) {
  .lead-sticky {
    padding: 54px 24px calc(118px + env(safe-area-inset-bottom, 0px));
  }

  .lead-layout {
    min-height: 0;
  }

  .lead-entry {
    padding: 32px 0;
  }

  .lead-work {
    padding: 28px 20px;
  }

  .lead-entry h2 {
    font-size: 38px;
    max-width: 17ch;
    margin-bottom: 24px;
  }

  .lead-scope {
    font-size: 16px;
    margin-bottom: 30px;
  }

  .lead-form {
    display: block;
    max-width: 390px;
    padding: 22px 20px;
  }

  .lead-submit.button {
    width: 100%;
    min-height: 52px;
    margin-top: 18px;
    padding: 13px 20px;
    border-radius: 20px;
  }

  .lead-authorisation {
    max-width: 43ch;
    margin-top: 20px;
    font-size: 11px;
  }

  .lead-progress-ring {
    width: min(100%, 330px);
  }

  .lead-current-action {
    font-size: clamp(20px, 5.6vw, 26px);
  }

  .lead-result-actions {
    flex-direction: column;
    align-items: stretch;
    width: min(100%, 330px);
    margin: 24px auto 0;
  }
}

@media (max-height: 650px) and (min-width: 651px) {
  .lead-sticky {
    padding-top: 24px;
    padding-bottom: calc(114px + env(safe-area-inset-bottom, 0px));
  }

  .lead-layout {
    min-height: 0;
  }

  .lead-entry {
    padding: 24px 0;
  }

  .lead-form {
    padding: 20px 28px;
  }

  .lead-work {
    padding: 24px;
  }

  .lead-entry h2 {
    max-width: none;
    font-size: 40px;
    margin-bottom: 14px;
  }

  .lead-entry h2 br {
    display: none;
  }

  .lead-scope {
    max-width: none;
    font-size: 16px;
    margin-bottom: 20px;
  }

  .lead-authorisation {
    max-width: none;
    margin-top: 16px;
    font-size: 11px;
  }

  .lead-progress-ring {
    width: clamp(160px, calc(100svh - 220px), 240px);
  }

  .lead-current-action {
    width: 82%;
    font-size: 18px;
  }

  .lead-result-actions {
    margin-top: 14px;
  }

  .lead-result-actions .button {
    min-height: 44px;
    padding: 10px 16px;
    font-size: 12px;
  }

  .lead-reset {
    margin-top: 10px;
    min-height: 34px;
    padding: 5px 4px;
  }
}

@media (max-width: 650px) and (max-height: 700px) {
  .lead-sticky {
    padding-top: 72px;
    padding-bottom: calc(104px + env(safe-area-inset-bottom, 0px));
  }

  .lead-entry {
    padding: 8px 0;
  }

  .lead-entry h2 {
    font-size: 30px;
    margin-bottom: 14px;
  }

  .lead-scope {
    font-size: 15px;
    margin-bottom: 20px;
  }

  .lead-form {
    padding: 18px 20px;
  }

  .lead-field input {
    height: 38px;
    font-size: 22px;
  }

  .lead-submit.button {
    min-height: 48px;
    margin-top: 14px;
    padding-top: 11px;
    padding-bottom: 11px;
  }

  .lead-authorisation {
    margin-top: 14px;
  }

  .lead-work {
    padding: 12px 20px;
  }

  .lead-progress-ring {
    width: min(100%, 190px);
  }

  .lead-current-action {
    width: 80%;
    font-size: 18px;
  }

  .lead-result-actions {
    margin-top: 14px;
  }

  .lead-reset {
    margin-top: 12px;
  }
}

@media (prefers-reduced-motion: no-preference) and (min-height: 700px),
  (prefers-reduced-motion: no-preference) and (max-width: 650px) and (min-height: 560px) {
  .sentinel-lead {
    min-height: 500svh;
  }

  .lead-sticky {
    position: sticky;
    top: var(--lead-sticky-top, 0px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .lead-entry {
    --lead-entry-focus: 1;
    --lead-entry-action: 1;
  }

  .lead-panel,
  .lead-current-action,
  .lead-result-actions {
    transition: none;
  }
}
