:root {
  --bg: #000000;
  --gold2: #f2c35a;
  --text: #e9e2d0;
  --muted: #b7a680;
  --border: rgba(212, 164, 58, 0.45);
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
  --radius2: 14px;
  --safe-top: constant(safe-area-inset-top);
  --safe-right: constant(safe-area-inset-right);
  --safe-bottom: constant(safe-area-inset-bottom);
  --safe-left: constant(safe-area-inset-left);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --page-pad-x: clamp(1rem, 4vw, 1.25rem);
  --page-pad-bottom: clamp(1.25rem, 4vw, 1.75rem);
  --page-bg: var(--bg);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--safe-top) + 1rem);
  width: 100%;
  min-height: 100%;
  min-height: 100svh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  background-color: var(--bg);
  color-scheme: dark;
}
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  min-height: 100svh;
  min-height: 100dvh;
  position: relative;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: transparent;
  color: var(--text);
  padding: 0;
  overflow-x: clip;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--page-bg);
  background-color: var(--bg);
  pointer-events: none;
}
html.cronyl-standalone {
  height: 100%;
  height: -webkit-fill-available;
  background-color: var(--bg);
}
html.cronyl-standalone body {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background-color: var(--bg);
}
body.app-loading {
  overflow: hidden;
}
.wrap {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  min-height: 100%;
  min-height: 100svh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding:
    calc(var(--safe-top) + 0.625rem)
    max(var(--page-pad-x), var(--safe-right))
    max(var(--page-pad-bottom), var(--safe-bottom))
    max(var(--page-pad-x), var(--safe-left));
  position: relative;
}
h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: 0.2px;
  color: var(--gold2);
  position: relative;
  z-index: 1;
}
.brand {
  position: relative;
  z-index: 1;
  line-height: 0;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
}
.brand-logo {
  display: block;
  height: clamp(64px, 18vmin, 108px);
  width: auto;
  max-width: min(320px, 86vw);
  object-fit: contain;
  object-position: left center;
}
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(0.5rem, 2vw, 0.875rem);
  padding: 0 0 clamp(0.625rem, 2vw, 0.875rem);
  margin-bottom: clamp(0.75rem, 2.5vw, 1rem);
  position: relative;
  z-index: 1;
}
.version-badge {
  flex-shrink: 0;
  align-self: center;
  padding: 0.25em 0.65em;
  border-radius: 999px;
  border: 1px solid rgba(212, 164, 58, 0.35);
  font-size: 11px;
  font-weight: 700;
  color: rgba(242, 195, 90, 0.85);
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.field { margin: 14px 0; position: relative; z-index: 1; }
label { display: block; font-size: 14px; color: var(--muted); margin: 0 0 8px; }
input, select {
  width: 100%;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 14px 14px;
  border-radius: var(--radius2);
  font-size: 18px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
select:disabled { opacity: 0.45; cursor: not-allowed; }
.select-wrap { position: relative; }
.select-wrap::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-top-color: var(--gold2);
  pointer-events: none;
  opacity: 0.75;
}
input:focus, select:focus {
  border-color: rgba(242, 195, 90, 0.75);
  box-shadow: 0 0 0 3px rgba(242, 195, 90, 0.12);
}
input::placeholder { color: rgba(233, 226, 208, 0.35); }
input[readonly], select[disabled] { opacity: 0.95; }
.row { display: flex; gap: 12px; align-items: center; position: relative; z-index: 1; margin-top: 14px; }
.row .btn { flex: 1; margin-top: 0; }
.btn {
  width: 100%;
  border-radius: var(--radius2);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.55);
  color: var(--gold2);
  font-weight: 900;
  font-size: 18px;
  padding: 14px 14px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.hint { font-size: clamp(16px, 4vw, 18px); line-height: 1.5; color: rgba(233, 226, 208, 0.75); margin-top: 10px; position: relative; z-index: 1; }
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--gold2);
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  background: #111;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: none;
  z-index: 9999;
  max-width: min(92vw, 520px);
  text-align: center;
}
.qrWrap {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.35);
  padding: 14px;
  position: relative;
  z-index: 1;
}
.qrHeader { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.qrTitle { margin: 0; font-size: 16px; color: var(--muted); font-weight: 700; }
#qrImg,
#qrCanvas {
  width: 220px;
  height: 220px;
  border-radius: 14px;
  border: 1px solid rgba(212, 164, 58, 0.25);
  background: rgba(0, 0, 0, 0.35);
  display: block;
  margin: 0 auto;
  object-fit: contain;
}
.qrCanvasWrap {
  position: relative;
  width: 220px;
  margin: 0 auto;
}
.qrShield {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}
.qrWrap,
.qrWrap canvas,
.qrMeta {
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}
.qrMeta {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
  text-align: center;
}
.pay-address-masked {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
#address {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px 14px;
  z-index: 9990;
}
.modal {
  width: min(520px, 100%);
  background: rgba(12, 12, 12, 0.98);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 18px;
  max-height: min(calc(100dvh - 36px), calc(100svh - 36px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modalHeader { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-shrink: 0; }
.modalTitle { font-size: 28px; color: var(--gold2); margin: 0; }
.walletSearchWrap { margin: 0 0 8px; flex-shrink: 0; }
.walletSearch {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.55);
  color: var(--gold2);
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  padding: 12px 14px 12px 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23c9a227' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242 1.1a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
  -webkit-appearance: none;
  appearance: none;
}
.walletSearch::placeholder { color: rgba(233, 226, 208, 0.42); }
.walletSearch:focus {
  outline: none;
  border-color: rgba(201, 162, 39, 0.55);
  box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.12);
}
.walletSearchEmpty {
  margin: 18px 4px;
  text-align: center;
  font-size: 14px;
  color: rgba(233, 226, 208, 0.5);
}
.closeBtn {
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.55);
  color: var(--gold2);
  border-radius: 14px;
  font-weight: 900;
  padding: 10px 12px;
  cursor: pointer;
}
.walletList {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
  touch-action: pan-y;
}
.walletBtn {
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.55);
  color: var(--gold2);
  font-weight: 900;
  padding: 12px 14px;
  border-radius: var(--radius2);
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.walletBtn-icon {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(201, 162, 39, 0.35);
  background: rgba(201, 162, 39, 0.08);
  color: var(--gold2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 900;
}
.walletBtn-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.walletBtn-name {
  display: block;
  font-size: 17px;
  line-height: 1.2;
}
.walletBtn-action {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: rgba(233, 226, 208, 0.48);
  letter-spacing: 0.01em;
}
.walletBtn:active { transform: scale(0.99); }
.walletSectionTitle {
  margin: 14px 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(233, 226, 208, 0.45);
}
.walletSectionTitle:first-child { margin-top: 4px; }
.walletBtn-badge {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: rgba(233, 226, 208, 0.5);
  letter-spacing: 0.02em;
}
.walletBtn--notReady { opacity: 0.88; }
.pay-hint {
  margin: 0 0 14px;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(233, 226, 208, 0.52);
  text-align: center;
}
.modal-hint { margin-top: 12px; text-align: center; }
body.modalOpen { position: fixed; width: 100%; }
.setup-actions { margin-top: 16px; }
.card-link { margin-top: 14px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius2); font-size: 13px; word-break: break-all; }

