:root {
  --tone-green: #155742;
  --tone-green-bg: #eaf4ed;
  --tone-green-line: #abc8b6;
  --tone-amber: #644814;
  --tone-amber-bg: #fff5df;
  --tone-amber-line: #d8bc7f;
  --tone-red: #892d2c;
  --tone-red-bg: #fbefeb;
  --tone-red-line: #daa9a1;
}

[data-tone="success"] { --state-ink: var(--tone-green); --state-bg: var(--tone-green-bg); --state-line: var(--tone-green-line); }
[data-tone="caution"] { --state-ink: var(--tone-amber); --state-bg: var(--tone-amber-bg); --state-line: var(--tone-amber-line); }
[data-tone="urgent"] { --state-ink: var(--tone-red); --state-bg: var(--tone-red-bg); --state-line: var(--tone-red-line); }
.hub-status[role="alert"], .inline-status[role="alert"], .field-error { color: var(--tone-red); }
.inline-status[role="alert"]:not(:empty) { background: var(--tone-red-bg); }
.inline-status[data-tone="success"]:not(:empty), .hub-status[data-tone="success"] { color: var(--state-ink); background: var(--state-bg); }
.inline-status[data-tone="caution"]:not(:empty) { color: var(--state-ink); background: var(--state-bg); }
.inline-status[data-tone="pending"]:not(:empty) { color: var(--muted); background: #eef1ef; }

/* The supplied transparent PNGs have a square canvas around the wordmark. */
.brand-image { width: 130px; aspect-ratio: 881 / 245; display: block; position: relative; overflow: hidden; }
.mast .wordmark .brand-image img, .footer-brand .brand-image img {
  position: absolute; inset: 0 auto auto 0; width: 113.51%; max-width: none; height: auto;
  display: block; transform: translate(-6%, -36.4%); mix-blend-mode: normal;
}
.footer-brand .brand-image { width: 108px; }
.footer-brand { justify-self: start; }

.content-shell:has(.medicine-result) { max-width: 940px; }
.content-shell:has(.medicine-result) > .back { margin-block-end: 1.05rem; }
.medicine-privacy { margin-block: .65rem; color: var(--muted); font-size: var(--type-caption); }
.result-status {
  display: grid; grid-template-columns: minmax(0,1fr) minmax(150px,200px);
  gap: clamp(1rem,4vw,2.75rem); align-items: start;
  border-block-end: 1px solid var(--line); padding-block-end: clamp(1.25rem,3vw,2rem);
}
.result-status h1 { color: var(--ink); margin: 0 0 .45rem; font-size: var(--type-result); letter-spacing: -.048em; line-height: 1.08; }
.result-status h1[tabindex="-1"]:focus { outline: 0; }
.result-note { color: var(--state-ink); line-height: 1.5; max-width: 60ch; }
.result-note p { margin: 0; }
.result-note:has(#result-explanation:empty) { border: 0; }
.result-note ul { margin: .5rem 0 0; padding-inline-start: 1.1rem; }
.result-destination { display: grid; gap: .35rem; min-width: 0; margin: 0; font-size: var(--type-meta); color: var(--muted); }
.result-destination select { width: 100%; min-height: 44px; font-size: max(var(--type-body), 16px); padding: .45rem .75rem; border-radius: 4px; }
.medicine-compare { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); border-block-end: 1px solid var(--line); }
.medicine-name { display: grid; align-content: start; gap: .38rem; min-width: 0; padding-block: clamp(1.15rem,3vw,1.85rem); }
.content-shell .destination-name .destination-verdict { color: var(--tone-amber); }
#local-names { min-width: 0; margin: .25rem 0 .8rem; }
#local-names summary { color: var(--green); cursor: pointer; font-weight: 600; padding-block: .6rem; }
#local-names .catalogue-results { margin: .2rem 0 .35rem; }
#local-names .catalogue-results li { border-block-start:0; }
@media(min-width: 680px) {
  #local-names .catalogue-results { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:2rem; }
}
@media(max-width: 620px) {
  .medicine-compare.unconfirmed { grid-template-columns: minmax(0,1fr); }
}
.medicine-name:first-child { padding-inline-end: clamp(.8rem,3vw,1.8rem); }
.medicine-name + .medicine-name { border-inline-start: 1px solid var(--line); padding-inline-start: clamp(.8rem,3vw,1.8rem); }
.medicine-role { color: var(--muted); font-size: var(--type-meta); font-weight: 600; line-height: 1.3; }
.result-country { display: flex; align-items: center; gap: .4rem; font-size: var(--type-meta); overflow-wrap: anywhere; }
.result-country img { display: block; width: 18px; height: auto; aspect-ratio: 4/3; object-fit: cover; flex: none; }
.content-shell .medicine-name h2 { margin: .15rem 0 0; font-size: var(--type-card); line-height: 1.18; letter-spacing: -.03em; overflow-wrap: anywhere; }
.medicine-specialist { margin-block: .8rem; padding: .7rem .9rem; border-radius:var(--radius); background:var(--tone-amber-bg); color: var(--tone-amber); }
.medicine-actions { margin-block: .9rem 1.6rem; column-gap: 1.05rem; }
.medicine-actions :is(a,button), .result-next .actions a { min-height: 44px; }
.medicine-actions :is(a,button), .result-next .actions a { align-content: center; }
.medicine-actions #save { display: inline-flex; align-items: center; gap: .4rem; }
.medicine-actions [hidden] { display: none; }
.medicine-specs, .result-next, .medicine-references { margin-block: 1.7rem; }
.content-shell :is(.medicine-specs,.result-next,.medicine-references) h2 { margin: 0 0 .65rem; }
.result-next, .medicine-references { border-block-start: 1px solid var(--line); padding-block-start: .95rem; }
.result-next p { max-width: 60ch; line-height: 1.48; }
.medicine-facts { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: var(--type-body); text-align: start; }
.medicine-facts :is(th,td) { border-block-end: 1px solid var(--line); padding: .64rem .65rem; text-align: start; vertical-align: middle; line-height: 1.4; overflow-wrap: anywhere; }
.medicine-facts :is(th:first-child,td:first-child) { width: 27%; padding-inline-start: 0; }
.medicine-facts tbody th { font-size: var(--type-meta); font-weight: 600; color: var(--muted); }
.medicine-original { display: grid; grid-template-columns: minmax(100px,1fr) minmax(0,2fr); margin: 0; }
.medicine-original :is(dt,dd) { margin: 0; padding: .62rem .4rem .62rem 0; border-block-end: 1px solid var(--line); overflow-wrap: anywhere; }
.medicine-original dt { color: var(--muted); }
.medicine-references .sources { display: grid; gap: .45rem; margin: 0; }
.medicine-references a { justify-self: start; overflow-wrap: anywhere; }
.medicine-references .sources > :empty { display: none; }
.medicine-more { padding-block: .75rem; border-top: 1px solid var(--line); }
.medicine-more summary { font-weight: 600; cursor: pointer; min-height: 32px; }
.medicine-more .sources, .sheet-sources { margin-block: .65rem; }

.country-help { margin-block: 1.5rem 2rem; scroll-margin-top: 5rem; }
.country-help-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%, 225px),1fr)); gap: .75rem; }
.country-help-item { border: 1px solid var(--state-line, var(--line)); border-radius: 12px; padding: .9rem 1rem; background: var(--state-bg,#fff); color: var(--state-ink,var(--ink)); }
.country-help-item h3 { font-size: var(--type-subheading); line-height: 1.3; margin: 0 0 .55rem; font-weight: 600; }
.country-help-item p { margin: 0 0 .4rem; font-size: var(--type-body); }
.help-number { display: inline-block; font-size: var(--type-card); line-height: 1.15; font-weight: 600; margin-bottom: .45rem; }
.help-contact, .help-source { display: block; padding-block: .27rem; line-height: 1.35; overflow-wrap: anywhere; }
.help-source { font-size: var(--type-meta); }
.country-help-item small { color: var(--muted); }

.emergency-page { max-width: 900px; }
.emergency-call { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: .85rem; border-radius: 15px; border: 1px solid var(--state-line); color: var(--state-ink); background: var(--state-bg); padding: clamp(.82rem,3vw,1.55rem); }
.emergency-call h2 { color: inherit; margin: 0 0 .28rem; }
.emergency-call p { line-height: 1.4; }
.emergency-tel { display: inline-flex; align-items: center; gap: .45rem; min-height: 48px; padding: .55rem .8rem; background: var(--tone-red); color: #fff; text-decoration: none; border-radius: 10px; font-size: var(--type-card); }
.emergency-tel:visited, .emergency-tel:focus-visible, .emergency-tel:hover { color: white; }
.emergency-tel:hover { background: #702424; }
.emergency-tel .icon { width: 1.2rem; height: 1.2rem; }
.emergency-instructions { margin-block: .7rem 1.2rem; }
.emergency-location { display: grid; gap: .45rem; max-width: 420px; }
.emergency-location label { font-weight: 600; }
.emergency-location p, .emergency-source { color: var(--muted); font-size: var(--type-meta); }
.emergency-page .country-help { margin-block-start: 1rem; }

@media(max-width: 767px), (max-width: 1024px) and (max-height: 520px) and (pointer: coarse) {
  .mast .brand-image { width: 108px; }
  .result-status { grid-template-columns: minmax(0,1fr); gap: .9rem; }
  .result-destination { width: min(100%, 230px); }
  .medicine-actions > .primary { flex: 1 0 100%; justify-content: center; }
  .medicine-facts thead :is(th,td) { padding: .4rem .65rem; align-content: center; }
  .medicine-facts tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); border-block-end: 1px solid var(--line); }
  .medicine-facts thead td { display: none; }
  .medicine-facts :is(th,td) { border: 0; }
  .medicine-facts tbody th { width: auto; grid-column: 1/-1; padding: .55rem .65rem 0; }
  .medicine-facts tbody td { padding: .17rem .65rem .55rem; }
  .country-help-grid { grid-template-columns: 1fr; }
  .emergency-location select { font-size: max(var(--type-body), 16px); }
}

.sheet-export { margin-block: 1rem; }
.sheet-export [role=status] { flex-basis: 100%; color: var(--muted); }
.sheet-export [role=status]:empty { display: none; }
