:root {
  color-scheme: dark;
  --bg: #151c23;
  --panel: #1f2a33;
  --panel-strong: #23313d;
  --field-bg: #263543;
  --text: #f7f9fb;
  --muted: #9aa6b2;
  --line: rgba(7, 13, 18, 0.44);
  --link: #4cb3ff;
  --button: #2d95df;
  --button-text: #ffffff;
  --secondary-button: #33424f;
  --capsule: #2b3640;
  --capsule-text: #ffffff;
  --danger: #e8665e;
  --avatar: #ffb65f;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #f0f1f7;
  --panel-strong: #ffffff;
  --field-bg: #ffffff;
  --text: #0f1115;
  --muted: #8f8f98;
  --line: rgba(60, 60, 67, 0.16);
  --link: #0088ff;
  --button: #0a8ff5;
  --button-text: #ffffff;
  --secondary-button: #e4e7ee;
  --capsule: #edf0f5;
  --capsule-text: #0f1115;
  --danger: #d74b44;
  --avatar: #ffb65f;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  font: 15px/1.35 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app {
  width: min(720px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 16px 56px;
}

.view {
  animation: view-in 140ms ease-out;
}

.hero {
  display: grid;
  justify-items: center;
  padding: 18px 18px 28px;
  text-align: center;
}

.compact-hero {
  padding-top: 20px;
  padding-bottom: 28px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 16px;
  font-size: clamp(30px, 7.2vw, 38px);
  font-weight: 780;
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  font-size: clamp(24px, 6vw, 30px);
  font-weight: 780;
  line-height: 1.12;
  letter-spacing: 0;
}

.lead {
  max-width: 540px;
  margin-top: 12px;
  color: var(--muted);
  font-size: clamp(16px, 4vw, 20px);
  font-weight: 520;
}

.handle {
  margin-top: 10px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 600;
}

.avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--avatar), #ffc06f);
  color: #ffffff;
  font-weight: 760;
  letter-spacing: 0;
}

.avatar-xl {
  width: 96px;
  height: 96px;
  font-size: 42px;
}

.logo-avatar {
  overflow: hidden;
  background: #df1712;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.logo-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-sm {
  width: 56px;
  height: 56px;
  font-size: 23px;
}

.muted-avatar {
  background: var(--secondary-button);
  color: var(--muted);
}

.section,
.settings-section {
  margin-top: 22px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin: 0 22px 14px;
}

.section-head span {
  color: var(--muted);
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
}

.settings-section h2 {
  margin: 0 22px 14px;
}

.list-card,
.settings-card,
.access-card,
.notice,
.token-card {
  overflow: hidden;
  border-radius: 12px;
  background: var(--panel);
}

.list-row,
.settings-row {
  appearance: none;
  width: 100%;
  min-height: 74px;
  border: 0;
  border-top: 1px solid var(--line);
  padding: 12px 22px;
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.list-card > :first-child,
.settings-card > :first-child {
  border-top: 0;
}

.add-row {
  min-height: 72px;
  color: var(--link);
  font-size: 20px;
  font-weight: 650;
}

.plus-icon {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 3px solid var(--link);
  border-radius: 50%;
  color: transparent;
  font-size: 0;
  line-height: 0;
}

.plus-icon::before,
.plus-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 19px;
  height: 3px;
  border-radius: 999px;
  background: var(--link);
  transform: translate(-50%, -50%);
}

.plus-icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.row-text {
  min-width: 0;
  flex: 1 1 auto;
}

.row-text strong,
.static-row strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 20px;
  font-weight: 730;
  line-height: 1.2;
}

.row-text small,
.static-row small {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 16px;
  font-weight: 550;
  line-height: 1.22;
}

.chevron {
  margin-left: auto;
  color: #70808d;
  font-size: 36px;
  line-height: 1;
}

.empty-row {
  cursor: default;
  opacity: 1;
}

.static-row {
  cursor: default;
}

.row-icon {
  display: inline-grid;
  place-items: center;
  width: 36px;
  min-width: 36px;
  color: var(--text);
  font-size: 26px;
  line-height: 1;
}

