/* Doseringstabeller. styles.css forces black text and transparent
 * backgrounds on `body *` with !important, so fills and muted colours here
 * need !important too. */

.dose-page {
  display: grid;
  gap: 0;
  width: min(1100px, 100%);
  margin: clamp(24px, 5vw, 56px) auto;
}

/* The shared kicker+h1 rule sizes this up to 64px; "Doseringstabeller" is
   one long word, so on phones size it to fit instead of breaking it. */
html body main.page .dose-page > .page-kicker + h1:not(#_):not(#__) { overflow-wrap: normal; font-size: clamp(24px, 8vw, 64px) !important; }

.dose-page > .page-lead { max-width: 60ch; margin: 0; font-size: clamp(16px, 1.6vw, 18px); line-height: 1.55; }
body.dosage-page .dose-page > .page-lead,
body.dosage-page .dose-footnote,
body.dosage-page .dose-list small,
body.dosage-page .dose-group h2 span,
body.dosage-page .dose-list thead th { color: #5d6b68 !important; -webkit-text-fill-color: #5d6b68 !important; }

.dose-calc-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  justify-self: start;
  margin-top: 16px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.dose-calc-link::after { content: " →"; }

/* Search, "only what we sell" and category chips. */
.dose-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 16px;
  margin: 28px 0 8px;
}
.dose-search { position: relative; display: block; }
.dose-search svg { position: absolute; top: 50%; left: 16px; transform: translateY(-50%); opacity: 0.55; pointer-events: none; }
.dose-search input {
  width: 100%;
  min-height: 48px;
  padding: 0 16px 0 46px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 999px;
  font: inherit;
}
body.dosage-page .dose-search input { background: #ffffff !important; }
.dose-search input:focus-visible { outline: 2px solid #2f6d64; outline-offset: 1px; }
.dose-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.dose-toggle input { width: 18px; height: 18px; accent-color: #2f6d64; }

.dose-chips { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.dose-chip {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 999px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
body.dosage-page .dose-chip { border-color: rgba(0, 0, 0, 0.14) !important; }
body.dosage-page .dose-chip:hover { border-color: #2f6d64 !important; }
body.dosage-page .dose-chip[aria-pressed="true"] {
  border-color: #0b1f2e !important;
  background: #0b1f2e !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
.dose-chip:focus-visible { outline: 2px solid #2f6d64; outline-offset: 2px; }

/* One table per category. */
.dose-group { margin-top: 28px; }
.dose-group h2 { display: flex; align-items: baseline; gap: 10px; margin: 0 0 10px; font-size: 20px; }
.dose-group h2 span { font-size: 14px; font-weight: 600; }

.dose-list {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 16px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  table-layout: fixed;
  font-size: 15px;
}
body.dosage-page .dose-list { background: #ffffff !important; }
.dose-list th,
.dose-list td { padding: 14px 16px; border-bottom: 1px solid rgba(0, 0, 0, 0.08); text-align: left; vertical-align: top; line-height: 1.4; }
.dose-list tbody tr:last-child > * { border-bottom: 0; }
.dose-list thead th { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
body.dosage-page .dose-list thead th { background: #f4f7f6 !important; }
body.dosage-page .dose-list tbody tr:hover > * { background: #f8faf9 !important; }
.dose-list thead th:nth-child(1) { width: 26%; }
.dose-list thead th:nth-child(2) { width: 18%; }
.dose-list thead th:nth-child(3) { width: 20%; }
.dose-list thead th:nth-child(4) { width: 16%; }
.dose-list small { display: block; margin-top: 2px; font-size: 13px; }
.dose-name { font-weight: 700; }
.dose-amount { white-space: nowrap; }

.dose-pill {
  display: inline-block;
  margin: 4px 0 0 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 16px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-decoration: none;
  vertical-align: 1px;
}
body.dosage-page .dose-pill { background: #e3f1ec !important; color: #1f5a50 !important; -webkit-text-fill-color: #1f5a50 !important; }
body.dosage-page .dose-pill:hover { background: #cfe7df !important; }

.dose-empty { margin: 28px 0 0; }
.dose-footnote { max-width: 70ch; margin: 28px 0 0; font-size: 13px; line-height: 1.55; }

/* Phones and narrow tablets: every row becomes a small card. */
@media (max-width: 760px) {
  .dose-tools { grid-template-columns: minmax(0, 1fr); }
  .dose-chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -12px; padding: 0 12px 4px; scrollbar-width: none; }
  .dose-chip { flex: none; }

  .dose-list,
  .dose-list tbody,
  .dose-list tr,
  .dose-list th,
  .dose-list td { display: block; width: auto; }
  .dose-list { border: 0; border-radius: 0; overflow: visible; }
  body.dosage-page .dose-list { background: transparent !important; }
  .dose-list thead { display: none; }
  .dose-list tbody { display: grid; gap: 10px; }
  .dose-list tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
    padding: 14px 16px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 16px;
  }
  body.dosage-page .dose-list tr { background: #ffffff !important; }
  body.dosage-page .dose-list tbody tr:hover > * { background: transparent !important; }
  .dose-list th,
  .dose-list td { padding: 0; border: 0; overflow-wrap: anywhere; }
  .dose-list th[scope="row"] { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 17px; }
  .dose-list th[scope="row"] .dose-pill { margin: 0; }
  .dose-list td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #5d6b68;
  }
  .dose-amount { font-size: 17px; }
}
