:root {
  background: #232323;
  color: #d8d8d8;
  color-scheme: light;
  font-family:
    "Avenir Next", Avenir, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  background: #232323;
  margin: 0;
  min-height: 100vh;
}

.shell {
  align-items: center;
  display: grid;
  justify-items: center;
  min-height: 100vh;
  padding: 0;
}

.panel {
  background:
    radial-gradient(circle at 14% 8%, rgba(255, 247, 231, 0.09), transparent 30%),
    linear-gradient(135deg, rgba(255, 247, 231, 0.035), rgba(17, 17, 17, 0.12)),
    #232323;
  border: 1px solid rgba(216, 216, 216, 0.18);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
  padding: clamp(22px, 5vw, 36px);
  width: min(100%, 460px);
}

.embedded,
.embedded body {
  min-height: 100vh;
  overflow: hidden;
}

.embedded .shell {
  align-items: start;
  min-height: 100vh;
  overflow: hidden;
}

.embedded .panel {
  height: 100vh;
  min-height: 100vh;
  overflow: auto;
  padding-bottom: 26px;
  padding-left: 20px;
  padding-right: 20px;
}

.embedded h1 {
  font-size: clamp(1.85rem, 6.1vw, 2.25rem);
}

.embedded .copy {
  font-size: 0.95rem;
}

.embedded .status {
  visibility: hidden;
}

.embedded .status:not(:empty) {
  visibility: visible;
}

.embedded .suggestion {
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 10px;
}

.embedded .suggestion p {
  font-size: 0.72rem;
  margin-bottom: 2px;
}

