:root {
  --bg: #fff9fb;
  --bg2: #ffe7f0;
  --panel: rgba(255, 255, 255, 0.9);
  --text: #402232;
  --muted: #8b6074;
  --accent: #e54f8f;
  --accent-dark: #cb2f73;
  --line: #f4d5e3;
  --shadow: 0 18px 40px rgba(203, 47, 115, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background:
    radial-gradient(circle at 12% 12%, #ffddea 0, transparent 35%),
    radial-gradient(circle at 88% 18%, #ffcee4 0, transparent 36%),
    linear-gradient(155deg, var(--bg), var(--bg2));
  color: var(--text);
  min-height: 100vh;
}

.layout {
  width: min(960px, calc(100% - 32px));
  margin: 28px auto 36px;
  display: grid;
  gap: 18px;
}

.hero {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: radial-gradient(circle at 86% 12%, #ffd6e9 0%, transparent 46%),
    radial-gradient(circle at 12% 90%, #ffe7f2 0%, transparent 38%), var(--panel);
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow);
}

.brand {
  margin: 0 0 8px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent-dark);
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-weight: 700;
  font-size: clamp(1.7rem, 4vw, 2.55rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.lead {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1.01rem;
  line-height: 1.6;
}

.panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel h2 {
  margin: 0 0 16px;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: #5f3448;
}

.size-form {
  display: grid;
  gap: 14px;
}

.size-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}

input,
select,
.cta {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 12px 13px;
  font-size: 1rem;
  color: var(--text);
  background: #fffdfd;
}

input:focus,
select:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(229, 79, 143, 0.24);
}

.cta {
  margin-top: 6px;
  background: linear-gradient(120deg, var(--accent), var(--accent-dark));
  color: #ffffff;
  border-color: transparent;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
  box-shadow: 0 12px 24px rgba(203, 47, 115, 0.28);
}

.cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(203, 47, 115, 0.35);
}

.result-panel {
  position: relative;
  overflow: hidden;
}

.result-panel::after {
  content: "";
  position: absolute;
  inset: auto -60px -60px auto;
  width: 170px;
  height: 170px;
  background: radial-gradient(circle, rgba(229, 79, 143, 0.2), transparent 60%);
}

.result-text {
  margin: 0 0 12px;
  font-weight: 700;
  line-height: 1.5;
}

.tips {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.guide p {
  margin: 10px 0;
  color: var(--muted);
}

.chart-panel {
  display: grid;
  gap: 14px;
}

.card-actions {
  margin-top: 8px;
}

.profile-form-wrap {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.pet-profile-card {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff, #fff4f8);
  display: grid;
  justify-items: center;
  gap: 12px;
}

.heart-frame {
  width: min(500px, 94vw);
  aspect-ratio: 212 / 194;
  padding: 16px;
  background: linear-gradient(145deg, #ff9ec4, #ff74ab);
  clip-path: polygon(50% 95%, 7% 60%, 7% 34%, 22% 17%, 36% 17%, 50% 31%, 64% 17%, 78% 17%, 93% 34%, 93% 60%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 26px rgba(229, 79, 143, 0.24);
}

.heart-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  clip-path: polygon(50% 95%, 7% 60%, 7% 34%, 22% 17%, 36% 17%, 50% 31%, 64% 17%, 78% 17%, 93% 34%, 93% 60%);
  background: #fff;
}

.pet-profile-title {
  margin: 0;
  color: #d43478;
  font-size: 1.1rem;
  font-weight: 900;
  text-align: center;
}

.pet-profile-meta {
  margin: 0;
  color: #5b3045;
  font-size: 0.95rem;
  line-height: 1.55;
  text-align: center;
  white-space: pre-line;
}

.chart-average-notice {
  margin: 0;
  padding: 11px 13px;
  border-radius: 12px;
  background: #ffeefa;
  border: 1px solid #f4c9de;
  color: #7e3658;
  font-weight: 700;
  line-height: 1.5;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.size-chart-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  background: #fffdfd;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.size-chart-table caption {
  text-align: left;
  padding: 10px 12px;
  font-size: 0.92rem;
  color: var(--muted);
}

.size-chart-table th,
.size-chart-table td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  font-size: 0.95rem;
  text-align: center;
  white-space: nowrap;
}

.size-chart-table th {
  background: #fff1f7;
  color: #5f3448;
  font-weight: 700;
}

.size-chart-table tbody th {
  text-align: left;
}

.toggle-image-btn {
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  background: #fff8fc;
  color: #6b3f53;
  font-weight: 600;
  cursor: pointer;
}

.chart-image-wrap {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  background: #fffdfd;
}

.chart-image-wrap img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

.chart-notices {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: var(--muted);
}

@media (max-width: 640px) {
  .layout {
    width: calc(100% - 20px);
    margin: 10px auto 20px;
  }

  .hero,
  .panel {
    padding: 18px;
  }

  .hero h1 {
    font-size: 1.55rem;
  }

  .lead {
    font-size: 0.95rem;
  }

  .size-chart-table {
    min-width: 500px;
  }
}
