.card-runtime-host {
  container-type: inline-size;
}

.card-runtime-host {
  width: 100%;
}

.card-preview {
  position: relative;
  overflow: hidden;
  container-type: inline-size;
  min-height: 620px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 36px;
  box-shadow: var(--shadow-card, 0 30px 80px -48px rgba(15, 23, 42, 0.42));
}

.card-bg-media,
.card-gradient-media {
  position: absolute;
  inset: -28px;
  background-position: center;
  background-size: cover;
  pointer-events: none;
}

.card-bg-media {
  z-index: 0;
}

.card-gradient-media {
  z-index: 1;
}

.card-preview.soft-gradient {
  background:
    radial-gradient(circle at 20% 0, rgba(170, 199, 255, 0.36), transparent 34%),
    linear-gradient(180deg, var(--preview-bg), rgba(255, 255, 255, 0.65));
}

.card-preview.solid {
  background: var(--preview-bg);
}

.card-page {
  position: relative;
  z-index: 2;
  container-type: inline-size;
  width: min(100%, var(--preview-width));
  margin: 0 auto;
  color: var(--preview-text);
  font-size: var(--preview-font);
}

.block-crop-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: visible;
}

.block-crop-frame[style*="border-radius"] {
  overflow: hidden;
}

.block-crop-frame.fit-cover,
.block-crop-frame.fit-contain {
  overflow: hidden;
}

.block-crop-frame.fit-cover.is-fixed-height > .block-shell,
.block-crop-frame.fit-contain.is-fixed-height > .block-shell {
  width: 100%;
  min-height: 100%;
}

.block-crop-frame.is-fixed-height > .block-shell {
  display: flex;
  flex-direction: column;
}

.block-crop-frame.is-fixed-height > .block-shell > .block-inner,
.block-crop-frame.is-fixed-height > .block-shell > .hero-content {
  width: 100%;
}

.block-crop-frame.fit-cover.is-fixed-height > .block-shell {
  height: 100%;
}

.block-crop-frame.fit-cover.is-fixed-height .hero-visual,
.block-crop-frame.fit-cover.is-fixed-height .gallery-item {
  min-height: 100%;
}

.block-crop-frame.fit-contain.is-fixed-height > .block-shell {
  margin-top: auto;
  margin-bottom: auto;
}

.block-shell {
  width: 100%;
  overflow: hidden;
  border-radius: var(--block-radius);
  background: var(--preview-card);
  color: var(--preview-text);
  box-shadow: var(--block-shadow);
}

.block-inner {
  padding: 18px;
}

.hero-visual {
  position: relative;
  overflow: hidden;
  min-height: 128px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.28), rgba(170, 199, 255, 0.22));
  background-position: center;
  background-size: cover;
}

.hero-visual-image {
  position: absolute;
  inset: -20px;
  background-position: center;
  background-size: cover;
}

.hero-content {
  display: flex;
  gap: 16px;
  padding: 18px;
}

.hero-content.align-center {
  align-items: center;
  flex-direction: column;
  text-align: center;
}

.hero-content.align-right {
  justify-content: flex-end;
  text-align: right;
}

.avatar-preview {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  max-width: 100%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--preview-accent), #aac7ff);
  color: #fff;
  font-weight: 800;
}

.avatar-preview img,
.gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-name,
.block-title {
  margin: 0;
  color: var(--preview-text);
}

.hero-name {
  font-size: 1.8em;
  line-height: 1.12;
}

.hero-subtitle,
.hero-handle,
.body-text,
.meta-text,
.notice-text {
  color: var(--preview-muted);
}

.hero-subtitle,
.body-text,
.notice-text {
  line-height: 1.7;
}

.hero-subtitle {
  margin: 8px 0 0;
}

.hero-handle {
  margin-top: 8px;
  font-weight: 700;
}

.block-title {
  margin-bottom: 10px;
  font-size: 1.05em;
}

.body-text {
  margin: 0;
  white-space: pre-wrap;
}

.align-center {
  text-align: center;
}

.align-right {
  text-align: right;
}

.identity-grid {
  --identity-responsive-cols: var(--identity-cols, 1);
  display: grid;
  grid-template-columns: repeat(var(--identity-responsive-cols), minmax(0, 1fr));
  gap: 10px;
}

.identity-item {
  min-width: 0;
  padding: 12px;
  border-radius: calc(var(--block-radius) * 0.62);
  background: rgba(101, 112, 132, 0.08);
}

.identity-item span {
  display: block;
  color: var(--preview-muted);
  font-size: 0.78em;
  font-weight: 800;
  text-transform: uppercase;
}

.identity-item strong {
  display: block;
  margin-top: 4px;
}

.link-grid,
.button-list {
  display: grid;
  gap: 10px;
}

.link-grid.is-grid {
  --link-responsive-cols: var(--link-cols, 1);
  grid-template-columns: repeat(var(--link-responsive-cols), minmax(0, 1fr));
}

.button-list.is-row {
  --button-responsive-cols: var(--button-cols, 1);
  grid-template-columns: repeat(var(--button-responsive-cols), minmax(0, 1fr));
}

