/**
 * Design 2 — Premium executive layout.
 * Same DOM/sections as default; structural presentation only (theme tokens apply).
 */
:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] {
  --premium-panel-radius: clamp(12px, 3vw, 16px);
  --premium-panel-border: var(--modal-border, rgba(255, 255, 255, 0.12));
  --premium-panel-bg: var(--surface-glass, rgba(22, 38, 66, 0.72));
  --premium-octagon-clip: polygon(
    30% 0%,
    70% 0%,
    100% 30%,
    100% 70%,
    70% 100%,
    30% 100%,
    0% 70%,
    0% 30%
  );
}

:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .card-scroll {
  position: relative;
  background:
    radial-gradient(ellipse 90% 55% at 50% -8%, var(--accent-light), transparent 55%),
    linear-gradient(
      180deg,
      var(--bg-gradient-mid) 0%,
      var(--bg-primary) 32%,
      var(--bg-secondary) 100%
    );
}

:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .card-scroll::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: min(42%, 280px);
  pointer-events: none;
  opacity: 0.35;
  background-image:
    radial-gradient(circle at 20% 30%, var(--accent-subtle) 0 1px, transparent 2px),
    radial-gradient(circle at 60% 18%, var(--accent-subtle) 0 1px, transparent 2px),
    radial-gradient(circle at 82% 42%, var(--accent-subtle) 0 1px, transparent 2px),
    linear-gradient(
      125deg,
      transparent 40%,
      var(--accent-border) 40%,
      var(--accent-border) 41%,
      transparent 41%
    );
  background-size:
    48px 48px,
    56px 56px,
    52px 52px,
    100% 100%;
  mask-image: linear-gradient(180deg, #000 0%, transparent 100%);
}

/* Top bar */
:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .top-bar {
  position: relative;
  z-index: 2;
  padding-top: max(10px, env(safe-area-inset-top, 0px));
}

:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .top-bar-status {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10px;
  font-weight: 600;
}

/* Profile — horizontal hero */
:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .profile {
  position: relative;
  z-index: 1;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(14px, 4vw, 20px);
  padding: clamp(16px, 4vw, 22px) clamp(16px, 5vw, 24px);
  text-align: left;
}

:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .avatar-wrap {
  --avatar-size: clamp(88px, 26vw, 108px);
  margin: 0;
  flex-shrink: 0;
  border-radius: 0;
  overflow: visible;
}

:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .avatar-wrap::before {
  border-radius: 0;
  inset: -4px;
  background: linear-gradient(
    145deg,
    var(--avatar-ring-start),
    #e2e8f0 35%,
    var(--avatar-ring-end) 70%,
    #94a3b8
  );
  clip-path: var(--premium-octagon-clip);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.25),
    0 8px 24px var(--avatar-ring-glow);
}

:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .avatar,
:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .avatar-placeholder {
  border-radius: 0;
  clip-path: var(--premium-octagon-clip);
  border: 2px solid var(--avatar-border);
}

:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .profile-fields-list {
  align-items: flex-start;
  text-align: left;
  max-width: none;
  flex: 1;
  min-width: 0;
  gap: 4px;
}

:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .profile-field-wrap {
  align-items: flex-start;
  text-align: left;
  width: 100%;
}

:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .profile-field-wrap .editable-target {
  text-align: left;
}

:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .profile__name,
:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .profile__title,
:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .profile__company,
:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .profile__line {
  text-align: left;
  margin-left: 0;
  margin-right: 0;
}

:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .profile__name {
  font-size: clamp(16px, 4.8vw, 20px);
  line-height: 1.2;
}

:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .profile__title {
  color: var(--text-secondary);
  font-weight: 500;
}

:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .profile__company {
  color: var(--accent);
  font-weight: 600;
}

:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .profile .ecard-section-add-btn {
  max-width: 100%;
  margin-left: 0;
}

/* Glass panels — contacts */
:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .contacts {
  position: relative;
  z-index: 1;
  padding: 0 clamp(14px, 4vw, 20px) 8px;
}

:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .contacts-list {
  padding: 12px clamp(12px, 3vw, 16px);
  justify-content: center;
}

:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .contact-row {
  padding: 12px 4px;
  border-bottom-color: var(--divider);
}

:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .contact-row__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(
    145deg,
    var(--contact-icon-bg-start),
    var(--contact-icon-bg-end)
  );
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .contact-row__label {
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.04em;
}

/* Actions — same panel width/system as contacts */
:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .actions {
  position: relative;
  z-index: 1;
  padding: 0 clamp(14px, 4vw, 20px) 12px;
  gap: 0;
}

:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .actions-list {
  width: 100%;
  box-sizing: border-box;
  padding: 12px clamp(12px, 3vw, 16px);
  gap: 0;
  justify-content: center;
}

:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .ecard-section-card {
  padding: 12px clamp(12px, 3vw, 16px);
  justify-content: center;
}

:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .action-btn-wrap {
  width: 100%;
}

:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .action-btn {
  width: 100%;
  box-sizing: border-box;
  border: none;
  border-radius: 0;
  border-bottom: 1px solid var(--divider);
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
  padding: 12px 4px;
  gap: 12px;
}

:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .actions-list > .action-btn-wrap:last-child .action-btn {
  border-bottom: none;
}

:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .action-btn:hover {
  background: var(--accent-subtle);
}

:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .action-btn__icon {
  border-radius: 10px;
  background: linear-gradient(
    145deg,
    var(--contact-icon-bg-start),
    var(--contact-icon-bg-end)
  );
}

:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .action-btn__label {
  font-weight: 600;
}

/* Footer / social — same panel system as contacts & actions */
:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .footer {
  position: relative;
  z-index: 1;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .footer .ecard-section-block[data-ecard-section="social"] {
  padding: 0 clamp(14px, 4vw, 20px) 8px;
}

:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .footer .ecard-section-block[data-ecard-section="about"] {
  padding: 0 clamp(14px, 4vw, 20px) 12px;
}

:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .contacts-list,
:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .actions-list,
:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .ecard-section-card {
  background: var(--premium-panel-bg);
  border: 1px solid var(--premium-panel-border);
  border-radius: var(--premium-panel-radius);
  box-shadow: var(--shadow-button, 0 4px 20px rgba(0, 0, 0, 0.12));
  backdrop-filter: blur(10px);
}

:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .social-divider {
  margin: 12px clamp(14px, 4vw, 20px) 14px;
}

:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .social-divider .editable-target,
:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .social-divider span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .social-divider::before,
:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .social-divider::after {
  background: var(--divider);
  opacity: 1;
}

/* Social tile chrome — colors from icon-systems/design2 when .d2-social-icon present */
:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .social-icon.d2-social-icon {
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .social-icon.d2-social-icon svg {
  filter: none;
}

:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .footer-powered-list {
  padding-inline: 0;
}

:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .footer-copyright {
  font-size: 11px;
  color: var(--text-tertiary);
  padding: 16px clamp(14px, 4vw, 20px) max(16px, env(safe-area-inset-bottom, 0px));
  background: transparent;
  border: none;
  box-shadow: none;
}

/* Edit mode — preserve controls */
:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"].is-editing .profile-field-wrap .editable-target,
:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"].is-editing .contact-row-wrap .contact-row,
:is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"].is-editing .action-btn-wrap .action-btn {
  padding-left: 36px;
  padding-right: 36px;
}

@media (max-width: 380px) {
  :is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .profile {
    flex-direction: column;
    text-align: center;
  }

  :is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .profile-fields-list,
  :is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .profile-field-wrap,
  :is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .profile-field-wrap .editable-target,
  :is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .profile__name,
  :is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .profile__title,
  :is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .profile__company {
    align-items: center;
    text-align: center;
  }
}

@media (min-width: 768px) {
  :is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .contacts-list,
  :is(#card-shell, .layout-preview-shell).layout-shell[data-layout="premium"] .actions-list {
    max-width: 520px;
    margin-inline: auto;
  }
}