.notice,
.access-card,
.token-card {
  margin-top: 16px;
  padding: 20px 24px;
}

.notice {
  display: grid;
  gap: 6px;
}

.notice strong,
.access-card h2 {
  font-size: 20px;
  font-weight: 740;
}

.notice span,
.access-card p {
  color: var(--muted);
  font-size: 16px;
}

.field-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field-bg);
  color: var(--text);
  font: inherit;
}

input {
  min-height: 50px;
  padding: 0 14px;
  font-size: 17px;
}

textarea {
  min-height: 78px;
  resize: vertical;
  padding: 14px;
  font: 14px/1.35 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

button {
  border: 0;
  border-radius: 10px;
  background: var(--button);
  color: var(--button-text);
  font: inherit;
  font-weight: 730;
  letter-spacing: 0;
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: 0.58;
}

.field-row button {
  min-width: 112px;
  min-height: 50px;
}

.button-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
}

.button-grid button {
  min-height: 68px;
  font-size: 20px;
}

.button-grid button.secondary {
  background: var(--secondary-button);
  color: var(--text);
}

.choice .checkmark {
  display: none;
  margin-left: auto;
  color: var(--link);
  font-size: 24px;
  font-weight: 800;
}

.choice.selected .checkmark {
  display: block;
}

.form-card {
  padding: 22px;
}

.rename-panel {
  display: grid;
  gap: 10px;
  padding: 18px 22px 20px;
}

.rename-panel label {
  color: var(--muted);
  font-size: 15px;
  font-weight: 650;
}

.rename-panel button {
  min-height: 52px;
}

.back-button {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 24px;
  background: var(--capsule);
  color: var(--capsule-text);
  font-size: 18px;
  font-weight: 720;
}

.token-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field-bg);
}

.token-field textarea {
  min-height: 52px;
  padding: 0;
  border: 0;
  background: transparent;
}

.danger-row {
  color: var(--danger);
}

.danger-row .row-icon,
.danger-row .chevron {
  color: var(--danger);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
}

.modal-card {
  position: relative;
  width: min(340px, 100%);
  padding: 16px;
  border-radius: 16px;
  background: var(--panel);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 19px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--capsule);
  color: var(--capsule-text);
  font-size: 24px;
  line-height: 1;
}

.qr-code {
  padding: 10px;
  border-radius: 12px;
  background: #ffffff;
}

.qr-code svg {
  display: block;
  width: 100%;
  height: auto;
}

.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 18px;
  z-index: 30;
  width: min(520px, calc(100% - 32px));
  margin: 0 auto;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(17, 24, 39, 0.96);
  color: #ffffff;
  text-align: center;
  font-size: 15px;
}

.hidden {
  display: none !important;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 520px) {
  .app {
    padding: 22px 16px 56px;
  }

  .hero {
    padding: 14px 12px 24px;
  }

  .avatar-xl {
    width: 84px;
    height: 84px;
    font-size: 36px;
  }

  .avatar-sm {
    width: 50px;
    height: 50px;
    font-size: 21px;
  }

  h1 {
    font-size: 31px;
  }

  h2 {
    font-size: 25px;
  }

  .lead {
    font-size: 17px;
  }

  .list-row,
  .settings-row {
    min-height: 68px;
    padding: 11px 16px;
    gap: 13px;
  }

  .row-text strong,
  .static-row strong {
    font-size: 18px;
  }

  .row-text small,
  .static-row small {
    font-size: 15px;
  }

  .add-row {
    font-size: 18px;
  }

  .plus-icon {
    width: 36px;
    height: 36px;
    border-width: 3px;
  }

  .plus-icon::before,
  .plus-icon::after {
    width: 17px;
    height: 3px;
  }

  .chevron {
    font-size: 34px;
  }

  .section-head {
    margin-inline: 16px;
  }

  .settings-section h2 {
    margin-inline: 16px;
  }

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

  .field-row {
    display: grid;
  }

  .field-row button {
    width: 100%;
  }
}
