* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  overflow: hidden;
}
body {
  margin: 0;
  color: #151515;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    Arial,
    sans-serif;
  background: #f8f8f8;
  -webkit-font-smoothing: antialiased;
}
button {
  font: inherit;
  cursor: pointer;
}
button:focus-visible,
.preview-stage:focus-visible {
  outline: 2px solid #2b2b2b;
  outline-offset: 2px;
}
.embed-root {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 11px 19px 12px;
}
.preview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
}
.preview-tabs {
  display: inline-flex;
  gap: 3px;
  background: #ebebeb;
  border-radius: 10px;
  padding: 4px;
}
.tab {
  border: 0;
  background: transparent;
  color: #5d5e60;
  padding: 7px 12px;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.tab.selected {
  background: #171819;
  color: white;
  box-shadow: 0 2px 5px #00000017;
}
.drag-hint {
  color: #aaaeb0;
  font-size: 10px;
  white-space: nowrap;
}
.preview-stage {
  min-height: 0;
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1100px;
  touch-action: pan-y;
  cursor: grab;
}
.preview-stage.dragging {
  cursor: grabbing;
}
.card-3d {
  width: min(430px, calc(100% - 42px));
  aspect-ratio: 1.75;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(-5deg) rotateY(-12deg) rotateZ(-1deg);
  transition: all 0.5s ease-out;
  will-change: transform;
  /* filter: drop-shadow(15px 22px 18px #00000017); */
}
/* .preview-stage.dragging .card-3d {
  transition: none;
} */
.card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 13px;
  overflow: hidden;
}
.card-front {
  background: #fff;
  border: 1px solid #ededed;
  display: grid;
  grid-template-columns: 45% 1px 1fr;
  align-items: center;
  padding: 20px 22px;
  box-shadow: inset 0 0 25px #00000005;
}

.card-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-right: 20px;
  pointer-events: none;
}
.card-brand img {
  width: min(86%, 155px);
  height: auto;
  display: block;
  mix-blend-mode: multiply;
}
.card-rule {
  height: 79%;
  background: #222;
  opacity: 0.85;
}
.card-identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: center;
  padding-left: 12px;
  min-width: 0;
}
.card-identity h2 {
  font-size: clamp(12px, 2.9vw, 20px);
  line-height: 1.1;
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.055em;
}
.card-identity > span {
  font-size: clamp(10px, 1.8vw, 14px);
  font-weight: 400;
  margin-top: 3px;
  color: #5c5c5c;
}
.card-identity > b {
  font-size: clamp(9px, 1.8vw, 13px);
  font-weight: 600;
  margin: 3px 0 8px;
}
.qr-click {
  display: block;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
}
.qr-click img {
  width: 100%;
  height: 100%;
  display: block;
  mix-blend-mode: multiply;
}
.card-email,
.card-phone {
  color: inherit;
  text-decoration: none;
  font-size: clamp(8px, 1.4vw, 12px);
  font-weight: 500;
  line-height: 1.4;
}
.card-email {
  margin-top: 7px;
}
.card-back {
  transform: rotateY(180deg);
  background: linear-gradient(130deg, #18191a, #3a3b3e);
  border: 1px solid #28292b;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.back-content {
  text-align: center;
}
.back-mark {
  font-size: clamp(39px, 7vw, 67px);
  letter-spacing: -0.115em;
  font-weight: 900;
  line-height: 1;
}
.back-mark span {
  letter-spacing: -0.13em;
}
.back-content > span {
  font-size: 12px;
  font-style: italic;
  font-weight: 700;
  display: block;
  margin-top: 7px;
}
.back-circle {
  width: 160px;
  height: 160px;
  border: 1px solid #ffffff11;
  border-radius: 50%;
  position: absolute;
  right: -55px;
  top: -55px;
  box-shadow:
    0 0 0 40px #ffffff04,
    0 0 0 80px #ffffff02;
}
.card-3d[data-tone="ink"] .card-front {
  background: #26282a;
  color: #fff;
  border-color: #35383a;
}
.card-3d[data-tone="ink"] .card-rule {
  background: #fff;
}
.card-3d[data-tone="ink"] .card-brand img {
  mix-blend-mode: normal;
}
.card-3d[data-tone="ink"] .card-identity > span {
  color: #ccc;
}
.card-3d[data-tone="ink"] .qr-click {
  background: white;
  border-radius: 3px;
  padding: 3px;
}
.card-3d[data-tone="ink"] .qr-click img {
  height: 100%;
  width: 100%;
}
.card-3d[data-tone="sand"] .card-front {
  background: #e9e0d2;
  border-color: #d7cfc3;
}
.card-3d[data-tone="sage"] .card-front {
  background: #dce9db;
  border-color: #cad7c9;
}
.preview-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}
.status {
  color: #adb0b3;
  font-size: 10px;
  white-space: nowrap;
}
.action-group {
  display: flex;
  gap: 6px;
}
.action-btn {
  border: 1px solid #e4e4e4;
  border-radius: 8px;
  background: white;
  min-height: 33px;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  color: #262728;
  font-size: 10px;
  font-weight: 700;
}
.action-btn:hover {
  background: #eee;
}
.action-btn svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.action-primary {
  background: #141516;
  border-color: #141516;
  color: #fff;
}
.action-primary:hover {
  background: #333;
  color: white;
}
@media (max-width: 530px) {
  .embed-root {
    padding: 8px 10px;
  }
  .preview-toolbar {
    gap: 3px;
  }
  .tab {
    padding: 6px 8px;
    font-size: 9px;
  }
  .drag-hint {
    font-size: 9px;
  }
  .card-front {
    padding: 12px;
    grid-template-columns: 43% 1px 1fr;
    border-radius: 9px;
  }
  .card-brand {
    padding-right: 7px;
  }
  .card-identity {
    padding-left: 5px;
  }
  .card-identity h2 {
    font-size: clamp(11px, 3.4vw, 16px);
  }
  .card-identity > span {
    font-size: clamp(8px, 2.4vw, 11px);
  }
  .card-identity > b {
    font-size: clamp(8px, 2.5vw, 10px);
    margin: 2px 0 3px;
  }
  .qr-click {
    width: 42px;
    height: 42px;
  }
  .card-email,
  .card-phone {
    font-size: clamp(7px, 2.05vw, 9px);
  }
  .card-email {
    margin-top: 3px;
  }
  .action-btn {
    padding: 0 7px;
    font-size: 9px;
  }
  .action-btn svg {
    width: 11px;
    height: 11px;
  }
  .status {
    font-size: 9px;
  }
}
@media (max-width: 360px) {
  .drag-hint {
    display: none;
  }
  .status {
    display: none;
  }
  .preview-actions {
    justify-content: flex-end;
  }
  .card-3d {
    width: calc(100% - 28px);
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
