:root {
  --bg: #0f1c24;
  --bg-2: #162a35;
  --card: #1a3340;
  --ink: #e8f1f4;
  --muted: #8aa3ae;
  --line: rgba(232, 241, 244, 0.12);
  --accent: #2bb0a6;
  --accent-2: #f0b429;
  --danger: #e85d4c;
  --ok: #3dcc91;
  --gluconex: #4ea8de;
  --radius: 16px;
  --font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(43, 176, 166, 0.18), transparent 60%),
    radial-gradient(700px 400px at 100% 0%, rgba(240, 180, 41, 0.1), transparent 55%),
    var(--bg);
}

body {
  padding: 1.25rem;
}

.wrap {
  max-width: 920px;
  margin: 0 auto;
}

header {
  margin-bottom: 1.25rem;
}

header h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.02em;
}

header p {
  margin: 0;
  color: var(--muted);
  max-width: 52ch;
  line-height: 1.45;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 0.78rem;
}

.panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent), var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}

.panel h2 {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}

.brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.6rem;
}

.brand-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--ink);
  border-radius: 12px;
  padding: 0.75rem 0.65rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}

.brand-btn:hover {
  border-color: rgba(43, 176, 166, 0.55);
  transform: translateY(-1px);
}

.brand-btn.active {
  border-color: var(--accent);
  background: rgba(43, 176, 166, 0.14);
  box-shadow: inset 0 0 0 1px rgba(43, 176, 166, 0.35);
}

.brand-btn.danger-ish.active {
  border-color: var(--gluconex);
  background: rgba(78, 168, 222, 0.16);
  box-shadow: inset 0 0 0 1px rgba(78, 168, 222, 0.4);
}

.brand-btn .name {
  display: block;
  font-weight: 700;
  font-size: 0.98rem;
}

.brand-btn .meta {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.3;
}

.brand-btn .tag {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.brand-btn .tag.warn {
  color: var(--danger);
}

.row {
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 720px) {
  .row.two {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.dose-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--ink);
  border-radius: 10px;
  padding: 0.7rem 0.4rem;
  font-weight: 700;
  cursor: pointer;
}

.chip.active {
  border-color: var(--accent);
  background: rgba(43, 176, 166, 0.16);
}

.field {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.75rem;
}

.field label {
  font-size: 0.8rem;
  color: var(--muted);
}

.field input,
.field select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  padding: 0.7rem 0.8rem;
  font-size: 1rem;
}

.field input:focus,
.field select:focus {
  outline: 2px solid rgba(43, 176, 166, 0.45);
  border-color: var(--accent);
}

.result {
  text-align: center;
}

.result .units {
  font-size: clamp(2.4rem, 8vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0.4rem 0;
}

.result .units span {
  font-size: 0.45em;
  font-weight: 700;
  color: var(--accent);
  vertical-align: middle;
  margin-left: 0.15em;
}

.result .sub {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.meter {
  position: relative;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  margin: 1rem 0 0.4rem;
}

.meter > i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), #5be0d4);
  border-radius: inherit;
  transition: width 0.25s ease;
}

.meter.warn > i {
  background: linear-gradient(90deg, var(--accent-2), #ffd56a);
}

.meter.bad > i {
  background: linear-gradient(90deg, var(--danger), #ff8d7d);
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.55rem;
  margin-top: 0.9rem;
  text-align: left;
}

.stat {
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
}

.stat .k {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat .v {
  display: block;
  margin-top: 0.15rem;
  font-weight: 700;
  font-size: 0.98rem;
}

.alert {
  margin-top: 0.85rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  text-align: left;
  font-size: 0.86rem;
  line-height: 1.4;
}

.alert.error {
  background: rgba(232, 93, 76, 0.14);
  border: 1px solid rgba(232, 93, 76, 0.45);
  color: #ffc4bc;
}

.alert.warn {
  background: rgba(240, 180, 41, 0.12);
  border: 1px solid rgba(240, 180, 41, 0.4);
  color: #ffe3a0;
}

.alert + .alert {
  margin-top: 0.5rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th,
td {
  padding: 0.55rem 0.45rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td.num {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.note {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.disclaimer {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
  border: 1px dashed rgba(232, 93, 76, 0.45);
  background: rgba(232, 93, 76, 0.08);
  color: #ffd0c8;
  font-size: 0.82rem;
  line-height: 1.45;
}

footer {
  margin: 1.25rem 0 0.5rem;
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
}

.hidden {
  display: none !important;
}

.syringe-panel .syringe-caption {
  margin: -0.35rem 0 0.85rem;
  text-align: left;
}

.syringe-stage {
  position: relative;
  border-radius: 14px;
  background: linear-gradient(180deg, #f7fafc, #e8eef3);
  border: 1px solid rgba(15, 28, 36, 0.12);
  padding: 0.85rem 0.65rem 0.5rem;
  overflow: hidden;
}

.syringe-svg {
  width: 100%;
  height: auto;
  display: block;
  max-height: 280px;
}

.syringe-svg #liquidFill,
.syringe-svg #liquidShine,
.syringe-svg #plungerGroup,
.syringe-svg #doseMarker {
  transition: all 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.syringe-stage.is-overflow {
  border-color: rgba(232, 93, 76, 0.55);
  box-shadow: inset 0 0 0 1px rgba(232, 93, 76, 0.15), 0 0 24px rgba(232, 93, 76, 0.12);
  animation: syringePulse 1.1s ease-in-out infinite;
}

.syringe-stage.is-warn {
  border-color: rgba(240, 180, 41, 0.55);
}

@keyframes syringePulse {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(232, 93, 76, 0.15), 0 0 16px rgba(232, 93, 76, 0.08); }
  50% { box-shadow: inset 0 0 0 1px rgba(232, 93, 76, 0.3), 0 0 28px rgba(232, 93, 76, 0.18); }
}

.syringe-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.syringe-meta .badge {
  background: rgba(43, 176, 166, 0.1);
  border-color: rgba(43, 176, 166, 0.3);
  color: var(--ink);
}

.syringe-meta .badge.bad {
  background: rgba(232, 93, 76, 0.14);
  border-color: rgba(232, 93, 76, 0.45);
  color: #ffc4bc;
}

.syringe-meta .badge.warn {
  background: rgba(240, 180, 41, 0.12);
  border-color: rgba(240, 180, 41, 0.4);
  color: #ffe3a0;
}

#syringeOverflow {
  margin-top: 0.75rem;
}

.syringe-ruler {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.65rem;
  font-variant-numeric: tabular-nums;
}

.syringe-ruler-row {
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: end;
  gap: 0.4rem;
}

.syringe-ruler-row span.label {
  color: #5b6b76;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: right;
  padding-bottom: 2px;
}

.syringe-ruler-track {
  position: relative;
  height: 28px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid #c5d0da;
  overflow: hidden;
}

.syringe-ruler-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, #7ec8ff, #4aa3e8);
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.syringe-ruler-fill.warn {
  background: linear-gradient(90deg, #ffd56a, #f0b429);
}

.syringe-ruler-fill.bad {
  background: linear-gradient(90deg, #ff8d7d, #e85d4c);
}

.syringe-ruler-marks {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 2px;
  pointer-events: none;
}

.syringe-ruler-marks i {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  width: 0;
  color: #1a2330;
  font-size: 0.62rem;
  font-weight: 800;
  font-style: normal;
}

.syringe-ruler-marks i::before {
  content: "";
  width: 1px;
  height: 10px;
  background: #1a2330;
  margin-bottom: 2px;
}

.syringe-ruler-marks i.major::before {
  height: 16px;
  width: 2px;
}