/* Setup landing */
.hero { position: relative; z-index: 1; margin-bottom: 24px; }
.hero-title { margin: 0 0 12px; font-size: 26px; font-weight: 900; color: var(--gold2); line-height: 1.25; }
.hero-subtitle { margin: 0 0 20px; font-size: 15px; line-height: 1.55; color: rgba(233, 226, 208, 0.75); }
.section-title { margin: 0 0 14px; font-size: 18px; font-weight: 900; color: var(--gold2); position: relative; z-index: 1; }
.how-it-works { position: relative; z-index: 1; margin-bottom: 22px; }
.steps-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.step-card { border: 1px solid var(--border); border-radius: var(--radius2); background: rgba(0, 0, 0, 0.35); padding: 14px; }
.step-card-num { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border); font-size: 12px; font-weight: 900; color: var(--gold2); margin-bottom: 8px; }
.step-card-title { margin: 0 0 6px; font-size: 15px; font-weight: 900; color: var(--gold2); }
.step-card-text { margin: 0; font-size: 13px; line-height: 1.45; color: rgba(233, 226, 208, 0.65); }
.important-box { position: relative; z-index: 1; margin-bottom: 8px; padding: 14px; border: 1px solid rgba(242, 195, 90, 0.35); border-radius: var(--radius2); background: rgba(242, 195, 90, 0.08); }
.important-title { margin: 0 0 8px; font-size: 15px; font-weight: 900; color: var(--gold2); }
.important-box p { margin: 0 0 6px; font-size: 13px; line-height: 1.45; color: rgba(233, 226, 208, 0.75); }
.important-box p:last-child { margin-bottom: 0; }
.optional { font-weight: 400; opacity: 0.65; }
.form-error { color: #ff6b6b; font-size: 14px; margin: 8px 0; position: relative; z-index: 1; }
.loading-hint { text-align: center; padding: 24px 0 0; font-size: 15px; color: rgba(233, 226, 208, 0.65); letter-spacing: 0.02em; }
.boot-logo {
  display: block;
  height: clamp(80px, 22vmin, 140px);
  width: auto;
  max-width: min(340px, 88vw);
  object-fit: contain;
}
#bootLoader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100svh;
  min-height: 100dvh;
  background: var(--page-bg);
  background-color: var(--bg);
  padding:
    calc(var(--safe-top) + 1rem)
    max(var(--page-pad-x), var(--safe-right))
    max(calc(var(--safe-bottom) + 1rem), var(--page-pad-bottom))
    max(var(--page-pad-x), var(--safe-left));
}
body.app-loading #bootLoader { display: flex !important; }
body.app-loading .wrap {
  visibility: hidden !important;
  pointer-events: none !important;
  flex: 0 0 0 !important;
  min-height: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
}
body.app-ready #bootLoader { display: none !important; }
.screen-loading {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 12px 0 24px;
}
body.app-loading .version-badge { display: none !important; }
body.app-loading .wrap > :not(.app-header):not(#loadingView) { display: none !important; }
.view-open { display: block !important; }
#loadingView.view-open.screen-loading { display: flex !important; }
#invalidView.view-open,
#securityView.view-open,
#connectionErrorView.view-open,
#alreadyConfiguredView.view-open {
  flex: 1 1 auto;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
}
.security-box { text-align: center; padding: 32px 16px; border: 1px solid var(--border); border-radius: var(--radius2); background: rgba(0,0,0,0.35); width: 100%; }
.security-hint { margin: 0; font-size: clamp(18px, 4.5vw, 22px); line-height: 1.55; color: var(--text); }
.security-box .btn { margin-top: 20px; }
.setup-done-box { padding: clamp(36px, 8vw, 52px) 20px; }
.setup-done-title { margin: 0 0 14px; text-align: center; }
.expired-box { text-align: center; padding: 48px 16px; border: 1px solid var(--border); border-radius: var(--radius2); background: rgba(0,0,0,0.35); }
.expired-hint { margin: 0; font-size: 17px; line-height: 1.55; color: var(--text); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-secondary { margin-top: 0; }
#tagCopyRow { margin-top: -4px; }
.setup-hint { margin: 0 0 16px; line-height: 1.45; }
.setup-slot {
  margin-bottom: 28px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.setup-slot:last-of-type { border-bottom: none; }
.setup-slot-title {
  margin: 0 0 14px;
  font-size: clamp(15px, 3.8vw, 17px);
  font-weight: 600;
  color: var(--gold2);
  letter-spacing: 0.02em;
}
.setup-add-wallet {
  width: 100%;
  margin: 4px 0 20px;
}
.coin-picker-view { padding-top: 4px; }
.coinPickerTitle {
  margin: 0 0 8px;
  font-size: clamp(26px, 6.5vw, 32px);
  font-weight: 700;
  color: var(--gold2);
  letter-spacing: -0.02em;
}
.coinPickerHint { margin: 0 0 28px; }
.coinPickerList {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.coinPickerCard {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  min-height: 220px;
  padding: 28px 20px 24px;
  border: 1px solid rgba(212, 164, 58, 0.28);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(0,0,0,0.35) 100%);
  color: var(--text);
  text-align: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,0.28);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}
.coinPickerCard:active {
  transform: scale(0.985);
  background: rgba(255,255,255,0.07);
  border-color: rgba(212, 164, 58, 0.45);
}
.coinPickerCard-iconWrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.coinPickerCard-icon-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: transparent;
  border: none;
  box-shadow: none;
}
.coinPickerCard-icon,
.coinPickerCard-icon-frame img.coinPickerCard-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: contain;
}
.coinPickerCard-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  width: 100%;
}
.coinPickerCard-name {
  font-size: clamp(20px, 5vw, 24px);
  font-weight: 700;
  color: var(--text);
}
.coinPickerCard-symbol {
  font-size: 15px;
  font-weight: 700;
  color: var(--gold2);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.coinPickerCard-network {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
}
.setup-saving-view { padding-top: 12px; }
.setup-saving-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(40px, 10vw, 64px) 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  background: rgba(0,0,0,0.35);
  min-height: 280px;
}
.setup-saving-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(212, 164, 58, 0.18);
  border-top-color: var(--gold2);
  border-radius: 50%;
  animation: setupSpin 0.85s linear infinite;
  margin-bottom: 24px;
}
@keyframes setupSpin {
  to { transform: rotate(360deg); }
}
.setup-saving-title {
  margin: 0 0 10px;
  font-size: clamp(22px, 5.5vw, 28px);
  font-weight: 700;
  color: var(--gold2);
}
.setup-saving-sub {
  margin: 0;
  font-size: clamp(16px, 4vw, 18px);
  color: var(--muted);
  line-height: 1.5;
}
.setup-saving-error {
  margin-top: 18px;
  max-width: 100%;
}
#setupSavingRetryBtn { margin-top: 16px; width: 100%; max-width: 280px; }
.card-wallets-list {
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  background: rgba(0,0,0,0.25);
}
.card-wallets-list h3 {
  margin: 0 0 10px;
  font-size: 15px;
  color: var(--gold2);
}
.card-wallet-row {
  font-size: 14px;
  line-height: 1.5;
  padding: 6px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.card-wallet-row:first-of-type { border-top: none; padding-top: 0; }
.card-wallet-row code {
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}
.view-panel.view-visible { animation: viewIn 0.28s ease-out; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 430px) {
  .wrap {
    padding-top: calc(var(--safe-top) + 0.5rem);
    padding-bottom: max(var(--page-pad-bottom), calc(var(--safe-bottom) + 0.5rem));
  }
  .hero-title { font-size: clamp(26px, 7vw, 32px); }
  .section-title { font-size: clamp(17px, 4.5vw, 20px); }
  .loading-hint { font-size: clamp(16px, 4vw, 18px); }
  .boot-logo { height: clamp(92px, 24vmin, 148px); max-width: min(360px, 90vw); }
  .brand-logo { height: clamp(72px, 20vmin, 116px); max-width: min(340px, 90vw); }
  .security-box { padding: clamp(28px, 8vw, 40px) 16px; }
  .btn { font-size: 17px; padding: 15px 14px; min-height: 48px; }
}
@media (min-width: 640px) { .steps-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 390px) {
  .brand-logo { height: clamp(68px, 17vmin, 104px); max-width: min(300px, 84vw); }
}
@media (min-width: 428px) {
  .brand-logo { height: clamp(76px, 18vmin, 112px); max-width: min(320px, 86vw); }
  .app-header { margin-bottom: 16px; }
}
@media (max-width: 420px) {
  h1 { font-size: 28px; }
  .version-badge { font-size: 10px; }
  input, select { font-size: 16px; }
}
