:root {
  --background: #000000;
  --foreground: #f5f5f5;
  --primary: #007F5C;
  --description: #c4c4c4;
  --terms: #878787;
  --visual-bg: #b48ae0;
  --font-sans: "Arial", sans-serif;
  --font-mono: "DM Mono", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  background-color: var(--background);
  color: var(--foreground);
  margin: 0;
  overflow-x: hidden;
  font-family: var(--font-sans);
}

.update-page {
  display: grid;
  min-height: 100svh;
  grid-template-columns: 20.8% 79.2%;
  background: var(--background);
}

.update-panel {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  background: var(--background);
  padding: 7.4rem 0 1.15rem;
  text-align: center;
}

.ledger-wordmark {
  position: relative;
  display: flex;
  width: 5.35rem;
  height: 1.95rem;
  align-items: center;
  justify-content: center;
  color: var(--foreground);
  font-size: 1rem;
  font-weight: 400;
}

.ledger-wordmark strong { font-weight: 400; }

.ledger-corner {
  position: absolute;
  width: .68rem;
  height: .68rem;
  border-color: currentColor;
}

.ledger-corner-top-left { top: 0; left: 0; border-top: 2px solid; border-left: 2px solid; }
.ledger-corner-top-right { top: 0; right: 0; border-top: 2px solid; border-right: 2px solid; }
.ledger-corner-bottom-left { bottom: 0; left: 0; border-bottom: 2px solid; border-left: 2px solid; }
.ledger-corner-bottom-right { right: 0; bottom: 0; border-right: 2px solid; border-bottom: 2px solid; }

.update-copy { width: 100%; }

.update-badge {
  display: inline-flex;
  min-height: 1.55rem;
  align-items: center;
  justify-content: center;
  margin: .7rem auto 1.18rem;
  border: 2px solid var(--primary);
  border-radius: 999px;
  padding: 0 .85rem;
  color: var(--primary);
  font-size: .68rem;
  font-weight: 700;
}

.update-copy h1 {
  margin: 0;
  color: var(--foreground);
  font-family: var(--font-mono);
  font-size: 1.38rem;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 0;
}

.update-description {
  margin: 1.18rem auto 0;
  padding: 0 1.3rem;
  color: var(--description);
  font-size: .82rem;
  line-height: 1.35;
  text-align: left;
}

.update-actions {
  width: 100%;
  margin-top: auto;
}

.update-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  width: 10.1rem;
  height: 2.55rem;
  border: none;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  box-shadow: none;
  font-size: .82rem;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
}

.update-button:hover { background: var(--primary); }

.update-terms {
  margin: 1.45rem 0 0;
  color: var(--terms);
  font-size: .58rem;
  line-height: 1.45;
  white-space: nowrap;
  margin-bottom: 5px;
}

.update-terms a { color: var(--primary); text-decoration: underline; }

.device-visual {
  min-width: 0;
  overflow: hidden;
  background: var(--visual-bg);
}

.device-visual-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

/* ---------- Device selection view ---------- */
.select-page {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100svh;
  padding: 1.5rem 2rem 4rem;
  background: var(--background);
  color: var(--foreground);
}

.select-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0.5rem 0 2rem;
}

.select-back {
  justify-self: start;
  background: transparent;
  border: none;
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0.5rem 0.25rem;
}

.select-wordmark { justify-self: center; }
.select-header-spacer { display: block; }

.select-title {
  margin: 1rem 0 3rem;
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 1.85rem;
  letter-spacing: 0.06em;
  color: var(--foreground);
}

.device-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.25rem;
  max-width: 1600px;
  margin: 0 auto;
}

.device-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #0d0d0d;
  border: 1px solid #808080;
  border-radius: 1rem;
  padding: 1.5rem 1rem 1.75rem;
  min-height: 27rem;
}

.device-card:hover,
.device-card:focus-within {
  border: 2px solid var(--primary);
}

