.dose-app {
  --ink: #24313b;
  --muted: #65727d;
  --line: #dbe2e6;
  --soft: #f6f8f7;
  --panel: #ffffff;
  --teal: #126a6f;
  --teal-dark: #0b4d52;
  --coral: #c85d4f;
  --amber: #a86613;
  --green-soft: #e7f2ee;
  --amber-soft: #fff2df;
  --red-soft: #fde9e7;
  --shadow: 0 18px 45px rgba(36, 49, 59, 0.12);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  padding: 28px;
}

.dose-app,
.dose-app * {
  box-sizing: border-box;
}

.dose-app button,
.dose-app input {
  font: inherit;
}

.dose-app .app-shell {
  max-width: 1180px;
  margin: 0 auto;
}

.dose-app .intro {
  max-width: 720px;
  margin-bottom: 24px;
}

.dose-app .eyebrow {
  margin: 0 0 7px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.dose-app h1,
.dose-app h2,
.dose-app p {
  margin-top: 0;
}

.dose-app h1 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 5vw, 3.35rem);
  line-height: 1.04;
}

.dose-app h2 {
  margin-bottom: 10px;
  font-size: 1.25rem;
}

.dose-app .lede {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.dose-app .workspace {
  display: grid;
  grid-template-columns: minmax(330px, 0.9fr) minmax(360px, 1.1fr);
  gap: 20px;
  align-items: start;
}

.dose-app .calculator,
.dose-app .result-panel,
.dose-app .safety {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.dose-app .calculator {
  padding: 22px;
}

.dose-app .form-section {
  margin: 0 0 20px;
  padding: 0;
  border: 0;
}

.dose-app .section-title {
  margin-bottom: 12px;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.25;
}

.dose-app .field-grid {
  display: grid;
  gap: 16px;
}

.dose-app .field {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.dose-app .field input {
  width: 100%;
  max-width: none;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fbfcfc;
  appearance: textfield;
}

.dose-app .field input::-webkit-outer-spin-button,
.dose-app .field input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.dose-app .field input:focus {
  border-color: var(--teal);
  outline: 3px solid rgba(18, 106, 111, 0.16);
}

.dose-app .age-row {
  display: grid;
  grid-template-columns: minmax(72px, 0.8fr) auto minmax(72px, 0.8fr) auto;
  gap: 8px;
  align-items: center;
}

.dose-app .input-with-unit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.dose-app .unit {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.dose-app .medicine-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.dose-app .medicine-toggle label {
  cursor: pointer;
}

.dose-app .medicine-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.dose-app .medicine-toggle span {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}

.dose-app .medicine-toggle input:checked + span {
  border-color: var(--teal);
  background: var(--green-soft);
  color: var(--teal-dark);
}

.dose-app .actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.dose-app .primary-button,
.dose-app .ghost-button {
  min-height: 48px;
  border-radius: 6px;
  padding: 11px 16px;
  font-weight: 800;
  cursor: pointer;
  appearance: none;
  box-shadow: none;
}

.dose-app .primary-button {
  border: 1px solid var(--teal);
  background: var(--teal);
  color: white;
}

.dose-app .primary-button:hover {
  background: var(--teal-dark);
}

.dose-app .ghost-button {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

.dose-app .result-panel {
  min-height: 360px;
  overflow: hidden;
}

.dose-app .result-header {
  border-bottom: 1px solid var(--line);
  padding: 20px 22px 14px;
  background: var(--soft);
}

.dose-app .result-content {
  display: grid;
  gap: 14px;
  padding: 20px 22px 22px;
}

.dose-app .empty {
  color: var(--muted);
  line-height: 1.55;
}

.dose-app .dose-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.dose-app .dose-card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.dose-app .presentation {
  display: inline-flex;
  margin: 0 0 12px;
  border-radius: 6px;
  background: var(--green-soft);
  padding: 7px 10px;
  color: var(--teal-dark);
  font-size: 1.08rem;
  font-weight: 900;
  line-height: 1.25;
}

.dose-app .dose-main {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: baseline;
  margin: 8px 0;
}

.dose-app .dose-number {
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--teal-dark);
}

.dose-app .dose-detail {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.dose-app .notice {
  border-radius: 8px;
  padding: 13px 14px;
  line-height: 1.48;
}

.dose-app .notice strong {
  display: block;
  margin-bottom: 3px;
}

.dose-app .notice.info {
  background: var(--green-soft);
  color: #184c46;
}

.dose-app .notice.warning {
  background: var(--amber-soft);
  color: #5f3b08;
}

.dose-app .notice.danger {
  background: var(--red-soft);
  color: #7b221c;
}

.dose-app .meta-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dose-app .meta-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  color: var(--muted);
}

.dose-app .meta-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.dose-app .meta-list strong {
  color: var(--ink);
  text-align: right;
}

.dose-app .safety {
  display: grid;
  grid-template-columns: minmax(240px, 0.85fr) minmax(0, 1.15fr);
  gap: 18px;
  margin-top: 20px;
  padding: 20px 22px;
}

.dose-app .safety p,
.dose-app .safety li {
  color: var(--muted);
  line-height: 1.55;
}

.dose-app .safety ul {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 20px;
}

@media (max-width: 820px) {
  .dose-app {
    padding: 18px;
  }

  .dose-app .workspace,
  .dose-app .safety {
    grid-template-columns: 1fr;
  }

  .dose-app .result-panel {
    min-height: 0;
  }
}

@media (max-width: 520px) {
  .dose-app {
    padding: 12px;
  }

  .dose-app .calculator,
  .dose-app .result-header,
  .dose-app .result-content,
  .dose-app .safety {
    padding-left: 16px;
    padding-right: 16px;
  }

  .dose-app .age-row,
  .dose-app .medicine-toggle {
    grid-template-columns: 1fr;
  }

  .dose-app .age-row .unit {
    margin-top: -4px;
  }

  .dose-app .actions {
    display: grid;
  }

  .dose-app .primary-button,
  .dose-app .ghost-button {
    width: 100%;
  }

  .dose-app .dose-number {
    font-size: 1.45rem;
  }

  .dose-app .meta-list li {
    display: grid;
  }

  .dose-app .meta-list strong {
    text-align: left;
  }
}
