:root {
  color-scheme: only dark;
  --background: #0b0e12;
  --surface: #12171d;
  --surface-raised: #171d24;
  --line: #29323c;
  --line-strong: #3b4754;
  --text: #f3f6f2;
  --muted: #98a4af;
  --accent: #7bf0a5;
  --accent-ink: #07130c;
  --warning: #ffcf70;
  --error: #ff7f87;
  --radius: 14px;
  --shadow: 0 24px 70px rgb(0 0 0 / 28%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--background);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--background);
}

button,
select,
input {
  font: inherit;
}

a {
  color: inherit;
}

.page-shell {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 88px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-weight: 850;
  letter-spacing: -0.08em;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 0.94rem;
  letter-spacing: 0.02em;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.text-link {
  color: var(--muted);
  text-decoration: none;
  transition: color 160ms ease;
}

.text-link:hover {
  color: var(--accent);
}

.account-actions,
.signed-in-user {
  display: flex;
  align-items: center;
}

.account-actions {
  gap: 18px;
}

.account-actions form {
  margin: 0;
}

.signed-in-user {
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

.user-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgb(123 240 165 / 10%);
}

.logout-button {
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 0.76rem;
  transition: border-color 160ms ease, color 160ms ease;
}

.logout-button:hover,
.logout-button:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 40px;
  padding: 84px 0 58px;
}

.eyebrow,
.section-kicker,
.summary-label {
  margin: 0;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 24px;
  font-size: clamp(2.8rem, 7vw, 5.6rem);
  line-height: 0.94;
  letter-spacing: -0.065em;
}

h2 {
  margin-bottom: 0;
  font-size: 1.35rem;
  letter-spacing: -0.025em;
}

.browser-state {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  color: var(--muted);
  font-size: 0.84rem;
  white-space: nowrap;
}

.state-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 0 5px rgb(255 207 112 / 10%);
}

.browser-state.is-ready .state-dot {
  background: var(--accent);
  box-shadow: 0 0 0 5px rgb(123 240 165 / 10%);
}

.browser-state.is-error .state-dot {
  background: var(--error);
  box-shadow: 0 0 0 5px rgb(255 127 135 / 10%);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.48fr) minmax(300px, 0.72fr);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.installer-panel,
.guide-panel {
  padding: clamp(28px, 5vw, 52px);
  background: var(--surface);
}

.guide-panel {
  border-left: 1px solid var(--line);
  background: var(--surface-raised);
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 30px;
}

