:root {
  --bg-main: #f3f3f3;
  --card-bg: #ffffff;
  --primary: #575756;
  --primary-soft: #f1f1f1;
  --accent: #e30613;
  --text-main: #2f2f2f;
  --text-muted: #6c6c6b;
  --line: #d9d9d8;
  --shadow: 0 20px 42px rgba(33, 33, 33, 0.16);
  --radius-lg: 24px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top right, rgba(227, 6, 19, 0.16), transparent 46%),
    linear-gradient(160deg, #efefef 0%, #dcdcdc 100%);
  min-height: 100vh;
}

.page-wrapper {
  padding: 18px 14px 34px;
}

.contact-card {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--card-bg);
  box-shadow: var(--shadow);
}

.header-section {
  height: 168px;
  background: linear-gradient(130deg, #737372 0%, #575756 100%);
}

.header-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.header-fallback-image {
  object-position: center;
}

.profile-section {
  margin-top: -48px;
  padding: 0 18px;
}

.profile-image {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 4px solid #fff;
  box-shadow: 0 12px 28px rgba(32, 32, 32, 0.2);
}

.profile-image {
  object-fit: cover;
  display: block;
}

.profile-fallback-image {
  background: #fff;
  padding: 12px;
  object-fit: contain;
}

.content-section {
  padding: 8px 18px 24px;
}

h1 {
  margin: 10px 0 0;
  font-size: 1.55rem;
  line-height: 1.2;
}

.role-company {
  margin: 10px 0 18px;
  color: var(--text-muted);
  font-weight: 600;
}

.separator {
  padding: 0 7px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 10px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.btn-light {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: #cdcdcc;
}

.btn-light:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: #fff5f6;
}

.btn-primary {
  background: linear-gradient(120deg, #e30613 0%, #b90510 100%);
  color: #fff;
  border-color: #e30613;
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.add-contact-btn {
  width: 100%;
  margin: 10px 0 18px;
  font-size: 1rem;
}

.contact-details {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #fdfefe;
}

.contact-details li {
  padding: 11px 14px;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--line);
  line-height: 1.45;
}

.contact-details li:last-child {
  border-bottom: 0;
}

.contact-details a {
  color: var(--accent);
  word-break: break-word;
}

.qr-section {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  background: #fbfdff;
}

.qr-section h2 {
  margin: 0;
  font-size: 1.1rem;
}

.qr-section p {
  margin: 8px 0 14px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.qr-image {
  width: 168px;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 8px;
  background: #fff;
}

@media (min-width: 760px) {
  .page-wrapper {
    padding: 40px 16px;
  }

  .header-section {
    height: 220px;
  }

  .profile-section {
    margin-top: -60px;
    padding: 0 28px;
  }

  .profile-image {
    width: 120px;
    height: 120px;
  }

  .content-section {
    padding: 12px 28px 28px;
  }

  .quick-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
