/* ============ SHARED WALLET STYLES ============ */
:root {
  --primary: #0066cc;
  --primary-on-dark: #2997ff;

  --ink: #1d1d1f;
  --body-on-dark: #ffffff;
  --body-muted: #cccccc;
  --ink-muted-80: #333333;
  --ink-muted-48: #7a7a7a;

  --divider-soft: #f0f0f0;
  --hairline: #e0e0e0;
  --canvas: #ffffff;
  --parchment: #f5f5f7;
  --tile-1: #272729;
  --tile-3: #252527;

  --alert: #ff3b30;
  --success: #30d158;

  --r-xs: 5px;
  --r-sm: 8px;
  --r-md: 11px;
  --r-lg: 18px;
  --r-pill: 9999px;

  --font-display: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Inter", "PingFang SC", system-ui, sans-serif;
  --font-text: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Inter", "PingFang SC", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  font-family: var(--font-text);
  background: var(--parchment);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.374px;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

/* Stage holds the phone-frame device */
.stage {
  display: flex;
  padding: 56px 24px;
  justify-content: center;
  background: var(--parchment);
  min-height: 100vh;
}

/* iPhone-like product render */
.phone {
  width: 390px;
  background: var(--canvas);
  border-radius: 44px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 24px 60px rgba(0,0,0,0.18);
}

/* Status bar */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px 6px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.374px;
  color: var(--ink);
}
.status-bar .right { display: flex; gap: 6px; align-items: center; }
.status-bar svg { width: 16px; height: 16px; }

/* URL bar */
.url-bar {
  margin: 6px 12px 10px;
  background: var(--parchment);
  border-radius: var(--r-md);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-text);
  font-size: 14px;
  letter-spacing: -0.224px;
  color: var(--ink-muted-80);
  gap: 8px;
}
.url-bar .lock { width: 12px; height: 12px; opacity: 0.5; }

.page-content { padding: 4px 18px 110px; }

/* Page header (brand + actions) */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 4px 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.374px;
  color: var(--ink);
}
.brand-mark {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  color: var(--ink);
}
.brand-mark img { width: 24px; height: auto; display: block; }

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--ink);
  position: relative;
}
.icon-btn .red-dot {
  position: absolute;
  top: 9px; right: 11px;
  width: 8px; height: 8px;
  background: var(--alert);
  border-radius: 50%;
  border: 2px solid #fff;
}

/* Page title row (cards page) */
.page-title-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 4px 22px;
}
.page-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.374px;
  color: var(--ink);
}
.page-title-row .actions { display: flex; align-items: center; gap: 10px; }
.btn-pill-sm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-text);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.12px;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  border: 0;
  cursor: pointer;
  transition: transform .12s ease;
}
.btn-pill-sm:active { transform: scale(0.96); }
.btn-pill-sm svg { width: 14px; height: 14px; }

/* Section head */
.sec-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 4px 14px;
}
.sec-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.374px;
  color: var(--ink);
}
.sec-title .count {
  color: var(--ink-muted-48);
  margin-left: 6px;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -0.224px;
}
.sec-tools { display: flex; align-items: center; gap: 12px; color: var(--ink-muted-48); }
.sec-tools button {
  background: none; border: 0; cursor: pointer;
  color: var(--ink-muted-48);
  display: grid; place-items: center;
}
.sec-tools svg { width: 18px; height: 18px; }

/* Tab bar */
.tab-bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid rgba(0,0,0,0.04);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 10px 0 24px;
}
.tab-item {
  background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column;
  align-items: center; gap: 4px;
  position: relative;
  color: var(--ink-muted-48);
  font-family: var(--font-text);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: -0.12px;
  transition: color .15s;
  text-decoration: none;
}
.tab-item.active { color: var(--ink); }
.tab-item.active::before {
  content: "";
  position: absolute;
  top: -10px;
  width: 24px; height: 2px;
  background: var(--primary);
  border-radius: var(--r-pill);
}
.tab-item svg { width: 22px; height: 22px; stroke-width: 1.8; }

@media (max-width: 880px) {
  .stage { padding: 16px 8px; }
  .phone { width: 100%; max-width: 390px; }
}

@media (max-width: 480px) {
  .stage { padding: 0; background: var(--canvas); }
  .phone { width: 100%; max-width: none; border-radius: 0; box-shadow: none; min-height: 100vh; }
  .status-bar, .url-bar { display: none; }
}

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted-80);
  margin-bottom: 6px;
}
.field input, .field select {
  width: 100%;
  height: 46px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 0 14px;
  font-size: 16px;
  font-family: var(--font-text);
  background: var(--canvas);
  color: var(--ink);
  outline: none;
}
.field input:focus, .field select:focus { border-color: var(--primary); }
.field-row { display: flex; gap: 8px; }
.field-row input { flex: 1; }
.btn-primary, .btn-ghost {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: var(--r-pill);
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-text);
  cursor: pointer;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost { background: var(--parchment); color: var(--ink); margin-top: 10px; }
.btn-otp {
  flex-shrink: 0;
  height: 46px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-md);
  background: rgba(0,102,204,0.10);
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.auth-lead { font-size: 14px; color: var(--ink-muted-80); margin: -8px 0 18px; }
.auth-switch { text-align: center; margin-top: 18px; font-size: 14px; color: var(--ink-muted-80); }
.auth-switch a { color: var(--primary); font-weight: 600; }
.form-err { color: var(--alert); font-size: 13px; min-height: 20px; margin: 4px 0 10px; }
.empty-box {
  border: 1px dashed var(--hairline);
  border-radius: var(--r-md);
  padding: 28px 16px;
  text-align: center;
  color: var(--ink-muted-48);
  font-size: 14px;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  background: #1d1d1f;
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  font-size: 13px;
  z-index: 80;
  max-width: 86%;
}
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 70;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal {
  width: 100%;
  max-width: 390px;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 22px 20px 28px;
}
.modal h3 { font-size: 18px; margin-bottom: 14px; }
.pin-boxes { display: flex; gap: 8px; justify-content: center; margin: 8px 0 16px; }
.pin-boxes span {
  width: 40px; height: 48px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 20px; font-weight: 600;
}
.secret-box {
  background: var(--parchment);
  border-radius: var(--r-md);
  padding: 14px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 15px;
  line-height: 1.7;
}
.badge.warn { color: #c47b00; }
.badge.frozen { color: var(--alert); }
