:root {
  --page-bg: #ffffff;
  --ink: #101828;
  --muted: #667085;
  --panel: rgba(255, 255, 255, 0.9);
  --line: rgba(15, 23, 42, 0.12);
  --shadow: rgba(15, 23, 42, 0.2);
  --accent: #0ea5e9;
  --accent-dark: #0369a1;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  background: var(--page-bg);
  color: #111827;
  font-feature-settings: "kern";
  text-rendering: geometricPrecision;
}

button {
  font: inherit;
}

.app-shell {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3.5vw, 30px);
  background:
    radial-gradient(circle at 50% 18%, rgba(14, 165, 233, 0.08), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, #f6f8fb 100%);
}

.screen-card {
  position: relative;
  width: min(100%, 430px);
  min-height: min(900px, calc(100svh - 28px));
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 9px;
  padding: 20px 16px 16px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 32px;
  background:
    radial-gradient(circle at 50% 44%, rgba(14, 165, 233, 0.13), transparent 34%),
    radial-gradient(circle at 50% 75%, rgba(15, 23, 42, 0.06), transparent 32%),
    #ffffff;
  color: var(--ink);
  box-shadow:
    0 28px 80px rgba(15, 23, 42, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.chain-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
}

.profile-card {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  text-align: center;
}

.brand-logo {
  width: clamp(62px, 17vw, 86px);
  aspect-ratio: 1;
  object-fit: contain;
  padding: 8px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  box-shadow:
    0 18px 34px rgba(15, 23, 42, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

h1 {
  margin: 12px 0 0;
  font-size: clamp(27px, 7.4vw, 38px);
  line-height: 0.96;
  font-weight: 900;
  letter-spacing: 0;
  color: #081120;
}

.subtitle {
  margin: 6px 0 0;
  color: #344054;
  font-size: clamp(15px, 4vw, 18px);
  font-weight: 700;
  letter-spacing: 0;
}

.brand-name {
  margin: 6px 0 0;
  color: #475467;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.bead-menu {
  position: relative;
  z-index: 2;
  min-height: 368px;
  cursor: grab;
  touch-action: none;
}

.bead-menu.is-dragging {
  cursor: grabbing;
}

.bead {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: var(--size);
  height: var(--size);
  border: 0;
  border-radius: 50%;
  color: #fff;
  background:
    radial-gradient(circle at 31% 22%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.35) 9%, transparent 18%),
    radial-gradient(circle at 72% 82%, rgba(0, 0, 0, 0.18), transparent 42%),
    linear-gradient(145deg, var(--c1), var(--c2));
  box-shadow:
    0 18px 30px rgba(15, 23, 42, 0.2),
    0 0 0 5px rgba(255, 255, 255, 0.82),
    0 0 0 10px var(--ring, rgba(148, 163, 184, 0.2)),
    inset 0 2px 3px rgba(255, 255, 255, 0.5),
    inset 0 -14px 24px rgba(0, 0, 0, 0.16);
  cursor: pointer;
  opacity: var(--opacity, 1);
  transform: translate(calc(-50% + var(--x, 0px)), calc(-50% + var(--y, 0px))) scale(var(--scale, 1));
  transition:
    transform 230ms cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 160ms ease,
    filter 160ms ease;
  user-select: none;
}

.bead:not(.is-active) {
  pointer-events: none;
}

.bead::before,
.bead::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
}

.bead::before {
  inset: 10%;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.18), transparent 44%);
  mix-blend-mode: screen;
}

.bead::after {
  left: 21%;
  top: 15%;
  width: 22%;
  height: 22%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.34) 48%, transparent 72%);
  filter: blur(1px);
}

.bead.is-active {
  filter: saturate(1.16);
  box-shadow:
    0 26px 44px rgba(15, 23, 42, 0.26),
    0 0 0 7px rgba(255, 255, 255, 0.9),
    0 0 0 14px var(--ring, rgba(14, 165, 233, 0.24)),
    inset 0 2px 3px rgba(255, 255, 255, 0.58),
    inset 0 -16px 28px rgba(0, 0, 0, 0.18);
  opacity: 1;
}

.bead span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  max-width: 78%;
  text-align: center;
  font-size: clamp(11px, 3vw, 15px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}

