:root {
  --ink: #13231f;
  --muted: #41524f;
  --ce-forest: #052f35;
  --ce-teal: #0b5660;
  --ce-blue: #33aadd;
  --ce-leaf: #287a2d;
  --paper: #ffffff;
  --panel: rgba(248, 251, 252, 0.14);
  --line: rgba(29, 41, 35, 0.12);
  --shadow: 0 26px 70px rgba(5, 47, 53, 0.18);
  --radius-card: 28px;
  --radius-panel: 18px;
  --font-main: Arial, "Helvetica Neue", Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

*,
button,
input,
textarea,
select {
  font-family: var(--font-main);
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 42% 64%, transparent 0 18%, rgba(73, 173, 98, 0.12) 18.2% 18.35%, transparent 18.55%),
    radial-gradient(circle at 88% 18%, transparent 0 25%, rgba(25, 135, 184, 0.12) 25.2% 25.35%, transparent 25.55%),
    radial-gradient(circle at -2% 92%, transparent 0 13%, rgba(48, 160, 191, 0.1) 13.2% 13.35%, transparent 13.55%),
    repeating-linear-gradient(116deg, rgba(2, 92, 126, 0.055) 0 1px, transparent 1px 118px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 251, 252, 0.95));
  color: var(--ink);
  line-height: 1.35;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
  color: inherit;
  font: inherit;
}

.icon-sprite {
  display: none;
}

.stage {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: start stretch;
  padding: 0;
}

.ecard {
  display: grid;
  grid-template-rows: minmax(458px, 1fr) auto;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: none;
}

.photo-panel {
  position: relative;
  min-height: 458px;
  overflow: hidden;
  background:
    radial-gradient(circle at 42% 64%, transparent 0 18%, rgba(73, 173, 98, 0.13) 18.2% 18.35%, transparent 18.55%),
    radial-gradient(circle at 88% 18%, transparent 0 25%, rgba(25, 135, 184, 0.13) 25.2% 25.35%, transparent 25.55%),
    radial-gradient(circle at -2% 92%, transparent 0 13%, rgba(48, 160, 191, 0.12) 13.2% 13.35%, transparent 13.55%),
    repeating-linear-gradient(116deg, rgba(2, 92, 126, 0.07) 0 1px, transparent 1px 118px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.9));
}

.photo-panel::before,
.photo-panel::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.photo-panel::before {
  inset: 0;
  background:
    linear-gradient(110deg, transparent 0 45%, rgba(51, 170, 221, 0.1) 46%, transparent 58%),
    linear-gradient(290deg, transparent 0 58%, rgba(40, 122, 45, 0.08) 59%, transparent 70%);
  z-index: 0;
}

.photo-panel::after {
  inset: auto 0 0;
  height: 150px;
  background: linear-gradient(180deg, transparent, rgba(219, 227, 234, 0.78));
  z-index: 2;
}

.brand {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: row;
  width: fit-content;
  height: auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 14px auto 0;
  padding: 0;
  overflow: visible;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.brand span {
  color: var(--ink);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 42px;
}

.portrait {
  position: absolute;
  inset: 76px 0 auto;
  z-index: 1;
  width: 100%;
  height: 350px;
  object-fit: cover;
  object-position: 50% 0%;
}

.qr-card {
  position: absolute;
  right: 0;
  bottom: 5px;
  left: 0;
  z-index: 3;
  display: grid;
  justify-items: center;
  padding: 9px 16px 10px;
  border: 0;
  outline: 0;
  border-radius: 0;
  background: var(--panel);
  background-clip: padding-box;
  box-shadow:
    0 26px 58px rgba(15, 32, 38, 0.14),
    0 8px 20px rgba(15, 32, 38, 0.08);
  backdrop-filter: blur(7px) saturate(1.04);
}

.qr-card h1 {
  margin: 0;
  color: var(--ce-forest);
  font-size: 1.08rem;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  text-shadow: 0 1px 12px rgba(255, 255, 255, 0.82);
}

.qr-card h1::after {
  display: block;
  width: 54px;
  height: 3px;
  margin: 5px auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ce-leaf), var(--ce-blue));
  content: "";
}