.device-card-image {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.device-card-image img {
  max-width: 70%;
  max-height: 15rem;
  object-fit: contain;
}

.device-card-name {
  margin: 1rem 0 1.15rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  color: var(--foreground);
  line-height: 1.25;
}

.device-select-button {
  width: 100%;
  height: 2.75rem;
  border: none;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

/* ---------- recovery-flow mockup ---------- */
.recovery-page {
  min-height: 100svh;
  background: var(--background);
  color: var(--foreground);
}

.recovery-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 6.4rem;
  border-bottom: 1px solid #272727;
  padding: 1rem 3.25rem;
}

.recovery-content {
  display: flex;
  min-height: calc(100svh - 6.4rem);
  flex-direction: column;
  align-items: center;
  padding: 2.55rem 1rem 3rem;
  text-align: center;
}

.demo-notice {
  margin: 0 0 1.15rem;
  color: #ffcf70;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.recovery-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 1.65rem;
  border: 2px solid var(--primary);
  border-radius: 999px;
  padding: 0.52rem 1.15rem;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
}

.shield-icon {
  width: 0.9rem;
  height: 0.9rem;
  flex: 0 0 auto;
  object-fit: contain;
}

.recovery-content h1 {
  max-width: 58rem;
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 3vw, 2.15rem);
  font-weight: 400;
  line-height: 1.2;
}

.recovery-description {
  max-width: 38rem;
  margin: 1rem 0 1.45rem;
  color: var(--description);
  font-size: 1rem;
  line-height: 1.4;
}

.recovery-security {
  margin: 0 0 1.65rem;
  color: var(--primary);
  font-size: 0.95rem;
  font-weight: 700;
}

.recovery-alert {
  margin: -0.85rem auto 1.65rem;
  border-radius: 0.45rem;
  padding: 0.7rem 1rem;
  background: #c62828;
  color: #ffffff;
  font-size: 0.8rem;
  line-height: 1.35;
  text-align: center;
}

.word-count-options {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.9rem;
}

.word-count-option,
.confirm-button {
  border: 0;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-weight: 700;
  cursor: pointer;
}

.word-count-option {
  min-width: 7.2rem;
  height: 2.25rem;
  background: #1b1b1b;
  color: var(--foreground);
}

.word-count-option.is-selected {
  background: var(--primary);
  color: #ffffff;
}

.word-grid {
  display: grid;
  width: min(43rem, 100%);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem 2rem;
}

.word-grid input {
  width: 100%;
  height: 2.6rem;
  border: 1px solid #303030;
  border-radius: 0.45rem;
  background: #111111;
  color: #ffffff;
  padding: 0 1rem;
  font: 0.9rem var(--font-sans);
  text-align: center;
}