.bead-icon {
  font-size: 36px;
  line-height: 1;
}

.bead-icon-lg {
  font-size: 42px;
}

.bead-web {
  --size: clamp(88px, 24vw, 112px);
  --c1: #34d399;
  --c2: #059669;
  --ring: rgba(5, 150, 105, 0.22);
}

.bead-qr {
  --size: clamp(88px, 24vw, 112px);
  --c1: #a855f7;
  --c2: #6d28d9;
  --ring: rgba(109, 40, 217, 0.22);
}

.bead-contact {
  --size: clamp(88px, 24vw, 112px);
  --c1: #ff9d2e;
  --c2: #ff5a1f;
  --ring: rgba(249, 115, 22, 0.24);
}

.bead-phone {
  --size: clamp(88px, 24vw, 112px);
  --c1: #3b82f6;
  --c2: #0f56d9;
  --ring: rgba(37, 99, 235, 0.22);
}

.bead-whatsapp {
  --size: clamp(88px, 24vw, 112px);
  --c1: #31f06c;
  --c2: #009a49;
  --ring: rgba(0, 154, 73, 0.22);
}

.bead-instagram {
  --size: clamp(88px, 24vw, 112px);
  --c1: #ffdc80;
  --c2: #e1306c;
  --ring: rgba(225, 48, 108, 0.22);
  background:
    radial-gradient(circle at 31% 22%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.35) 9%, transparent 18%),
    radial-gradient(circle at 72% 82%, rgba(0, 0, 0, 0.18), transparent 42%),
    linear-gradient(145deg, #feda75 0%, #fa7e1e 35%, #d62976 65%, #962fbf 100%);
}

.bead-facebook {
  --size: clamp(88px, 24vw, 112px);
  --c1: #60a5fa;
  --c2: #1877f2;
  --ring: rgba(24, 119, 242, 0.22);
}

.bead-linkedin {
  --size: clamp(88px, 24vw, 112px);
  --c1: #38bdf8;
  --c2: #0a66c2;
  --ring: rgba(10, 102, 194, 0.22);
}

.menu-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.menu-label {
  position: absolute;
  left: calc(50% + 42px);
  top: 50%;
  min-width: 154px;
  max-width: 176px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  color: #182230;
  font-size: clamp(11px, 2.8vw, 13px);
  font-weight: 900;
  padding: 7px 12px 7px 42px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.9)),
    #fff;
  box-shadow:
    0 10px 22px rgba(15, 23, 42, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  opacity: var(--opacity, 1);
  transform: translateY(calc(-50% + var(--y, 0px))) translateX(-10px) scale(var(--scale, 1));
  transform-origin: left center;
  transition:
    transform 230ms cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 160ms ease;
  white-space: nowrap;
  letter-spacing: 0;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.85);
}

.menu-label:not(.is-active-label) {
  opacity: 0 !important;
}

.menu-label.is-active-label {
  transform: translateY(calc(-50% + var(--y, 0px))) translateX(0) scale(var(--scale, 1));
}

.quick-actions {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr 52px 1fr;
  gap: 10px;
  align-items: center;
  padding: 2px 4px;
}

