:root {
  color-scheme: light;
  --bg: #eef4ff;
  --card: #ffffff;
  --text: #172033;
  --muted: #71819a;
  --line: #dde7f5;
  --blue: #2f66ea;
  --green: #00a878;
  --red: #ef4444;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #dfeaff, var(--bg));
  color: var(--text);
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 32px auto;
}

.hero, .card, .public-card {
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 18px 48px rgba(31, 45, 71, .10);
}

.hero {
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.hero.compact { padding: 22px 28px; }
.eyebrow { color: var(--muted); font-weight: 800; letter-spacing: .08em; font-size: 13px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(28px, 4vw, 42px); }
.hero p { margin: 0; color: var(--muted); }
.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.hero-actions form { margin: 0; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f6f9ff;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.button.primary { background: var(--blue); color: white; border-color: var(--blue); }
.button.ghost:hover { border-color: #b8c7df; }
.button.danger { color: var(--red); background: #fff5f5; border-color: #fecaca; }

.card { padding: 24px; }
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 18px;
}
.section-title h2 { margin: 0; }
.section-title span { color: var(--muted); font-weight: 800; }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 16px;
}
.person-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
  background: #fbfdff;
}
.person-main { display: flex; gap: 14px; align-items: center; }
.qr-small { width: 84px; height: 84px; border-radius: 14px; border: 1px solid var(--line); }
.person-main h3 { margin-bottom: 6px; }
.person-main p { margin: 2px 0; color: var(--muted); }
.person-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.person-actions form { margin: 0; }

.empty {
  padding: 42px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed #bfd0ea;
  border-radius: 20px;
}

.messages { margin-bottom: 16px; }
.message { padding: 12px 14px; border-radius: 14px; font-weight: 700; }
.message.success { background: #ecfdf5; color: #047857; }
.message.danger { background: #fff1f2; color: #be123c; }

.form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
label { display: grid; gap: 7px; color: var(--muted); font-weight: 800; }
input, textarea {
  width: 100%;
  border: 1px solid #cad7ea;
  border-radius: 14px;
  padding: 13px 14px;
  font: inherit;
  color: var(--text);
  background: #fbfdff;
}
textarea { resize: vertical; }
.wide, .form-actions { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; }

.public-card {
  width: min(520px, 100%);
  margin: 24px auto;
  padding: 28px;
  text-align: center;
}
.brand { color: var(--muted); font-weight: 900; letter-spacing: .08em; margin-bottom: 14px; }
.public-logo {
  display: block;
  width: min(260px, 82%);
  height: auto;
  margin: 0 auto 18px;
  object-fit: contain;
}
.avatar-qr {
  width: 168px;
  height: 168px;
  border-radius: 26px;
  border: 1px solid var(--line);
  padding: 8px;
  background: white;
}
.public-card h1 { margin: 18px 0 6px; }
.title, .company { color: var(--muted); margin-bottom: 4px; }
.info-list {
  display: grid;
  gap: 10px;
  text-align: left;
  margin: 22px 0;
}
.info-list a, .info-list div {
  display: block;
  padding: 13px 14px;
  border-radius: 14px;
  background: #f6f9ff;
  color: var(--text);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.social-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0;
}
.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #dbe7f8;
  border-radius: 14px;
  background: #eef6ff;
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 900;
}
.social-links a:first-child {
  grid-column: 1 / -1;
  background: #ecfdf5;
  color: #047857;
  border-color: #b7f0d4;
}
.save-button { width: 100%; }
.hint { margin: 14px 0 0; color: var(--muted); font-size: 14px; }
.login-card {
  width: min(440px, 100%);
  margin: 40px auto;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 18px 48px rgba(31, 45, 71, .10);
  text-align: center;
}
.login-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
  text-align: left;
}
.login-form .button { width: 100%; }

@media (max-width: 720px) {
  .shell { width: min(100% - 18px, 1120px); margin: 12px auto; }
  .hero { align-items: stretch; flex-direction: column; }
  .form { grid-template-columns: 1fr; }
  .person-actions .button, .person-actions form, .person-actions button { width: 100%; }
  .social-links { grid-template-columns: 1fr; }
}