.qr-card p {
  margin: 4px 0 6px;
  color: var(--ce-teal);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-align: center;
  text-shadow: 0 1px 10px rgba(255, 255, 255, 0.72);
  text-transform: uppercase;
}

.qr-link {
  display: grid;
  place-items: center;
}

.qr-box {
  display: grid;
  width: 118px;
  min-height: 118px;
  place-items: center;
  padding: 6px;
  border-radius: 7px;
  background: #ffffff;
  box-shadow:
    0 10px 22px rgba(12, 30, 35, 0.16),
    0 2px 5px rgba(12, 30, 35, 0.08);
}

.qr-box img,
.qr-box canvas {
  width: 106px !important;
  height: 106px !important;
}

.qr-fallback {
  padding: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.qr-caption {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  justify-content: center;
  margin-top: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ce-forest);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.15;
  box-shadow: 0 6px 16px rgba(15, 32, 38, 0.08);
}

.card-body {
  display: grid;
  gap: 8px;
  padding: 10px 12px 12px;
  background: #ffffff;
}

.save-button,
.quick-actions a,
.share-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 850;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.save-button {
  min-height: 41px;
  gap: 8px;
  border-radius: 13px;
  background: linear-gradient(135deg, #052f35 0%, #0b5660 58%, #33aadd 100%);
  color: #ffffff;
  font-size: 1rem;
  letter-spacing: 0;
  box-shadow: 0 14px 26px rgba(5, 47, 53, 0.26);
}

.quick-actions {
  display: flex;
  justify-content: center;
  gap: 7px;
}

.quick-actions a {
  width: 36px;
  height: 36px;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fbf8;
  color: var(--ink);
  box-shadow: 0 7px 16px rgba(15, 32, 38, 0.05);
}

.quick-actions span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.share-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.share-row button {
  min-height: 36px;
  gap: 7px;
  border-radius: 12px;
  background: #18231d;
  color: #ffffff;
  cursor: pointer;
  font-size: 0.83rem;
  letter-spacing: 0;
}

.share-row button + button {
  background: #eef6ea;
  color: #17211c;
}

.save-button svg,
.quick-actions svg,
.share-row svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.quick-actions svg {
  width: 19px;
  height: 19px;
  color: var(--ce-teal);
}

.save-button:hover,
.quick-actions a:hover,
.share-row button:hover {
  transform: translateY(-1px);
}

.save-button:focus-visible,
.quick-actions a:focus-visible,
.share-row button:focus-visible,
.qr-link:focus-visible {
  outline: 3px solid rgba(51, 170, 221, 0.34);
  outline-offset: 3px;
}

.card-url,
.status-message {
  min-height: 16px;
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
  text-align: center;
  overflow-wrap: anywhere;
}

.card-url {
  display: none;
}

.status-message {
  color: var(--ce-teal);
}

@media (max-width: 360px) {
  .stage {
    padding: 0;
  }

  .photo-panel {
    min-height: 442px;
  }

  .brand {
    gap: 7px;
    margin-top: 13px;
  }

  .brand img {
    width: 40px;
    height: 40px;
  }

  .brand span {
    font-size: 1.68rem;
    line-height: 40px;
  }

  .portrait {
    top: 74px;
    height: 336px;
  }

  .qr-box {
    width: 112px;
    min-height: 112px;
  }

  .qr-box img,
  .qr-box canvas {
    width: 100px !important;
    height: 100px !important;
  }
}

@media (min-width: 760px) {
  .stage {
    min-height: 100vh;
    place-items: center;
    padding: 16px;
  }

  .ecard {
    width: 360px;
    min-height: auto;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow);
  }

  .photo-panel {
    min-height: 582px;
  }

  .portrait {
    height: 454px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  .stage {
    min-height: auto;
    padding: 0;
  }

  .ecard {
    border: 1px solid #cccccc;
    box-shadow: none;
  }

  .photo-panel {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .share-row,
  .status-message {
    display: none;
  }
}