.quick-actions button {
  min-height: 44px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 999px;
  color: #182230;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.94)),
    #fff;
  box-shadow:
    0 12px 24px rgba(15, 23, 42, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-size: clamp(11px, 2.9vw, 13px);
  font-weight: 800;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.quick-actions button:hover,
.quick-actions button:focus-visible {
  border-color: rgba(14, 165, 233, 0.35);
  box-shadow:
    0 16px 30px rgba(15, 23, 42, 0.13),
    0 0 0 4px rgba(14, 165, 233, 0.08);
  outline: 0;
  transform: translateY(-1px);
}

.flag-button {
  display: grid;
  place-items: center;
  padding: 0;
  border-color: rgba(239, 68, 68, 0.2) !important;
  background:
    radial-gradient(circle at 50% 15%, rgba(255, 255, 255, 0.9), transparent 32%),
    linear-gradient(180deg, #ffffff, #f8fafc) !important;
  box-shadow:
    0 14px 26px rgba(185, 28, 28, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
}

.flag {
  display: block;
  width: 34px;
  height: 23px;
  border-radius: 6px;
  object-fit: cover;
  box-shadow:
    0 4px 10px rgba(185, 28, 28, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.72);
}

.flag-button .flag {
  width: 34px;
  height: 23px;
}

.info-panel {
  position: relative;
  z-index: 3;
  display: grid;
  gap: 7px;
  min-height: 92px;
  padding: 16px 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.86)),
    var(--panel);
  backdrop-filter: blur(16px);
  box-shadow:
    0 18px 38px rgba(15, 23, 42, 0.11),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.panel-label {
  margin: 0;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.info-panel strong {
  color: #081120;
  font-size: 19px;
  font-weight: 900;
  line-height: 1.1;
}

.info-panel span {
  color: #667085;
  font-size: 13px;
  line-height: 1.45;
}

.bank-modal .modal-dialog,
.invoice-modal .modal-dialog {
  width: min(92vw, 420px);
  margin-inline: auto;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1055;
  overflow-x: hidden;
  overflow-y: auto;
  outline: 0;
}

.modal.show {
  display: block;
}

.modal-dialog {
  min-height: calc(100% - 32px);
  display: flex;
  align-items: center;
}

.modal-content {
  width: 100%;
  background: #fff;
}

.modal-header,
.modal-footer {
  display: flex;
  align-items: center;
  padding: 16px;
}

.modal-header {
  justify-content: space-between;
}

.modal-footer {
  justify-content: flex-end;
  gap: 8px;
}

.modal-body {
  padding: 16px;
}

.btn {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: #fff;
  color: #101828;
  cursor: pointer;
}

.btn-primary {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.btn-outline-secondary {
  background: #fff;
  color: #344054;
}

.btn-close {
  position: relative;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: #f2f4f7;
  opacity: 1;
}

.btn-close::before {
  content: "×";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #344054;
  font-size: 22px;
  line-height: 1;
}

.bank-modal .modal-content,
.invoice-modal .modal-content {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
  overflow: hidden;
}

.bank-modal .modal-header,
.bank-modal .modal-footer,
.invoice-modal .modal-header {
  border-color: rgba(15, 23, 42, 0.08);
}

.modal-kicker {
  margin: 0 0 3px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}

.modal-title {
  color: #081120;
  font-weight: 900;
}

.bank-details {
  display: grid;
  gap: 10px;
  margin: 0;
}

.bank-details div {
  padding: 12px 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  background: #f8fafc;
}

.bank-details dt {
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}

.bank-details dd {
  margin: 4px 0 0;
  color: #101828;
  font-size: 15px;
  font-weight: 900;
  word-break: break-word;
}

.invoice-box {
  color: #101828;
  padding: 0;
}

.invoice-details {
  display: grid;
  gap: 10px;
  margin: 0;
}

.invoice-details div {
  padding: 12px 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  background: #f8fafc;
}

.invoice-details dt {
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}

.invoice-details dd {
  margin: 4px 0 0;
  color: #081120;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.35;
}

.copy-status {
  min-height: 18px;
  margin: 10px 0 0;
  color: #059669;
  font-size: 12px;
  font-weight: 700;
}

.action-icon {
  font-size: 16px;
  line-height: 1;
}

.modal-footer .btn {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  border-radius: 999px;
  font-weight: 700;
}

.bank-modal.fallback-open,
.invoice-modal.fallback-open {
  display: block;
  background: rgba(15, 23, 42, 0.42);
}

.bank-modal.fallback-open .modal-dialog,
.invoice-modal.fallback-open .modal-dialog {
  transform: none;
}

.toast-container {
  z-index: 1080;
}

.link-toast {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.2);
}

.toast-body {
  color: #182230;
  font-weight: 800;
}

.link-toast.fallback-show {
  display: block;
  opacity: 1;
}

@media (min-width: 720px) {
  .screen-card {
    width: 430px;
  }
}

@media (max-width: 390px) {
  .app-shell {
    padding: 10px;
  }

  .screen-card {
    min-height: calc(100svh - 20px);
    padding: 16px 12px 14px;
  }

  .bead-menu {
    min-height: 356px;
  }

  .menu-label {
    left: calc(50% + 34px);
    min-width: 138px;
    max-width: 150px;
    padding-left: 36px;
  }
}