.step-number {
  display: grid;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.section-kicker {
  margin-bottom: 5px;
}

.field-group {
  margin: 0 0 24px;
  padding: 0;
  border: 0;
}

.field-group > label,
.field-group > legend {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.select-wrap {
  position: relative;
}

.select-wrap::after {
  position: absolute;
  top: 50%;
  right: 18px;
  color: var(--muted);
  content: "⌄";
  pointer-events: none;
  transform: translateY(-58%);
}

select {
  width: 100%;
  height: 54px;
  padding: 0 48px 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  outline: none;
  color: var(--text);
  background: #0f1318;
  appearance: none;
}

select:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(123 240 165 / 12%);
}

select:disabled {
  cursor: wait;
  opacity: 0.6;
}

.flavor-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.flavor-option {
  position: relative;
  min-width: 0;
}

.flavor-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.flavor-option span {
  display: block;
  min-height: 80px;
  padding: 16px;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.flavor-option strong,
.flavor-option small {
  display: block;
}

.flavor-option strong {
  margin-bottom: 6px;
  font-size: 0.94rem;
}

.flavor-option small {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.flavor-option input:checked + span {
  border-color: var(--accent);
  background: rgb(123 240 165 / 6%);
}

.flavor-option input:focus-visible + span {
  box-shadow: 0 0 0 3px rgb(123 240 165 / 12%);
}

.flavor-option input:disabled + span {
  cursor: not-allowed;
  opacity: 0.36;
}

.release-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 20px;
  margin: 30px 0 44px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.release-summary strong {
  display: block;
  margin-top: 5px;
  font-size: 1rem;
}

.release-summary p {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.release-badge {
  align-self: start;
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.release-badge.is-prerelease {
  border-color: rgb(255 207 112 / 50%);
  color: var(--warning);
}

.install-heading {
  margin-bottom: 22px;
}

esp-web-install-button {
  display: block;
  --esp-tools-button-color: var(--accent);
  --esp-tools-button-text-color: var(--accent-ink);
  --esp-tools-button-border-radius: 0;
}

.install-action {
  width: 100%;
  min-height: 56px;
  padding: 14px 22px;
  border: 1px solid var(--accent);
  border-radius: 0;
  color: var(--accent-ink);
  background: var(--accent);
  cursor: pointer;
  font-weight: 800;
  transition: filter 160ms ease, transform 160ms ease;
}

.install-action:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.install-action:focus-visible {
  outline: 3px solid rgb(123 240 165 / 25%);
  outline-offset: 3px;
}

.install-action:disabled {
  border-color: var(--line-strong);
  color: #707b85;
  background: #222931;
  cursor: wait;
}

.inline-message,
.load-status {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

.secondary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
  margin-top: 18px;
}

.secondary-actions.single-action {
  justify-content: flex-start;
}

.ota-action {
  display: flex;
  width: 100%;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  padding: 14px 22px;
  border: 1px solid var(--warning);
  border-radius: 0;
  color: #1b1200;
  background: var(--warning);
  font-weight: 800;
  text-decoration: none;
  transition: filter 160ms ease, transform 160ms ease;
}

.ota-action:hover:not(.is-disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.ota-action:focus-visible {
  outline: 3px solid rgb(255 207 112 / 25%);
  outline-offset: 3px;
}

.ota-action.is-disabled {
  border-color: var(--line-strong);
  color: #707b85;
  background: #222931;
  cursor: wait;
  pointer-events: none;
}

.load-status {
  min-height: 1.2em;
  margin: 18px 0 0;
}

.load-status.is-error {
  color: var(--error);
}

.load-status:empty {
  display: none;
}

.guide-panel > h2 {
  margin: 6px 0 34px;
}

.check-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-list li {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 14px;
  padding: 21px 0;
  border-top: 1px solid var(--line);
}

.check-list li:last-child {
  border-bottom: 1px solid var(--line);
}

.check-list li > span {
  color: var(--accent);
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.75rem;
}

.check-list strong {
  display: block;
  margin-bottom: 7px;
  font-size: 0.9rem;
}

.check-list p,
.compatibility-note p {
  margin: 0;
  color: var(--muted);
  font-size: 0.79rem;
  line-height: 1.6;
}

.compatibility-note {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  margin-top: 28px;
  padding: 17px;
  border: 1px solid var(--line);
  background: #10151a;
}

.note-icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--accent);
  font-family: Georgia, serif;
  font-size: 0.75rem;
  font-weight: 700;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 32px 0 44px;
  color: #68737d;
  font-size: 0.72rem;
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 36px;
  background:
    linear-gradient(90deg, transparent 49.9%, rgb(255 255 255 / 3%) 50%, transparent 50.1%),
    radial-gradient(circle at 18% 22%, rgb(123 240 165 / 8%), transparent 32%),
    var(--background);
}

.login-shell {
  display: grid;
  width: min(980px, 100%);
  min-height: 590px;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.92fr);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.login-intro,
.login-card {
  padding: clamp(34px, 6vw, 62px);
}

.login-intro {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface);
}

.login-brand {
  align-self: flex-start;
}

.login-intro h1 {
  margin: 10px 0 22px;
  font-size: clamp(3rem, 6vw, 5rem);
}

.login-intro > div {
  margin-block: auto;
}

.login-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid var(--line);
  background: var(--surface-raised);
}

.login-card-heading {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 32px;
}

.login-lock {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line-strong);
  color: var(--accent);
  font-size: 1.2rem;
}

.login-error {
  margin-bottom: 22px;
  padding: 13px 15px;
  border: 1px solid rgb(255 127 135 / 45%);
  color: var(--error);
  background: rgb(255 127 135 / 6%);
  font-size: 0.8rem;
  line-height: 1.5;
}

.login-form {
  display: grid;
}

.login-form label {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.login-form input {
  width: 100%;
  height: 52px;
  margin-bottom: 20px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  outline: none;
  color: var(--text);
  background: #0f1318;
}

.login-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(123 240 165 / 12%);
}

.login-button {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding: 0 18px;
  border: 1px solid var(--accent);
  border-radius: 0;
  color: var(--accent-ink);
  background: var(--accent);
  cursor: pointer;
  font-weight: 800;
  transition: filter 160ms ease, transform 160ms ease;
}

.login-button:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.login-button:focus-visible {
  outline: 3px solid rgb(123 240 165 / 25%);
  outline-offset: 3px;
}

.login-footnote {
  margin: 24px 0 0;
  color: #68737d;
  font-size: 0.72rem;
  line-height: 1.55;
}

@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-top: 60px;
  }

  .browser-state {
    justify-self: start;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .guide-panel {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .login-page {
    padding: 20px;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-intro {
    min-height: 430px;
  }

  .login-card {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 560px) {
  .page-shell {
    width: min(100% - 24px, 1120px);
  }

  .site-header {
    min-height: 72px;
  }

  .signed-in-user {
    display: none;
  }

  .hero {
    padding: 48px 0 38px;
  }

  h1 {
    font-size: clamp(2.55rem, 14vw, 4rem);
  }

  .flavor-options {
    grid-template-columns: 1fr;
  }

  .site-footer {
    flex-direction: column;
  }

  .login-page {
    padding: 0;
  }

  .login-shell {
    min-height: 100vh;
    border: 0;
  }

  .login-intro {
    min-height: 390px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
