:root {
  --bg: #f4eef6;
  --surface: #fffdfe;
  --ink: #2c1830;
  --muted: #76647d;
  --line: #e9deeb;
  --accent: #8c2f78;
  --accent-strong: #6e1f5d;
  --accent-soft: #f4e3ef;
  --accent-softer: #faf1f7;
  --shadow: 0 24px 60px -30px rgba(83, 28, 70, 0.35);
  --radius: 26px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #fbe3f1 0%, transparent 60%),
    radial-gradient(900px 500px at 100% 0%, #e9dcf6 0%, transparent 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font-family: inherit;
}

:where(button, input, summary):focus-visible {
  outline: 3px solid rgba(140, 47, 120, 0.35);
  outline-offset: 2px;
}

.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;
}

.app {
  width: min(1120px, 100% - 32px);
  margin-inline: auto;
  padding: clamp(24px, 5vw, 56px) 0 40px;
}

/* Header */

.header {
  margin-bottom: clamp(24px, 4vw, 40px);
}

.header__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.profile {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  max-width: 100%;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.profile__avatar {
  width: 144px;
  height: 144px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--accent-soft);
  object-fit: cover;
  box-shadow: 0 14px 34px -14px rgba(83, 28, 70, 0.5);
}

.profile__name {
  font-size: clamp(2.75rem, 6vw, 3.25rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.045em;
}

.profile:hover .profile__name {
  color: var(--accent);
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px 6px 8px;
  border: 1px solid rgba(140, 47, 120, 0.15);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}

.brand:hover {
  background: #fff;
  border-color: rgba(140, 47, 120, 0.35);
  transform: translateY(-1px);
}

.brand svg {
  width: 16px;
  height: 16px;
}

.brand--instagram {
  gap: 12px;
  padding: 12px 18px 12px 14px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 26px -18px rgba(83, 28, 70, 0.45);
}

.brand--instagram svg {
  flex: none;
  width: 32px;
  height: 32px;
}

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand__title {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.1;
}

.brand__sub {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.3;
}

.brand--instagram:hover .brand__sub {
  color: var(--accent);
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

h1 .arrow {
  color: var(--accent);
  font-weight: 400;
}

.lede {
  margin: 14px 0 0;
  max-width: 580px;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.08rem);
  line-height: 1.6;
}

/* Tabs */

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  width: min(100%, 460px);
  margin-bottom: 20px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
}

.tab {
  padding: 10px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: clamp(0.74rem, 2.5vw, 0.84rem);
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}

.tab:hover {
  color: var(--ink);
}

