:root {
  --ink: #0f172a;
  --muted: #475569;
  --paper: #f8fafc;
  --panel: #ffffff;
  --line: rgba(148, 163, 184, 0.2);
  --terracotta: #3b82f6; 
  --terracotta-deep: #1d4ed8;
  --sage: #10b981;
  --gold: #f59e0b;
  --blush: #ec4899;
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
  --radius: 28px;
  --font: "IBM Plex Sans", "Segoe UI", Helvetica, Arial, sans-serif;
  --display: "Fraunces", "Times New Roman", serif;
}


* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #fde7d4 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #dcead8 0%, transparent 50%),
    #f4eadb;
  line-height: 1.55;
}

.bg-blob {
  position: fixed;
  z-index: 0;
  filter: blur(10px);
  pointer-events: none;
}

.blob-a {
  width: 280px;
  height: 280px;
  left: -80px;
  top: 120px;
  background: #f7c9ae;
  border-radius: 46% 54% 62% 38% / 42% 38% 62% 58%;
  opacity: 0.45;
}

.blob-b {
  width: 220px;
  height: 220px;
  right: -40px;
  top: 40px;
  background: #c9ddc4;
  border-radius: 60% 40% 48% 52%;
  opacity: 0.5;
}

.blob-c {
  width: 180px;
  height: 180px;
  right: 12%;
  bottom: 8%;
  background: #f0d48a;
  border-radius: 40% 60% 55% 45%;
  opacity: 0.35;
}

.site-header,
.layout,
.site-footer {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  padding: 48px 0 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow);
  font-size: 28px;
}

.brand-kicker {
  margin: 0;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--terracotta);
  font-weight: 600;
}

h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(36px, 6vw, 56px);
  letter-spacing: -0.03em;
  font-weight: 700;
}

.lede {
  max-width: 680px;
  color: var(--muted);
  margin: 18px 0 0;
  font-size: 17px;
  line-height: 1.5;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.layout {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 22px;
  padding-bottom: 48px;
}

.panel {
  background: var(--panel);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.panel-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 28px;
}

.panel-head p {
  margin: 8px 0 22px;
  color: var(--muted);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

label,
legend {
  font-size: 13px;
  font-weight: 600;
}

.optional {
  color: var(--muted);
  font-weight: 400;
}

input,
select {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--terracotta);
  box-shadow: 0 0 0 4px rgba(196, 92, 38, 0.12);
}

.hint {
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.weight-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: stretch;
}

.weight-row input {
  min-width: 0;
}

.unit-toggle {
  margin: 0;
  width: 132px;
}

.unit-toggle .segmented-row {
  margin: 0;
  height: 100%;
}

.unit-toggle .chip span {
  padding: 11px 8px;
  height: 100%;
  display: grid;
  place-items: center;
}

fieldset {
  border: 0;
  margin: 0 0 16px;
  padding: 0;
}

.segmented-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.chip {
  flex: 1;
  cursor: pointer;
}

.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip span {
  display: block;
  text-align: center;
  padding: 11px 8px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: 13px;
  line-height: 1.2;
}

.chip input:checked + span {
  background: var(--ink);
  color: #fff8ef;
  border-color: var(--ink);
}

.primary-btn,
.ghost-btn {
  font: inherit;
  font-weight: 600;
  border-radius: 16px;
  padding: 14px 18px;
  cursor: pointer;
  border: 0;
}

.primary-btn {
  width: 100%;
  background: linear-gradient(180deg, #d56a2f, var(--terracotta-deep));
  color: #fff8ef;
  box-shadow: 0 12px 24px rgba(157, 63, 20, 0.28);
}

.ghost-btn {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}

.form-error {
  color: #a12b1d;
  background: #fde8e2;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat {
  background: #fff;
  border-radius: 18px;
  padding: 16px;
  border: 1px solid var(--line);
}

.stat.accent {
  background: linear-gradient(160deg, #3f2a1c, #6b3b22);
  color: #fff6ea;
  border: 0;
}

.stat-label {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.stat.accent .stat-label {
  color: #f0c9a8;
}

.stat-value {
  margin: 6px 0 0;
  font-family: var(--display);
  font-size: 28px;
}

.note {
  color: var(--muted);
  font-size: 13px;
  margin: 16px 0 0;
}

.treat-guide {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #eff6ff;
  border: 1px solid rgba(37, 99, 235, 0.16);
}

.treat-guide-kicker {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2563eb;
}

.treat-guide-copy {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.45;
}

.share-wrap {
  margin-top: 28px;
  padding-top: 8px;
}

.share-wrap h3 {
  margin: 0;
  font-family: var(--display);
}

.share-copy {
  color: var(--muted);
  margin: 6px 0 16px;
}

.card-frame {
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, #60a5fa, #2563eb, #6366f1) border-box;
  border: 2px solid transparent;
  border-radius: 22px;
  padding: 12px;
  display: flex;
  justify-content: center;
}

#share-card {
  width: 100%;
  max-width: 360px;
  height: auto;
  border-radius: 14px;
  display: block;
}

.share-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.is-hidden {
  display: none;
}

.site-footer {
  padding: 0 0 48px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 860px) {
  .layout,
  .grid-2,
  .share-actions,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .site-header {
    padding-top: 28px;
  }

  .stat-value {
    font-size: 24px;
  }
}