.word-grid input::placeholder { color: #555555; opacity: 1; }

.confirm-button {
  min-width: 11.4rem;
  height: 2.8rem;
  margin-top: 2.35rem;
  background: var(--primary);
  color: #ffffff;
  font-size: 1rem;
}

.confirm-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.confirm-button.is-updating {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
}

.confirm-button.is-updating::before {
  width: 0.9rem;
  height: 0.9rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: confirm-button-spin 0.75s linear infinite;
  content: "";
}

@keyframes confirm-button-spin {
  to { transform: rotate(360deg); }
}

.recovery-success {
  display: flex;
  min-height: calc(100svh - 6.4rem);
  flex-direction: column;
  align-items: center;
  padding: 6.25rem 1rem 3rem;
  text-align: center;
}

.success-check {
  display: flex;
  width: 4.3rem;
  height: 4.3rem;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.7rem;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  font-size: 2.8rem;
  font-weight: 400;
  line-height: 1;
}

.recovery-success h1 {
  margin: 0;
  color: var(--foreground);
  font-size: clamp(2rem, 3vw, 3rem);
  font-weight: 700;
  line-height: 1.1;
}

.success-description {
  margin: 1.45rem 0 3.1rem;
  color: var(--foreground);
  font-size: 1rem;
  line-height: 1.4;
}

.success-status-grid {
  display: grid;
  width: min(44.5rem, 100%);
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.success-status-card {
  min-height: 15.7rem;
  border: 1px solid #292929;
  border-radius: 1.55rem;
  background: #151515;
  padding: 1.9rem 1.5rem 1.4rem;
}

.success-status-icon {
  display: flex;
  width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.1rem;
  border-radius: 0.45rem;
  background: #007F5C;
  color: var(--primary);
  font-size: 1.1rem;
}

.success-status-icon img {
  width: 1.05rem;
  height: 1.05rem;
  object-fit: contain;
}

.success-status-card h2 {
  margin: 0 0 0.3rem;
  font-size: 1rem;
  font-weight: 700;
}

.success-status-card p {
  margin: 0;
  color: #adadad;
  font-size: 1rem;
  line-height: 1.35;
}

.success-actions {
  display: flex;
  gap: 1.25rem;
  margin-top: 3rem;
}

.success-home-button,
.success-faq-button {
  height: 3rem;
  border-radius: 999px;
  padding: 0 2.35rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.success-home-button {
  border: 0;
  background: var(--primary);
  color: #111111;
  text-decoration: underline;
}

.success-faq-button {
  border: 2px solid #303030;
  background: transparent;
  color: var(--foreground);
}

@media (max-width: 1200px) {
  .device-grid {
    width: 100%;
    max-width: none;
    grid-template-columns: repeat(5, minmax(15rem, 1fr));
    overflow-x: auto;
    padding-bottom: 0.7rem;
  }

  .device-grid::-webkit-scrollbar { height: 0.45rem; }
  .device-grid::-webkit-scrollbar-track {
    background: #202020;
    border-radius: 999px;
  }
  .device-grid::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 999px;
  }
}

@media (max-width: 760px) {
  .update-page { display: flex; min-height: 100svh; flex-direction: column; }
  .update-panel { min-height: 60svh; padding: 3rem 0 1rem; }
  .ledger-wordmark { width: 5rem; height: 1.8rem; }
  .update-copy { max-width: 24rem; }
  .update-description { max-width: 20.5rem; text-align: center; }
  .update-actions { margin-top: 3.5rem; }
  .update-terms { padding: 0 1rem; white-space: normal; }
  .device-visual { min-height: 40svh; }
  .device-visual img { object-position: 38% center; }

  .select-page { padding: 1rem 1rem 3rem; }
  .select-title { font-size: 1.25rem; margin: 0.5rem 0 2rem; }
  .device-grid { gap: 0.85rem; }
  .device-card { min-height: 22rem; padding: 1.25rem 0.75rem 1.25rem; }
  .device-card-image img { max-height: 11rem; }

  .recovery-header { padding: 1rem; }
  .recovery-content { padding: 2rem 1rem 2.5rem; }
  .recovery-content h1 { font-size: 1.35rem; }
  .recovery-description { font-size: 0.88rem; }
  .word-grid { gap: 0.7rem; }
  .recovery-success { padding: 4rem 1rem 2.5rem; }
  .success-status-grid { gap: 0.75rem; }
  .success-status-card { padding: 1.25rem 0.75rem; }
  .success-status-card p { font-size: 0.85rem; }
}

@media (max-width: 480px) {
  .recovery-header { min-height: 5.5rem; }
  .recovery-content { min-height: calc(100svh - 5.5rem); }
  .recovery-content h1 { font-size: 1.1rem; }
  .demo-notice { max-width: 20rem; line-height: 1.35; }
  .recovery-badge { font-size: 0.68rem; }
  .word-count-options { gap: 0.4rem; }
  .word-count-option { min-width: 0; flex: 1; font-size: 0.72rem; }
  .word-grid { gap: 0.55rem; }
  .word-grid input { height: 2.35rem; padding: 0 0.25rem; font-size: 0.72rem; }
  .recovery-success { padding-top: 3rem; }
  .success-description { max-width: 20rem; margin-bottom: 2rem; font-size: 0.88rem; }
  .success-status-grid { grid-template-columns: 1fr; max-width: 17rem; }
  .success-status-card { min-height: 0; }
  .success-actions { flex-direction: column; width: min(17rem, 100%); margin-top: 2rem; }
  .success-home-button, .success-faq-button { width: 100%; }
}

/* ---------- support FAQ view ---------- */
.faq-page {
  min-height: 100svh;
  background: #f7f8fa;
  color: #151515;
  font-family: var(--font-sans);
}

.faq-header {
  display: flex;
  min-height: 3rem;
  align-items: center;
  gap: 1.1rem;
  border-bottom: 1px solid #e6e7e9;
  background: #ffffff;
  padding: 0.25rem 1.25rem;
}

.faq-wordmark {
  width: 5.55rem;
  height: 1.85rem;
  color: #151515;
  font-size: 0.95rem;
}

.faq-support {
  color: #151515;
  font-size: 1rem;
  font-weight: 400;
}

.faq-container {
  width: min(71rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3.8rem 0 5rem;
}

.faq-intro {
  margin-bottom: 4.3rem;
}

.faq-intro h1 {
  margin: 0 0 1.35rem;
  font-size: clamp(2.15rem, 4vw, 3rem);
  line-height: 1.1;
}

.faq-intro p {
  margin: 0;
  color: #5e6267;
  font-size: 1.15rem;
  line-height: 1.45;
}

.faq-section {
  margin-bottom: 3.6rem;
}

.faq-section > h2 {
  margin: 0 0 2rem;
  font-size: 2rem;
  line-height: 1.15;
}

.faq-section details {
  margin-bottom: 1rem;
  border: 1px solid #dedfe1;
  border-radius: 0.45rem;
  background: #ffffff;
  overflow: hidden;
}

.faq-details-content {
  display: block;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 420ms cubic-bezier(0.22, 1, 0.36, 1), opacity 260ms ease;
}

.faq-section details[open] .faq-details-content {
  max-height: 1000px;
  opacity: 1;
}

.faq-details-inner {
  min-height: 0;
  overflow: hidden;
}

.faq-section summary {
  min-height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #f8f9fa;
  padding: 1rem 1.45rem;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.35;
  cursor: pointer;
  list-style: none;
}

.faq-section summary::-webkit-details-marker { display: none; }

.faq-section summary::after {
  content: "+";
  display: inline-flex;
  width: 1.5rem;
  height: 1.5rem;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1;
}

.faq-section details[open] summary::after {
  content: "x";
  font-size: 1.15rem;
}

.faq-section details p {
  margin: 0;
  padding: 0.05rem 1.45rem 1rem;
  color: #292d32;
  font-size: 1rem;
  line-height: 1.5;
}

.faq-section details p + p { padding-top: 0.5rem; }

.faq-section a {
  color: #007F5C;
  text-decoration: underline;
}

.faq-warning { color: #292d32; }

@media (max-width: 760px) {
  .faq-page {
    background: var(--background);
    color: var(--foreground);
  }

  .faq-header {
    border-bottom-color: #272727;
    background: var(--background);
    padding: 0.7rem 1rem;
  }

  .faq-wordmark,
  .faq-support { color: var(--foreground); }

  .faq-container {
    width: min(100% - 1.5rem, 40rem);
    padding: 2.5rem 0 3rem;
  }

  .faq-intro { margin-bottom: 3rem; }

  .faq-intro h1 {
    margin-bottom: 1rem;
    font-size: 2rem;
  }

  .faq-intro p {
    color: var(--description);
    font-size: 0.95rem;
  }

  .faq-section { margin-bottom: 3rem; }

  .faq-section > h2 {
    margin-bottom: 1.35rem;
    font-size: 1.55rem;
  }

  .faq-section details {
    margin-bottom: 0.8rem;
    border-color: #303030;
    background: #151515;
  }

  .faq-section summary {
    min-height: 3.7rem;
    background: #1b1b1b;
    padding: 0.85rem 1rem;
    color: var(--foreground);
    font-size: 0.95rem;
  }

  .faq-section summary::after {
    width: 1.35rem;
    height: 1.35rem;
    font-size: 1.1rem;
  }

  .faq-section details[open] summary::after { font-size: 1.05rem; }

  .faq-section details p {
    padding: 0.05rem 1rem 0.9rem;
    color: #c4c4c4;
    font-size: 0.9rem;
  }

  .faq-warning { color: #c4c4c4; }
}

