.profile-page {
  padding-top: 1px;
}

.profile-header,
.profile-main {
  width: min(calc(100% - 40px), 860px);
  margin-right: auto;
  margin-left: auto;
}

.profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 24px;
  padding: 16px 20px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow-sm), var(--glow);
  backdrop-filter: blur(20px) saturate(135%);
  -webkit-backdrop-filter: blur(20px) saturate(135%);
}

.profile-brand,
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ocean-800);
  font-weight: 800;
  text-decoration: none;
}

.profile-brand { font-size: 1.25rem; }
.profile-brand > span:first-child { font-size: 1.6rem; }
.back-link { padding: 8px 12px; border-radius: 999px; }
.back-link:hover { background: rgba(255, 255, 255, 0.66); }

.profile-main { padding: 64px 0 24px; }

.profile-intro { margin-bottom: 28px; text-align: center; }
.profile-kicker { margin: 0 0 8px; color: var(--ocean-700); font-size: 0.78rem; font-weight: 850; letter-spacing: 0.13em; text-transform: uppercase; }
.profile-intro h1 { margin: 0; color: var(--ocean-950); font-size: clamp(2.3rem, 8vw, 4.4rem); line-height: 1; letter-spacing: -0.055em; }
.profile-intro > p:last-child { max-width: 600px; margin: 20px auto 0; color: var(--muted); }

.profile-form {
  padding: clamp(22px, 5vw, 42px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(22px) saturate(135%);
  -webkit-backdrop-filter: blur(22px) saturate(135%);
}

.prototype-note { display: flex; gap: 13px; margin-bottom: 34px; padding: 16px 18px; border: 1px solid rgba(14, 165, 233, 0.2); border-radius: var(--radius-sm); background: rgba(224, 242, 254, 0.65); }
.prototype-note > span { font-size: 1.35rem; }
.prototype-note strong, .prototype-note div > span { display: block; }
.prototype-note strong { color: var(--ocean-800); font-size: 0.78rem; letter-spacing: 0.08em; }
.prototype-note div > span { margin-top: 2px; color: var(--muted); font-size: 0.9rem; }

.form-section { min-width: 0; margin: 0; padding: 0 0 30px; border: 0; }
.form-section + .form-section { padding-top: 30px; border-top: 1px solid rgba(14, 165, 233, 0.13); }
.field-label, .form-section legend { display: block; margin-bottom: 10px; color: var(--ocean-950); font-size: 1.08rem; font-weight: 800; }
.field-hint { margin: -5px 0 14px; color: var(--muted); font-size: 0.88rem; }
.text-field { width: 100%; min-height: 50px; padding: 12px 15px; border: 1px solid rgba(14, 165, 233, 0.3); border-radius: var(--radius-sm); outline: 0; color: var(--text); background: rgba(255, 255, 255, 0.74); }
.text-field:focus { border-color: var(--ocean-500); box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15); }
.text-field[aria-invalid="true"] { border-color: #dc2626; }

.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice-card { position: relative; min-width: 0; cursor: pointer; }
.choice-card input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.choice-card span { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 12px; border: 1px solid rgba(14, 165, 233, 0.22); border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.56); color: var(--muted); font-weight: 720; text-align: center; transition: 180ms ease; }
.choice-card input:checked + span { border-color: var(--ocean-500); color: var(--ocean-950); background: rgba(224, 242, 254, 0.96); box-shadow: 0 7px 18px rgba(3, 105, 161, 0.1); }
.choice-card:hover span { border-color: rgba(14, 165, 233, 0.5); }
.choice-card input:focus-visible + span { outline: 3px solid rgba(2, 132, 199, 0.45); outline-offset: 3px; }

.birth-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 0.55fr); align-items: end; gap: 18px; }
.field-error { min-height: 1.4em; margin: 6px 0 0; color: #b91c1c; font-size: 0.84rem; }
.zodiac-card { min-height: 78px; padding: 12px 16px; border: 1px solid rgba(14, 165, 233, 0.2); border-radius: var(--radius-sm); background: rgba(224, 242, 254, 0.62); }
.zodiac-card span, .zodiac-card strong { display: block; }
.zodiac-card span { color: var(--muted); font-size: 0.78rem; }
.zodiac-card strong { margin-top: 3px; color: var(--ocean-800); font-size: 1.08rem; }

.form-actions { display: flex; align-items: center; gap: 18px; padding-top: 4px; }
.save-button { min-height: 50px; padding: 12px 28px; border: 0; border-radius: 999px; color: white; background: linear-gradient(135deg, var(--ocean-700), var(--ocean-500)); box-shadow: 0 10px 24px rgba(3, 105, 161, 0.24); font-weight: 800; }
.save-button:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(3, 105, 161, 0.3); }
.save-status { margin: 0; color: var(--ocean-800); font-weight: 700; }

.profile-brand:focus-visible, .back-link:focus-visible, .save-button:focus-visible { outline: 3px solid rgba(2, 132, 199, 0.45); outline-offset: 4px; }

@media (max-width: 600px) {
  .profile-header, .profile-main { width: min(calc(100% - 24px), 860px); }
  .profile-header { margin-top: 12px; padding: 13px 14px; }
  .profile-main { padding-top: 44px; }
  .profile-form { border-radius: var(--radius-md); }
  .choice-grid--three, .birth-grid { grid-template-columns: 1fr; }
  .interests-grid { grid-template-columns: 1fr 1fr; }
  .choice-card span { min-height: 46px; font-size: 0.9rem; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .save-button { width: 100%; }
  .save-status { min-height: 1.5em; text-align: center; }
}

@media (max-width: 390px) {
  .profile-brand > span:last-child { display: none; }
  .interests-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .choice-card span, .save-button { transition: none; }
  .save-button:hover { transform: none; }
}
