:root {
  --bg: #fff8f2;
  --panel: #ffffff;
  --text: #2d1b24;
  --muted: #7b646f;
  --accent: #d94f70;
  --accent-2: #8e2f48;
  --border: #f0dbe3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  background: radial-gradient(circle at 20% 0%, #ffe6ef, var(--bg));
}

body.loading-active {
  overflow: hidden;
}

.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 20px 16px 36px;
}

h1 {
  margin: 0 0 8px;
}

p {
  margin: 0 0 14px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 14px;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}

input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #e5cad4;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 16px;
}

#name-form button {
  width: 100%;
  margin-top: 10px;
}

.preview-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 8 / 5;
  border: 1px dashed #e4c5d1;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-frame img {
  max-width: 100%;
  max-height: 100%;
  display: none;
}

#preview-placeholder {
  color: var(--muted);
}

.actions {
  display: grid;
  gap: 10px;
}

button,
.button {
  min-height: 46px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

#buy-name {
  min-height: 56px;
  font-size: 20px;
  font-weight: 800;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}

#buy-name-label {
  display: block;
  min-width: 0;
  text-align: left;
}

button.secondary {
  background: #533743;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.error {
  color: #b22148;
  min-height: 20px;
  margin-top: 8px;
}

.muted-note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
  margin: 10px 2px 0;
}

.product-note {
  margin-top: -2px;
  margin-bottom: 6px;
}

.button-highlights {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  justify-items: end;
  width: auto;
}

.button-highlight {
  display: block;
  min-height: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.1;
  text-align: right;
  letter-spacing: 0.02em;
  width: 100%;
}

.consent-check {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px;
  margin: 2px 2px 0;
  font-weight: 600;
  line-height: 1.4;
}

.consent-check input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin-top: 2px;
}

.consent-help {
  margin-top: -4px;
}

.size-cards {
  display: grid;
  gap: 12px;
}

.size-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  min-height: 44px;
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #e7c7d1;
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}

.size-card {
  width: 100%;
  min-height: auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: stretch;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: #fffdfb;
}

.size-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(217, 79, 112, 0.15);
}

.size-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.size-card-title {
  font-weight: 800;
  font-size: 18px;
}

.size-card-meta {
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
}

.size-card-main {
  min-width: 0;
}

.size-card-cta {
  width: 100%;
  min-height: 72px;
  border-radius: 14px;
  text-align: left;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.size-card-cta-label {
  display: block;
  min-width: 0;
  text-align: left;
  font-size: 20px;
}

.size-card-cta-highlights {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  justify-items: end;
  width: auto;
}

.size-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.size-stat {
  border: 1px solid #ead1d9;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}

.size-stat-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8a6674;
  margin-bottom: 4px;
}

.size-stat-value {
  display: block;
  font-size: 24px;
  line-height: 1;
  font-weight: 800;
  color: var(--text);
}

.size-stat-value-compact {
  font-size: 20px;
}

.size-stat-subvalue {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 700;
  color: #6a4e59;
}

footer {
  margin-top: 20px;
  display: flex;
  gap: 12px;
}

.seo-section h2 {
  margin: 0 0 10px;
  font-size: 24px;
}

.legal-container {
  max-width: 820px;
}

.legal-page h1 {
  margin-bottom: 6px;
}

.legal-meta {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 18px;
}

.legal-box h2,
.legal-section h2 {
  margin: 0 0 10px;
  font-size: 22px;
}

.legal-section p:last-child,
.legal-box p:last-child {
  margin-bottom: 0;
}

.legal-list {
  margin: 0 0 14px;
  padding-left: 20px;
}

.legal-list li {
  margin-bottom: 8px;
  line-height: 1.45;
}

.seo-list {
  margin: 0;
  padding-left: 20px;
  color: var(--text);
}

.seo-list li {
  margin-bottom: 8px;
  line-height: 1.45;
}

.seo-list-numbered {
  padding-left: 22px;
}

.faq-item {
  border-top: 1px solid var(--border);
  padding: 12px 0;
}

.faq-item:first-of-type {
  padding-top: 0;
  border-top: none;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item p {
  margin: 8px 0 0;
  color: var(--muted);
}

.inline-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(255, 248, 242, 0.84);
  backdrop-filter: blur(3px);
  padding: 16px;
  overflow: hidden;
}

.loading-overlay[hidden] {
  display: none;
}

.loading-overlay-card {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(320px, calc(100% - 32px));
  max-width: calc(100% - 32px);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: clamp(16px, 5vw, 24px) clamp(14px, 4vw, 20px);
  box-shadow: 0 16px 40px rgba(88, 42, 58, 0.14);
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
  margin: 0;
}

.spinner-large {
  width: 40px;
  height: 40px;
  border-width: 4px;
}

#loading-overlay-text {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  max-width: 100%;
  overflow-wrap: anywhere;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
