.wb-tool {
  --wb-tool-ink: #17342f;
  --wb-tool-muted: #5c716d;
  --wb-tool-accent: #087f70;
  --wb-tool-accent-dark: #05685d;
  --wb-tool-border: #d6e7e1;
  --wb-tool-surface: #f3faf7;
  --wb-tool-white: #fff;
  box-sizing: border-box;
  width: 100%;
  max-width: 720px;
  margin: clamp(24px, 4vw, 40px) auto;
  overflow: hidden;
  color: var(--wb-tool-ink);
  background: var(--wb-tool-white);
  border: 1px solid var(--wb-tool-border);
  border-radius: 22px;
  box-shadow: 0 18px 48px rgba(31, 72, 64, .1);
  font-family: inherit;
  text-align: left;
}

.wb-tool *, .wb-tool *::before, .wb-tool *::after { box-sizing: border-box; }
.wb-tool__header { padding: clamp(24px, 5vw, 38px); background: radial-gradient(circle at 92% 8%, rgba(91, 189, 165, .2), transparent 34%), linear-gradient(145deg, #eef9f5 0%, #f8fcfa 100%); border-bottom: 1px solid var(--wb-tool-border); }
.wb-tool__eyebrow { display: inline-flex; align-items: center; min-height: 28px; margin-bottom: 12px; padding: 4px 11px; color: var(--wb-tool-accent-dark); background: #ddf2eb; border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: .06em; line-height: 1.2; text-transform: uppercase; }
.wb-tool__title { margin: 0; color: var(--wb-tool-ink); font-size: clamp(25px, 5vw, 34px); font-weight: 800; letter-spacing: -.025em; line-height: 1.08; }
.wb-tool__intro { max-width: 600px; margin: 14px 0 0; color: var(--wb-tool-muted); font-size: 16px; line-height: 1.55; }
.wb-tool__form, .wb-tool__result { padding: clamp(24px, 5vw, 38px); }

.wb-fat-choice { min-width: 0; margin: 0 0 20px; padding: 0; border: 0; }
.wb-fat-choice legend { margin: 0 0 9px; padding: 0; color: var(--wb-tool-ink); font-size: 14px; font-weight: 800; line-height: 1.35; }
.wb-fat-segmented { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 5px; background: #e9f3ef; border: 1px solid var(--wb-tool-border); border-radius: 14px; }
.wb-fat-segmented input { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.wb-fat-segmented label { display: flex; align-items: center; justify-content: center; min-height: 44px; margin: 0; padding: 9px 12px; color: var(--wb-tool-muted); border: 1px solid transparent; border-radius: 10px; font-size: 14px; font-weight: 750; line-height: 1.3; text-align: center; cursor: pointer; }
.wb-fat-segmented input:checked + label { color: var(--wb-tool-accent-dark); background: #fff; border-color: #b8cec7; box-shadow: 0 4px 12px rgba(31, 72, 64, .08); }
.wb-fat-segmented input:focus-visible + label { outline: 3px solid rgba(8, 127, 112, .25); outline-offset: 2px; }
.wb-fat-choice__note { margin: 9px 2px 0; color: var(--wb-tool-muted); font-size: 12px; line-height: 1.5; }

.wb-fat-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 24px; }
.wb-tool__field label { display: block; margin: 0 0 7px; color: var(--wb-tool-ink); font-size: 14px; font-weight: 800; line-height: 1.3; }
.wb-tool__input-wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; height: 54px; min-height: 54px; overflow: hidden; background: #fff; border: 1px solid #b8cec7; border-radius: 12px; transition: border-color 160ms ease, box-shadow 160ms ease; }
.wb-tool__input-wrap:focus-within { border-color: var(--wb-tool-accent); box-shadow: 0 0 0 3px rgba(8, 127, 112, .14); }
section.wb-tool.wb-tool--fat .wb-tool__input-wrap > input { display: block !important; width: 100% !important; min-width: 0 !important; min-height: 0 !important; height: 52px !important; margin: 0 !important; padding: 0 14px !important; color: var(--wb-tool-ink) !important; background: transparent !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; font: inherit !important; font-size: 18px !important; font-weight: 750 !important; line-height: normal !important; outline: 0 !important; appearance: none; }
.wb-tool__unit { display: flex; align-items: center; padding: 0 16px 0 8px; color: var(--wb-tool-muted); font-size: 14px; font-weight: 700; }
.wb-tool__field.is-invalid .wb-tool__input-wrap { border-color: #c85d65; box-shadow: 0 0 0 3px rgba(200, 93, 101, .12); }

.wb-tool__error { margin: 16px 0 0; padding: 11px 13px; color: #842029; background: #fff1f2; border: 1px solid #f1c4c8; border-radius: 10px; font-size: 14px; line-height: 1.45; }
.wb-tool__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.wb-tool .wb-tool__button { min-height: 48px; margin: 0; padding: 11px 20px; border: 1px solid transparent; border-radius: 12px; box-shadow: none; font: inherit; font-size: 15px; font-weight: 800; line-height: 1.3; text-transform: none; cursor: pointer; transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease; }
.wb-tool .wb-tool__button:focus-visible { outline: 3px solid rgba(8, 127, 112, .25); outline-offset: 2px; }
.wb-tool .wb-tool__button--primary { color: #fff; background: var(--wb-tool-accent); }
.wb-tool .wb-tool__button--primary:hover { color: #fff; background: var(--wb-tool-accent-dark); transform: translateY(-1px); }
.wb-tool .wb-tool__button--secondary { color: var(--wb-tool-ink); background: #fff; border-color: #b8cec7; }
.wb-tool .wb-tool__button--secondary:hover { color: var(--wb-tool-ink); background: var(--wb-tool-surface); border-color: #8eaaa2; }

.wb-tool__result { padding-top: 0; }
.wb-fat-result-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; background: var(--wb-tool-surface); border: 1px solid var(--wb-tool-border); border-radius: 16px; }
.wb-fat-result-summary > div { min-width: 0; padding: 20px; border-right: 1px solid var(--wb-tool-border); }
.wb-fat-result-summary > div:last-child { border-right: 0; }
.wb-fat-result-summary > div > span { display: block; margin-bottom: 6px; color: var(--wb-tool-muted); font-size: 12px; font-weight: 750; }
.wb-fat-result-summary strong { display: block; color: var(--wb-tool-ink); font-size: clamp(23px, 5vw, 34px); font-weight: 850; letter-spacing: -.03em; line-height: 1.1; }
.wb-fat-result-summary strong small { display: inline; margin-left: 2px; color: inherit; font-size: .55em; }
.wb-fat-scale { margin-top: 24px; }
.wb-fat-scale__track { position: relative; display: grid; grid-template-columns: 13fr 4fr 8fr 35fr; height: 18px; margin: 18px 7px 0; overflow: visible; border-radius: 999px; }
.is-female .wb-fat-scale__track { grid-template-columns: 20fr 4fr 8fr 28fr; }
.wb-fat-scale__track > span:first-child { background: #8eced2; border-radius: 999px 0 0 999px; }
.wb-fat-scale__track > span:nth-child(2) { background: #8fcf9c; }
.wb-fat-scale__track > span:nth-child(3) { background: #f2c86f; }
.wb-fat-scale__track > span:nth-child(4) { background: #df8585; border-radius: 0 999px 999px 0; }
.wb-fat-scale__track i { position: absolute; top: 50%; width: 8px; height: 30px; background: var(--wb-tool-ink); border: 2px solid #fff; border-radius: 4px; box-shadow: 0 2px 6px rgba(0, 0, 0, .22); transform: translate(-50%, -50%); }
.wb-fat-scale__legend { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin-top: 10px; color: var(--wb-tool-muted); font-size: 10px; font-weight: 700; line-height: 1.25; text-align: center; }
.wb-fat-masses { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
.wb-fat-masses > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: #fff; border: 1px solid var(--wb-tool-border); border-radius: 11px; }
.wb-fat-masses span { color: var(--wb-tool-muted); font-size: 13px; font-weight: 700; }
.wb-fat-masses strong { color: var(--wb-tool-ink); font-size: 15px; white-space: nowrap; }
.wb-fat-disclaimer { margin: 16px 0 0; color: var(--wb-tool-muted); font-size: 12px; line-height: 1.5; }
.wb-tool [hidden] { display: none !important; }

@media (max-width: 520px) {
  .wb-tool { border-radius: 18px; }
  .wb-fat-fields, .wb-fat-result-summary, .wb-fat-masses { grid-template-columns: 1fr; }
  .wb-fat-result-summary > div { border-right: 0; border-bottom: 1px solid var(--wb-tool-border); }
  .wb-fat-result-summary > div:last-child { border-bottom: 0; }
  .wb-tool__actions { display: grid; grid-template-columns: 1fr; }
  .wb-tool .wb-tool__button { width: 100%; }
  .wb-fat-scale__legend { gap: 3px; font-size: 9px; }
}

@media (max-width: 390px) {
  .wb-fat-segmented--method { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .wb-tool *, .wb-tool *::before, .wb-tool *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