.embedded .suggestion strong {
  font-size: 0.94rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.embedded .suggestion-actions {
  flex: 0 0 auto;
}

.embedded .small-button {
  font-size: 0.8rem;
  min-height: 32px;
  padding: 0 9px;
}

.brand-row {
  align-items: center;
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}

.bionic-mark {
  background:
    radial-gradient(circle at 50% 50%, #151210 0 54%, transparent 55%),
    radial-gradient(circle at 50% 50%, #fffaf0 0 58%, rgba(232, 214, 168, 0.74) 66%, transparent 78%);
  border-radius: 50%;
  box-shadow:
    0 0 10px rgba(255, 247, 231, 0.44),
    0 0 22px rgba(183, 135, 66, 0.28);
  display: inline-grid;
  flex: 0 0 30px;
  height: 30px;
  place-items: center;
  position: relative;
  width: 30px;
}

.bionic-mark::after {
  background: radial-gradient(
    circle at 68% 30%,
    rgba(255, 250, 240, 0.92) 0 5%,
    rgba(232, 214, 168, 0.34) 8%,
    transparent 20%
  );
  border-radius: 50%;
  content: "";
  inset: 2px;
  opacity: 0.7;
  position: absolute;
}

.eyebrow {
  color: rgba(255, 247, 231, 0.68);
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  margin: 0;
  text-transform: uppercase;
}

h1 {
  color: #fff7e7;
  font-size: clamp(2rem, 7vw, 2.85rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 0.98;
  margin: 0;
}

.copy {
  color: rgba(216, 216, 216, 0.72);
  font-size: 1.05rem;
  line-height: 1.45;
  margin: 12px 0 22px;
}

.mode-switch {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(216, 216, 216, 0.16);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
  margin: 0 0 18px;
  padding: 7px;
  width: 100%;
}

.mode-switch button {
  background: transparent;
  border: 0;
  border-radius: 7px;
  box-shadow: none;
  color: rgba(216, 216, 216, 0.68);
  font-weight: 400;
  min-height: 46px;
}

.mode-switch button[aria-selected="true"] {
  background:
    radial-gradient(circle at 14% 50%, #fffdf6, rgba(255, 247, 231, 0.92) 22%, transparent 23%),
    linear-gradient(90deg, #fff9ed, #f1e4c9 60%, #d9bf86);
  box-shadow:
    0 14px 32px rgba(0, 0, 0, 0.22),
    inset 0 0 0 1px rgba(255, 250, 240, 0.62);
  color: #161616;
}

.form {
  display: grid;
  gap: 13px;
  width: 100%;
}

.field-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

label {
  color: #fff7e7;
  font-size: 0.96rem;
  font-weight: 400;
}

.availability {
  color: rgba(216, 216, 216, 0.58);
  font-size: 0.82rem;
  min-height: 1em;
  text-align: right;
}

.availability[data-state="available"] {
  color: #e8d6a8;
}

.availability[data-state="taken"],
.availability[data-state="error"] {
  color: #f0b9a7;
}

.availability[data-state="checking"] {
  color: rgba(216, 216, 216, 0.62);
}

.suggestion {
  align-items: center;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(232, 214, 168, 0.24);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto;
  padding: 12px;
}

.suggestion p {
  color: rgba(216, 216, 216, 0.62);
  font-size: 0.78rem;
  margin: 0 0 4px;
}

.suggestion strong {
  color: #fff7e7;
  display: block;
  font-size: 1rem;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.suggestion-actions {
  display: flex;
  gap: 8px;
}

.small-button {
  background: rgba(255, 247, 231, 0.06);
  border: 1px solid rgba(232, 214, 168, 0.32);
  color: #fff7e7;
  font-size: 0.88rem;
  font-weight: 400;
  min-height: 36px;
  padding: 0 11px;
}

input {
  background: rgba(17, 17, 17, 0.32);
  border: 1px solid rgba(216, 216, 216, 0.2);
  border-radius: 8px;
  color: #fff7e7;
  font: inherit;
  font-size: 1.05rem;
  min-height: 48px;
  padding: 0 15px;
  width: 100%;
}

input::placeholder {
  color: rgba(216, 216, 216, 0.44);
}

input:focus {
  border-color: rgba(232, 214, 168, 0.58);
  outline: 3px solid rgba(232, 214, 168, 0.22);
}

.actions {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.capability,
.backup-panel,
.backup-codes-panel {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(136, 174, 187, 0.22);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
  padding: 12px;
}

.capability p,
.backup-codes-panel p {
  color: #fff7e7;
  font-size: 0.95rem;
  margin: 0;
}

.capability span {
  color: rgba(216, 216, 216, 0.64);
  font-size: 0.86rem;
  line-height: 1.4;
}

.backup-panel {
  border-color: rgba(189, 214, 206, 0.22);
  margin-top: 16px;
}

.backup-codes-panel {
  border-color: rgba(232, 214, 168, 0.28);
  margin-top: 16px;
}

.backup-panel-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.backup-panel-head h2 {
  color: #fff7e7;
  font-size: 1rem;
  font-weight: 400;
  margin: 0;
}

.backup-code-list {
  display: grid;
  gap: 7px;
  list-style-position: inside;
  margin: 0;
  padding: 0;
}

.backup-code-list li {
  background: rgba(17, 17, 17, 0.28);
  border: 1px solid rgba(216, 216, 216, 0.12);
  border-radius: 7px;
  color: #fff7e7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
  padding: 8px 10px;
}

.backup-code-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}

.secondary-action,
.download-button {
  background: rgba(255, 247, 231, 0.06);
  border: 1px solid rgba(232, 214, 168, 0.32);
  border-radius: 8px;
  color: #fff7e7;
  min-height: 44px;
}

.download-button {
  align-items: center;
  display: inline-flex;
  font-size: 0.95rem;
  justify-content: center;
  text-decoration: none;
}

.wallet-link-panel {
  border-top: 1px solid rgba(216, 216, 216, 0.12);
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
}

.wallet-link-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.wallet-link-head h2 {
  color: #fff7e7;
  font-size: 1rem;
  font-weight: 400;
  margin: 0;
}

.wallet-link-state {
  border: 1px solid rgba(136, 174, 187, 0.34);
  border-radius: 999px;
  color: #bdd6ce;
  font-size: 0.78rem;
  padding: 5px 9px;
  text-transform: capitalize;
}

.wallet-link-result {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(136, 174, 187, 0.22);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.wallet-link-qr {
  background: #ffffff;
  border-radius: 8px;
  display: grid;
  justify-self: center;
  padding: 0;
  width: min(100%, 320px);
}

.wallet-link-qr svg {
  display: block;
  height: 100%;
  width: 100%;
}

.embedded .wallet-link-qr {
  width: min(100%, 280px);
}

.wallet-link-url {
  color: #bdd6ce;
  font-size: 0.94rem;
  overflow-wrap: anywhere;
  text-decoration-color: rgba(189, 214, 206, 0.38);
}

.wallet-link-code {
  color: rgba(216, 216, 216, 0.58);
  font-size: 0.82rem;
  margin: 0;
  overflow-wrap: anywhere;
}

button {
  background:
    radial-gradient(circle at 14% 50%, #fffdf6, rgba(255, 247, 231, 0.9) 22%, transparent 23%),
    linear-gradient(90deg, #fff9ed, #f1e4c9 60%, #d9bf86);
  border: 1px solid rgba(183, 135, 66, 0.26);
  border-radius: 8px;
  color: #111111;
  cursor: pointer;
  font: inherit;
  font-weight: 400;
  min-height: 48px;
  padding: 0 16px;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.status {
  background: rgba(255, 255, 255, 0.045);
  border-radius: 8px;
  border: 1px solid rgba(216, 216, 216, 0.1);
  color: rgba(216, 216, 216, 0.76);
  display: block;
  font-size: 0.96rem;
  line-height: 1.45;
  margin-top: 16px;
  min-height: 44px;
  overflow-wrap: anywhere;
  padding: 12px;
  white-space: pre-line;
}

@media (max-width: 460px) {
  .shell {
    padding: 0;
  }

  .panel {
    padding: 22px;
  }

  .mode-switch button,
  button {
    min-height: 48px;
  }

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