.tab.is-active {
  background: linear-gradient(135deg, var(--accent), #b04b98);
  color: #fff;
  box-shadow: 0 8px 18px -10px rgba(110, 31, 93, 0.6);
}

[role="tabpanel"][hidden] {
  display: none;
}

.offlabel-note {
  margin: 0 0 18px;
  padding: 12px 16px;
  border: 1px solid #ecd7a8;
  border-radius: 14px;
  background: #fff9eb;
  color: #6b5320;
  font-size: 0.8rem;
  line-height: 1.55;
}

.offlabel-note strong {
  color: #4a3407;
}

.golden-note {
  margin: 0 0 12px;
  padding: 14px 16px;
  border: 1px solid #f0c9cf;
  border-radius: 14px;
  background: #fff3f4;
  color: #6b2b35;
  font-size: 0.8rem;
  line-height: 1.55;
}

.golden-note strong {
  color: #8c1d2c;
}

/* Layout */

.calculator {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(16px, 2.5vw, 28px);
  align-items: start;
}

.panel {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.controls {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.7);
  padding: clamp(22px, 3.5vw, 36px);
}

.field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field + .field {
  margin-top: clamp(24px, 3.5vw, 34px);
}

legend {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 0;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.step {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 750;
}

/* Syringe toggle */

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 6px;
  border-radius: 18px;
  background: #f4eef5;
}

.segmented__option {
  display: grid;
  gap: 3px;
  padding: 13px 14px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.segmented__option:hover {
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
}

.segmented__option.is-active {
  background: #fff;
  border-color: rgba(140, 47, 120, 0.16);
  color: var(--ink);
  box-shadow: 0 8px 20px -12px rgba(83, 28, 70, 0.4);
}

.segmented__title {
  font-size: 1.06rem;
  font-weight: 750;
}

.segmented__option.is-active .segmented__title {
  color: var(--accent);
}

.segmented__hint {
  font-size: 0.78rem;
  color: var(--muted);
}

/* Pen sizes */

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

.chip {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  padding: 14px 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.chip:hover {
  background: var(--accent-softer);
  border-color: rgba(140, 47, 120, 0.35);
  transform: translateY(-1px);
}

.chip.is-active {
  background: linear-gradient(135deg, var(--accent), #b04b98);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 12px 24px -12px rgba(110, 31, 93, 0.65);
}

.chip__value {
  font-size: 1.1rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.chip__unit {
  font-size: 0.78rem;
  opacity: 0.68;
}

.chip.is-active .chip__unit {
  opacity: 0.85;
}

/* Dose */

.dose {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid rgba(140, 47, 120, 0.09);
  border-radius: 18px;
  background: var(--accent-softer);
}

.stepper {
  flex: none;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--accent);
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.12s ease;
}

.stepper:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.stepper:active:not(:disabled) {
  transform: scale(0.94);
}

.stepper:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.dose__value {
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  font-weight: 780;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.slider {
  width: 100%;
  height: 28px;
  margin: 16px 0 4px;
  accent-color: var(--accent);
  cursor: pointer;
}

.scale {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

/* Result */

.result {
  position: sticky;
  top: 24px;
  overflow: hidden;
  isolation: isolate;
  padding: clamp(24px, 3.5vw, 36px);
  color: #fff;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(255, 157, 211, 0.28) 0%, transparent 55%),
    linear-gradient(155deg, #3a1333 0%, #641e55 55%, #8c2f78 100%);
}

.result::before {
  content: "";
  position: absolute;
  inset: auto -60px -110px auto;
  z-index: -1;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}

.result::after {
  content: "";
  position: absolute;
  top: -80px;
  right: -60px;
  z-index: -1;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
}

.result__context {
  margin: 0;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.72);
}

.result-gate {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.result-gate[hidden],
.result__content[hidden] {
  display: none;
}

.result__content:focus {
  outline: none;
}

.result-gate__eyebrow {
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.result-gate__title {
  margin: 0;
  color: #fff;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.result-gate p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.88rem;
  line-height: 1.6;
}

.result-gate__button {
  margin-top: 6px;
  padding: 12px 18px;
  border: 0;
  border-radius: 12px;
  background: #fff;
  color: var(--accent-strong);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    background 0.18s ease;
}

.result-gate__button:hover {
  background: #fff4fa;
  transform: translateY(-1px);
}

.result-gate__button:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.5);
  outline-offset: 3px;
}

.result-gate__link {
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  text-underline-offset: 2px;
}

.result__units {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin: 6px 0 0;
  font-size: clamp(3.2rem, 7vw, 4.6rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.055em;
  font-variant-numeric: tabular-nums;
}

.result__unit {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  font-weight: 500;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.75);
}

.result__syringe {
  margin: 8px 0 0;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.85);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1px;
  margin: 24px 0 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.14);
}

.metrics--single {
  grid-template-columns: 1fr;
  width: 50%;
}

.metric {
  padding: 12px 14px;
  background: rgba(58, 19, 51, 0.28);
}

.metric dt {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.metric dd {
  margin: 4px 0 0;
  font-size: 1rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

/* Syringe illustration */

.syringe-illustration {
  position: relative;
  margin-top: 20px;
  overflow: hidden;
  border-radius: 14px;
  cursor: zoom-in;
}

.syringe-illustration svg {
  display: block;
  width: 100%;
  height: auto;
  transform-origin: 50% 50%;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

@media (hover: hover) {
  .syringe-illustration:hover svg {
    transform: scale(2.2);
  }
}

.zoom-hint {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.72rem;
  line-height: 1.5;
}

@media (hover: none) {
  .zoom-hint {
    display: none;
  }
}

.needle {
  stroke: #dfd5e3;
  stroke-width: 2.5;
  stroke-linecap: round;
}

.hub {
  fill: #bdb2c4;
}

.barrel {
  fill: rgba(255, 255, 255, 0.1);
  stroke: rgba(255, 255, 255, 0.5);
  stroke-width: 2;
}

.plunger {
  fill: #f3e7f1;
}

.scale-pointer {
  fill: #fff;
  stroke: rgba(58, 19, 51, 0.22);
  stroke-width: 0.5;
}

.rod {
  stroke: rgba(255, 255, 255, 0.32);
  stroke-width: 3;
  stroke-linecap: round;
}

.flange {
  fill: rgba(255, 255, 255, 0.65);
}

.scale-tick {
  stroke: rgba(255, 255, 255, 0.45);
  stroke-width: 1.2;
}

.scale-tick--minor {
  stroke: rgba(255, 255, 255, 0.3);
  stroke-width: 1;
}

.scale-tick--major {
  stroke: rgba(255, 255, 255, 0.6);
  stroke-width: 1.4;
}

.scale-label {
  fill: rgba(255, 255, 255, 0.7);
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Click gauge */

.click-gauge {
  margin-top: 24px;
}

.click-gauge__bar {
  position: relative;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.click-gauge__fill {
  height: 100%;
  width: 50%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffb3dd, #d452ab);
  transition: width 0.15s ease;
}

.click-gauge__marker {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  border-radius: 2px;
  background: #fff;
  transform: translateX(-50%);
  transition: left 0.15s ease;
}

.click-gauge__labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.68rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.result__note {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.78rem;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}

/* Medical disclaimer */

.notice {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-top: clamp(20px, 3vw, 32px);
  padding: 18px 20px;
  border: 1px solid #ecd7a8;
  border-radius: 18px;
  background: #fff9eb;
  color: #5c4415;
  box-shadow: 0 12px 30px -24px rgba(92, 68, 21, 0.5);
}

.notice__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f0b429;
  color: #3d2a00;
  font-size: 0.95rem;
  font-weight: 800;
}

.notice h2 {
  margin: 2px 0 4px;
  color: #4a3407;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
}

.notice p {
  margin: 0;
  color: #6b5320;
  font-size: 0.84rem;
  line-height: 1.6;
}

.notice p + p {
  margin-top: 8px;
}

.notice strong {
  color: #4a3407;
}

.notice__link {
  color: #4a3407;
  font-weight: 700;
  text-underline-offset: 2px;
}

.credit {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.credit a {
  color: var(--accent);
  font-weight: 650;
  text-decoration: none;
}

.credit a:hover {
  text-decoration: underline;
}

.disclaimer {
  max-width: 780px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

.footer {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid rgba(140, 47, 120, 0.12);
}

.footer .credit {
  margin-top: 0;
}

.footer .disclaimer {
  margin-top: 8px;
}

.legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 0.8rem;
  font-weight: 650;
}

.legal a {
  color: var(--accent);
  text-decoration: none;
}

.legal a:hover {
  text-decoration: underline;
}

.legal span {
  color: var(--muted);
}

/* Legal pages */

.legal-page {
  width: min(900px, 100% - 32px);
}

.legal-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 24px;
}

.legal-page .profile {
  gap: 10px;
}

.legal-page .profile__avatar {
  width: 56px;
  height: 56px;
  border-width: 2px;
  box-shadow: 0 8px 20px -12px rgba(83, 28, 70, 0.4);
}

.legal-page .profile__name {
  font-size: 1.5rem;
  letter-spacing: -0.03em;
}

.legal-back {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 650;
  text-decoration: none;
}

.legal-back:hover {
  text-decoration: underline;
}

.legal-card {
  padding: clamp(22px, 4vw, 40px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.legal-card h1 {
  margin: 0 0 8px;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.legal-card h2 {
  margin: 28px 0 10px;
  font-size: 1.08rem;
  letter-spacing: -0.01em;
}

.legal-card p,
.legal-card li {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

.legal-card ul {
  margin: 0 0 12px;
  padding-left: 1.2rem;
}

.legal-card li + li {
  margin-top: 4px;
}

.legal-card a {
  color: var(--accent);
}

.legal-card strong {
  color: var(--ink);
}

.legal-meta {
  margin-bottom: 24px !important;
  color: var(--muted);
  font-size: 0.78rem !important;
}

.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  font-weight: 650;
}

.legal-nav a {
  color: var(--accent);
  text-decoration: none;
}

.legal-nav a:hover {
  text-decoration: underline;
}

/* Responsive */

@media (max-width: 860px) {
  .calculator {
    grid-template-columns: 1fr;
  }

  .result {
    position: static;
  }
}

@media (max-width: 480px) {
  .app {
    width: min(1120px, 100% - 20px);
  }

  .chips {
    gap: 8px;
  }

  .chip {
    padding: 12px 4px;
  }

  .metric {
    padding: 10px 9px;
  }

  .metric dt {
    font-size: 0.62rem;
    letter-spacing: 0.06em;
  }

  .metric dd {
    font-size: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
