:root {
  --blue: #1a2a6c;
  --blue-2: #263b88;
  --green: #a5c422;
  --green-dark: #829d16;
  --bg: #f8fdf4;
  --surface: #fff;
  --ink: #1e293b;
  --soft: #64748b;
  --muted: #94a3b8;
  --line: #e2e8f0;
  --line-green: #dbe9b4;
  --warn: #9a6500;
  --warn-bg: #fff9e8;
  --danger: #b42318;
  --danger-bg: #fff2f0;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 0 0, rgba(165, 196, 34, .08), transparent 34rem),
    radial-gradient(circle at 100% 0, rgba(66, 103, 178, .07), transparent 34rem),
    var(--bg);
  font: 400 15px/1.55 "Poppins", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
.wrap { width: min(calc(100% - 36px), 1180px); margin-inline: auto; }

header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 72px;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid rgba(0, 0, 0, .05);
  backdrop-filter: blur(18px);
}
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--blue); text-decoration: none; }
.brand img { width: 45px; height: 47px; object-fit: contain; }
.brand span { display: flex; flex-direction: column; line-height: 1.1; }
.brand b { font-size: 16px; font-weight: 800; }
.brand small { margin-top: 5px; color: var(--green-dark); font-size: 9px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.back-link { padding: 9px 14px; color: #fff; background: var(--blue); border-radius: 99px; font-size: 11px; font-weight: 700; text-decoration: none; }
.back-link:hover { background: var(--green-dark); }

main { padding: 45px 0 70px; }
.intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; margin-bottom: 24px; }
.eyebrow { margin: 0 0 5px; color: var(--green-dark); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1 { margin: 0; color: var(--blue); font-size: clamp(32px, 5vw, 50px); line-height: 1.08; letter-spacing: -.04em; }
.intro>div>p:last-child { margin: 8px 0 0; color: var(--soft); }
.count { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: rgba(255, 255, 255, .7); border: 1px solid var(--line); border-radius: 15px; }
.count b { color: var(--green-dark); font-size: 27px; line-height: 1; }
.count span { color: var(--soft); font-size: 10px; line-height: 1.35; text-transform: uppercase; }
.disclaimer { margin-bottom: 18px; padding: 12px 16px; color: var(--warn); background: var(--warn-bg); border: 1px solid #efdca1; border-left: 4px solid #e5ae21; border-radius: 10px; font-size: 12px; }
.disclaimer b { color: #7c5100; }

.tool { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 24px 65px rgba(26, 42, 108, .1); }
.weight-bar { display: grid; grid-template-columns: 185px 1fr auto; align-items: end; gap: 22px; padding: 21px 24px; background: #f5f8ff; border-bottom: 1px solid var(--line); }
.weight-bar label>span, .field-label { display: block; margin-bottom: 6px; color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.weight-input { position: relative; }
.weight-input input { width: 100%; height: 49px; padding: 0 48px 0 13px; color: var(--blue); background: #fff; border: 1px solid #cbd5e1; border-radius: 10px; outline: none; font-size: 20px; font-weight: 700; }
.weight-input b { position: absolute; top: 50%; right: 14px; color: var(--muted); font-size: 12px; transform: translateY(-50%); }
input:focus, select:focus, button:focus-visible { outline: 3px solid rgba(165, 196, 34, .3); outline-offset: 1px; border-color: var(--green-dark); }
input[type="range"] { width: 100%; accent-color: var(--green); }
#reset { height: 42px; padding: 0 16px; color: var(--blue); background: #fff; border: 1px solid #cbd5e1; border-radius: 10px; font-size: 11px; font-weight: 700; cursor: pointer; }
#reset:hover { color: #fff; background: var(--blue); border-color: var(--blue); }

.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); }
.card { min-width: 0; background: #fff; }
.card:last-child:nth-child(odd) { grid-column: 1 / -1; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; color: var(--blue); background: #fbfcff; border-bottom: 1px solid var(--line); }
.card-head span { width: 28px; height: 28px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--green), #8eaa1b); border-radius: 8px; font-size: 14px; }
.card-head h2 { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.card-body { padding: 17px; }
select { width: 100%; height: 46px; padding: 0 42px 0 13px; color: var(--ink); background: #fff; border: 1px solid #cbd5e1; border-radius: 10px; outline: none; font-size: 13px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--soft) 50%), linear-gradient(135deg, var(--soft) 50%, transparent 50%); background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px; background-size: 5px 5px; background-repeat: no-repeat; }
.form-row { display: none; margin-top: 12px; }
.form-row.show { display: block; }
.empty { margin: 12px 0 0; color: var(--muted); font-size: 11px; }
.result { display: none; margin-top: 14px; }
.result.show { display: block; }
.dose-main { padding: 14px 15px; background: linear-gradient(135deg, #f7faec, #f3f8ff); border: 1px solid var(--line-green); border-left: 4px solid var(--green); border-radius: 10px; }
.label { color: var(--soft); font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.dose-main strong { display: block; margin-top: 3px; color: var(--blue); font-size: 23px; line-height: 1.2; }
.band { margin-top: 4px; color: var(--green-dark); font-size: 10px; font-weight: 600; }
.details { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.detail { padding: 10px 12px; background: #f8fafc; border: 1px solid var(--line); border-radius: 9px; }
.detail strong { display: block; margin-top: 2px; color: var(--blue); font-size: 14px; }
.volume { margin-top: 8px; padding: 10px 12px; color: var(--green-dark); background: #fbfdf4; border: 1px dashed var(--green); border-radius: 9px; }
.volume strong { display: block; margin-top: 2px; font-size: 13px; }
.notice { margin-top: 8px; padding: 9px 11px; border-radius: 8px; font-size: 10px; line-height: 1.55; }
.notice.info { color: #665413; background: #fffbea; border: 1px solid #efe0a2; }
.notice.stop { color: var(--danger); background: var(--danger-bg); border: 1px solid #f4bbb5; font-weight: 600; }
.notice.cap { color: var(--blue); background: #f2f5ff; border: 1px solid #cdd6f8; }
.source-line { margin-top: 10px; padding-top: 9px; color: var(--muted); border-top: 1px solid var(--line); font-size: 10px; }
.source-line a { color: var(--blue); font-weight: 700; text-decoration: none; }
.source-line a:hover { color: var(--green-dark); text-decoration: underline; }
.rows { display: flex; flex-direction: column; gap: 7px; }
.dose-row { padding: 10px 12px; background: #f8fafc; border: 1px solid var(--line); border-radius: 9px; }
.dose-row .row-label { color: var(--soft); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.dose-row .row-value { margin-top: 2px; color: var(--blue); font-size: 14px; font-weight: 800; }
.dose-row .row-sub { margin-top: 2px; color: var(--soft); font-size: 10px; }
.dose-row .ml { color: var(--green-dark); font-weight: 700; }
.dose-row.ci { color: var(--danger); background: var(--danger-bg); border-color: #f3bbb5; }
.dose-row.ci .row-value { color: var(--danger); font-size: 11px; }

footer { padding: 30px 0; color: #cad3ec; background: var(--blue); }
footer .wrap { display: flex; align-items: center; gap: 13px; }
footer img { width: 42px; height: 44px; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0,0,0,.15)); }
footer p { margin: 0; font-size: 10px; }
footer .sources { margin-left: auto; text-align: right; }

@media (max-width: 740px) {
  .wrap { width: min(calc(100% - 24px), 1180px); }
  .back-link { padding: 8px 10px; font-size: 9px; }
  .brand b { font-size: 13px; }
  main { padding-top: 30px; }
  .intro { align-items: flex-start; flex-direction: column; }
  .count { display: none; }
  .weight-bar { grid-template-columns: 1fr auto; gap: 14px; padding: 17px; }
  .weight-bar label { grid-column: 1 / -1; }
  .cards { grid-template-columns: 1fr; }
  .card:last-child:nth-child(odd) { grid-column: auto; }
  .card-body { padding: 14px; }
  footer .wrap { align-items: flex-start; flex-wrap: wrap; }
  footer .sources { width: 100%; margin-left: 55px; text-align: left; }
}

@media print {
  header, footer, .intro, .disclaimer, #reset, input[type="range"] { display: none !important; }
  body { background: #fff; }
  main { padding: 0; }
  .tool { border: 0; box-shadow: none; }
  .weight-bar { display: none; }
  .cards { grid-template-columns: 1fr 1fr; }
}