.button-list.is-column {
  grid-template-columns: 1fr;
}

.card-link,
.card-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  min-width: 0;
  padding: 0 14px;
  border-radius: var(--button-radius);
  font-weight: 800;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.card-link {
  border: 1px solid rgba(101, 112, 132, 0.16);
  background: rgba(255, 255, 255, 0.64);
  color: var(--preview-text);
}

.card-button.primary {
  background: var(--preview-accent);
  color: #fff;
}

.card-button.secondary {
  background: rgba(101, 112, 132, 0.1);
  color: var(--preview-text);
}

.card-button.outline {
  border: 1px solid var(--preview-accent);
  color: var(--preview-accent);
}

.card-runtime-host .ghost-button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(101, 112, 132, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--preview-text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.card-runtime-host .ghost-button:hover {
  border-color: var(--preview-accent);
  color: var(--preview-accent);
}

.contact-list {
  display: grid;
  gap: 9px;
}

.contact-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(101, 112, 132, 0.12);
}

.contact-list strong,
.identity-item strong,
.hero-name,
.hero-subtitle,
.hero-handle,
.block-title,
.body-text,
.meta-text,
.notice-text {
  overflow-wrap: anywhere;
}

.support-block {
  display: grid;
  gap: 12px;
}

.qr-box {
  display: grid;
  place-items: center;
  width: min(var(--qr-size, 132px), 100%, 180px);
  aspect-ratio: 1;
  margin: 0 auto 12px;
  border: 1px dashed rgba(101, 112, 132, 0.34);
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(101, 112, 132, 0.15) 1px, transparent 1px),
    linear-gradient(rgba(101, 112, 132, 0.15) 1px, transparent 1px),
    rgba(255, 255, 255, 0.68);
  background-size: 16px 16px;
  color: var(--preview-muted);
  font-weight: 800;
}

.gallery-grid {
  --gallery-responsive-cols: var(--gallery-cols, 1);
  display: grid;
  grid-template-columns: repeat(var(--gallery-responsive-cols), minmax(0, 1fr));
  gap: 10px;
}

.gallery-item {
  aspect-ratio: 1;
  overflow: hidden;
  background: rgba(101, 112, 132, 0.1);
}

.gallery-placeholder {
  display: grid;
  place-items: center;
  height: 120px;
  border-radius: 18px;
  background: rgba(101, 112, 132, 0.08);
  color: var(--preview-muted);
  font-weight: 800;
}

.notice-block {
  border-left: 4px solid var(--preview-accent);
}

.notice-block.warning {
  border-left-color: #f59e0b;
}

.notice-block.info {
  border-left-color: #0ea5e9;
}

.divider-line {
  border: 0;
  border-top: 1px solid rgba(101, 112, 132, 0.22);
}

.divider-line.dashed {
  border-top-style: dashed;
}

@container (max-width: 460px) {
  .card-preview {
    min-height: 520px;
    padding: 14px;
    border-radius: 28px;
  }
}

@container (max-width: 460px) {
  .card-page {
    width: 100%;
  }

  .block-inner,
  .hero-content {
    padding: 14px;
  }

  .hero-content,
  .hero-content.align-right {
    align-items: center;
    flex-direction: column;
    justify-content: center;
    text-align: center;
  }

  .hero-visual {
    min-height: 104px;
  }

  .hero-name {
    font-size: 1.42em;
  }

  .identity-grid,
  .link-grid.is-grid,
  .gallery-grid,
  .button-list,
  .button-list.is-row,
  .button-list.is-column {
    --identity-responsive-cols: 1;
    --link-responsive-cols: 1;
    --gallery-responsive-cols: 1;
    --button-responsive-cols: 1;
    grid-template-columns: 1fr;
  }

  .contact-list div {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .card-link,
  .card-button {
    min-height: 42px;
    padding-inline: 12px;
  }

  .qr-box {
    width: min(var(--qr-size, 132px), 100%, 148px);
  }
}

@container (min-width: 461px) and (max-width: 820px) {
  .card-page {
    margin-inline: auto;
  }

  .identity-grid.cols-1,
  .link-grid.cols-1,
  .gallery-grid.cols-1,
  .button-list.cols-1 {
    --identity-responsive-cols: 1;
    --link-responsive-cols: 1;
    --gallery-responsive-cols: 1;
    --button-responsive-cols: 1;
  }

  .identity-grid.cols-2,
  .identity-grid.cols-3,
  .link-grid.cols-2,
  .link-grid.cols-3,
  .gallery-grid.cols-2,
  .gallery-grid.cols-3,
  .gallery-grid.cols-4,
  .button-list.cols-2,
  .button-list.cols-3,
  .button-list.cols-4 {
    --identity-responsive-cols: 2;
    --link-responsive-cols: 2;
    --gallery-responsive-cols: 2;
    --button-responsive-cols: 2;
  }
}

@container (min-width: 821px) {
  .card-page {
    margin-inline: auto;
  }
}
