/* ==========================================================================
   Pediatric Dosage Calculator - front-end styles (v1.3.0, blue/pink brand)
   Palette from Pediatric People website branding:
     Logo Blue (bright):  #1FADEB   (used for chrome accents, progress, borders, focus halos)
     Brand-dark (deep):   #0E6B96   (5.0:1 on white — used where white text appears: buttons, key headings)
     Brand-tint:          #E7F6FD   (light blue — callout backgrounds, selected tile tint)
     Brand-tint-2:        #CFE9F6   (medium-light blue — subtle gradients, soft borders)
     Logo Pink (bright):  #EF24B7   (secondary accent — big dose number, hero highlights)
     Pink-dark:           #B5158A   (6.4:1 on white — alert text, in-brand warning copy)
     Pink-tint:           #FDE7F6   (light pink — alert backgrounds, blocked-card surfaces)
     Blue/Gray (muted):   #4D7399   (4.7:1 on white — secondary copy, hint text, footer)
     Text primary:        #1B2D3F   (~14:1 on white — body copy, default text)
     Border:              #CFE0EC   (light blue-gray neutral border)
     Success green:       #2B7A3D   (retained for any success indicators)
   All button + text combinations meet WCAG AA contrast. Min tap target: 48x48 px.
   ========================================================================== */

.pdc-wrap {
    /* Bright logo blue - used as the visual brand mark (top border, progress dots,
       selected tile outlines, focus halos). Too low contrast (~2.7:1) for white text,
       so anywhere we layer white type we use --pdc-brand-dark instead. */
    --pdc-brand: #1FADEB;
    /* Darker logo blue - passes AA (~5.0:1) for white text on solid background. */
    --pdc-brand-dark: #0E6B96;
    /* Very light blue surface tint for callouts and selected states. */
    --pdc-brand-tint: #E7F6FD;
    --pdc-brand-tint-2: #CFE9F6;
    /* Logo pink for high-emphasis accents (big dose number, key callouts). */
    --pdc-accent: #EF24B7;
    --pdc-accent-dark: #B5158A;
    --pdc-accent-tint: #FDE7F6;
    --pdc-border: #CFE0EC;
    --pdc-text: #1B2D3F;
    --pdc-muted: #4D7399;
    /* Alerts use the pink family so 'DO NOT GIVE' stays in-brand without
       slipping into red. AA contrast on white is ~6.4:1 for the dark variant. */
    --pdc-alert: #B5158A;
    --pdc-alert-bg: #FDE7F6;
    --pdc-ok: #2B7A3D;
    --pdc-tap: 48px;

    max-width: 760px;
    margin: 2em auto;
    padding: 1.25em 1.5em 1.5em;
    border: 1px solid var(--pdc-border);
    border-top: 6px solid var(--pdc-brand);
    border-radius: 12px;
    background: #fff;
    color: var(--pdc-text);
    /* Explicit root-ish font-size so our rem calcs are predictable regardless of theme. */
    font-size: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    box-sizing: border-box;
}
.pdc-wrap *, .pdc-wrap *::before, .pdc-wrap *::after { box-sizing: border-box; }

/* --- Header -------------------------------------------------- */
/* NOTE: these rules use tag.class selectors + !important because WP themes
   almost always style h2/h3 with font-size rules that would otherwise win. */
.pdc-wrap .pdc-header { margin-bottom: 1em !important; text-align: center !important; }
.pdc-wrap .pdc-header__brand {
    color: var(--pdc-brand) !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    font-size: clamp(0.62rem, 2.6vw, 0.78rem) !important;
    line-height: 1.3 !important;
    margin: 0 0 0.3em !important;
}
.pdc-wrap h2.pdc-header__title,
.pdc-wrap .pdc-header__title {
    display: block !important;
    margin: 0 0 0.2em !important;
    padding: 0 !important;
    color: var(--pdc-brand-dark) !important;
    font-size: clamp(0.9rem, 4.2vw, 1.3rem) !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    text-align: center !important;
    /* Wrap only at word boundaries - never mid-word, never with hyphens */
    hyphens: none !important;
    -webkit-hyphens: none !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    word-wrap: normal !important;
}
.pdc-wrap .pdc-header__subtitle {
    margin: 0 !important;
    padding: 0 !important;
    color: var(--pdc-muted) !important;
    font-size: clamp(0.75rem, 3vw, 0.9rem) !important;
    line-height: 1.35 !important;
    font-weight: 400 !important;
}

/* --- Progress indicator ------------------------------------- */
.pdc-progress {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    list-style: none;
    padding: 0;
    margin: 0 0 1.5em;
    position: relative;
    counter-reset: step;
}
.pdc-progress::before {
    content: "";
    position: absolute;
    top: 14px;
    left: 14%;
    right: 14%;
    height: 2px;
    background: var(--pdc-border);
    z-index: 0;
}
.pdc-progress li {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
    font-size: 0.8em;
    color: var(--pdc-muted);
    font-weight: 600;
}
.pdc-progress__dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--pdc-border);
    color: var(--pdc-muted);
    font-weight: 700;
    font-size: 0.85em;
    margin-bottom: 0.3em;
    transition: background 200ms ease, border-color 200ms ease, color 200ms ease;
}
.pdc-progress__label { display: block; }
.pdc-progress li.is-current .pdc-progress__dot,
.pdc-progress li.is-done .pdc-progress__dot {
    background: var(--pdc-brand);
    border-color: var(--pdc-brand);
    color: #fff;
}
.pdc-progress li.is-current { color: var(--pdc-brand-dark); }
.pdc-progress li.is-done .pdc-progress__dot::after {
    content: "\2713";
    font-size: 1em;
}
.pdc-progress li.is-done .pdc-progress__dot { font-size: 0; }

/* --- Panes (wizard steps + welcome + result) ---------------- */
.pdc-wrap .pdc-pane { margin-bottom: 1em !important; }
/* Tag.class selectors so theme h3 font-size rules can't override us. */
.pdc-wrap h3.pdc-pane__title,
.pdc-wrap .pdc-pane__title {
    display: block !important;
    margin: 0 0 0.25em !important;
    padding: 0 !important;
    color: var(--pdc-brand-dark) !important;
    font-size: clamp(0.88rem, 3.9vw, 1.15rem) !important;
    line-height: 1.25 !important;
    text-align: center !important;
    font-weight: 700 !important;
    /* Wrap only at word boundaries - never mid-word, never with hyphens */
    hyphens: none !important;
    -webkit-hyphens: none !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    word-wrap: normal !important;
}
.pdc-wrap .pdc-pane__hint {
    margin: 0 0 0.9em !important;
    padding: 0 !important;
    color: var(--pdc-muted) !important;
    font-size: clamp(0.78rem, 3vw, 0.9rem) !important;
    line-height: 1.4 !important;
    text-align: center !important;
}

/* --- Welcome / safety --------------------------------------- */
.pdc-pane--welcome { padding-top: 0.25em; }
.pdc-safety-list {
    background: var(--pdc-brand-tint);
    border-left: 4px solid var(--pdc-brand);
    padding: 1em 1.25em 1em 2em;
    border-radius: 6px;
    margin: 0 0 1em;
}
.pdc-safety-list li { margin-bottom: 0.5em; }
.pdc-safety-list li:last-child { margin-bottom: 0; }
.pdc-safety-list a { color: var(--pdc-brand-dark); font-weight: 600; }
.pdc-accept {
    display: flex;
    align-items: center;
    gap: 0.6em;
    padding: 0.75em 1em;
    min-height: var(--pdc-tap);
    background: #fff;
    border: 1.5px solid var(--pdc-border);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 1em;
}
.pdc-accept input {
    width: 1.25em;
    height: 1.25em;
    accent-color: var(--pdc-brand);
    flex-shrink: 0;
}

/* --- Buttons ------------------------------------------------ */
.pdc-btn {
    appearance: none;
    font-family: inherit;
    font-weight: 700;
    font-size: 1.05em;
    padding: 0 1.5em;
    min-height: var(--pdc-tap);
    border-radius: 10px;
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease, border-color 120ms ease, transform 80ms ease;
    letter-spacing: 0.01em;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4em;
    border: 1.5px solid transparent;
}
/* Primary button uses brand-dark for AA contrast with white text. */
.pdc-btn--primary { background: var(--pdc-brand-dark); color: #fff; border-color: var(--pdc-brand-dark); }
.pdc-btn--primary:hover:not(:disabled) { background: #0A547A; border-color: #0A547A; }
.pdc-btn--primary:disabled { background: #B7C7D4; border-color: #B7C7D4; cursor: not-allowed; color: #fff; }
.pdc-btn--primary:focus { outline: 3px solid rgba(31, 173, 235, 0.45); outline-offset: 2px; }
.pdc-btn--primary:active:not(:disabled) { transform: scale(0.98); }
.pdc-btn--ghost {
    background: #fff;
    color: var(--pdc-brand-dark);
    border-color: var(--pdc-brand);
}
.pdc-btn--ghost:hover { background: var(--pdc-brand-tint); }
.pdc-btn--ghost:focus { outline: 3px solid rgba(31, 173, 235, 0.45); outline-offset: 2px; }
.pdc-btn--block { width: 100%; }
.pdc-btn--danger-ghost {
    background: #fff;
    color: var(--pdc-alert);
    border-color: var(--pdc-alert);
}
.pdc-btn--danger-ghost:hover { background: var(--pdc-alert-bg); }

/* --- Choice grid (medication, bottle, age cards) ----------- */
.pdc-choice-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75em;
}
.pdc-choice-grid--wide { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* Medication picker (step 1): always 3-up, even on narrow phones. */
.pdc-choice-grid--meds { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 0.4em; }
/* Bottle / form picker (step 2): stay on ONE row regardless of item count (2 or 3). */
.pdc-choice-grid--forms {
    grid-template-columns: none !important;
    grid-auto-flow: column !important;
    grid-auto-columns: minmax(0, 1fr) !important;
    gap: 0.5em;
}

.pdc-choice-card {
    appearance: none;
    background: #fff;
    border: 2px solid var(--pdc-border);
    border-radius: 12px;
    padding: 1em 0.75em;
    min-height: 140px;
    cursor: pointer;
    text-align: center;
    font-family: inherit;
    color: var(--pdc-text);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4em;
    transition: background 120ms ease, border-color 120ms ease, transform 80ms ease, box-shadow 120ms ease;
}
/* Only apply hover tinting on devices with a real hover-capable pointer.
   Touch devices emulate :hover after tap, which made tiles look preselected. */
@media (hover: hover) and (pointer: fine) {
    .pdc-choice-card:hover {
        border-color: var(--pdc-brand);
        background: var(--pdc-brand-tint);
    }
}
/* :focus-visible = only show the ring when the user navigated here by keyboard.
   Programmatic .focus() from JS or taps/clicks no longer paint the ring,
   so tiles don't look preselected on step entry. */
.pdc-choice-card:focus { outline: none; }
.pdc-choice-card:focus-visible {
    outline: 3px solid rgba(31, 173, 235, 0.45);
    outline-offset: 2px;
}
.pdc-choice-card:active { transform: scale(0.98); }
.pdc-choice-card.is-selected,
.pdc-choice-card[aria-checked="true"] {
    border-color: var(--pdc-brand);
    background: var(--pdc-brand-tint);
    box-shadow: 0 0 0 3px rgba(31, 173, 235, 0.18);
}
.pdc-choice-card__art {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pdc-brand);
}
.pdc-choice-card__art svg { width: 100%; height: 100%; display: block; }
.pdc-choice-card__name {
    font-weight: 700;
    font-size: 1.05em;
    color: var(--pdc-brand-dark);
    line-height: 1.2;
}
.pdc-choice-card__sub {
    font-size: 0.8em;
    color: var(--pdc-muted);
    line-height: 1.3;
}
.pdc-choice-card__strength {
    font-size: 0.78em;
    color: var(--pdc-muted);
    line-height: 1.2;
    font-weight: 500;
}
.pdc-choice-card--age { min-height: 64px; padding: 0.75em 0.5em; }
.pdc-choice-card--age .pdc-choice-card__name { font-size: 1em; }

/* --- Weight input (big) ------------------------------------ */
.pdc-weight-big {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.4em;
    margin: 0.5em 0 1em;
    padding: 0.45em 0.5em;
    background: var(--pdc-brand-tint);
    border-radius: 10px;
    border: 2px solid var(--pdc-border);
}
.pdc-weight-big input {
    width: 5ch;
    /* Comfortable form-field size, safely above 16px to avoid iOS focus-zoom. */
    font-size: 1.5em;
    font-weight: 700;
    color: var(--pdc-brand-dark);
    text-align: center;
    background: transparent;
    border: 0;
    border-bottom: 3px solid var(--pdc-brand);
    padding: 0 0.1em;
    line-height: 1.1;
    font-family: inherit;
    -moz-appearance: textfield;
}
.pdc-weight-big input::-webkit-outer-spin-button,
.pdc-weight-big input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.pdc-weight-big input:focus {
    outline: 0;
    border-bottom-color: var(--pdc-brand-dark);
}
.pdc-weight-big input[aria-invalid="true"] { border-bottom-color: var(--pdc-alert); color: var(--pdc-alert); }
.pdc-weight-big__unit {
    font-size: 1.05em;
    color: var(--pdc-brand-dark);
    font-weight: 700;
}

.pdc-field-error {
    margin: 0 0 0.85em;
    padding: 0.6em 0.85em;
    background: var(--pdc-alert-bg);
    color: var(--pdc-alert);
    border-radius: 6px;
    font-size: 0.95em;
    font-weight: 600;
    text-align: center;
}

/* --- Result pane -------------------------------------------- */
.pdc-pane--result { outline: none; }
.pdc-pane--result:focus-visible {
    outline: 3px solid rgba(31, 173, 235, 0.45);
    outline-offset: 3px;
    border-radius: 10px;
}
.pdc-card {
    border: 1px solid var(--pdc-border);
    border-radius: 12px;
    padding: 1.25em;
    background: #fff;
}
.pdc-card__eyebrow {
    font-size: 0.8em;
    color: var(--pdc-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.35em;
    font-weight: 700;
    text-align: center;
}
.pdc-card h3 {
    margin: 0 0 0.4em;
    color: var(--pdc-brand-dark);
    font-size: 1.25em;
    line-height: 1.25;
    text-align: center;
}
.pdc-card .pdc-generic {
    color: var(--pdc-muted);
    font-weight: 400;
    font-size: 0.9em;
}

.pdc-card--result { border-top: 4px solid var(--pdc-brand); }
.pdc-card--warn, .pdc-card--block {
    border-left: 4px solid var(--pdc-alert);
    background: var(--pdc-alert-bg);
}
.pdc-card--block .pdc-card__eyebrow,
.pdc-card--block h3 { color: var(--pdc-alert); }

/* --- Giant dose hero ---------------------------------------- */
.pdc-dose-hero {
    text-align: center;
    padding: 1.25em 0.5em;
    margin: 0.75em 0 0.85em;
    background: linear-gradient(180deg, var(--pdc-brand-tint) 0%, var(--pdc-brand-tint-2) 100%);
    border-radius: 10px;
    border: 1px solid var(--pdc-border);
}
.pdc-dose-hero__label {
    font-size: 0.85em;
    color: var(--pdc-brand-dark);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 0.25em;
}
.pdc-dose-hero__primary {
    /* The headline dose number gets the logo pink so the answer pops against
       the blue brand chrome. AA Large contrast on the tint background. */
    font-size: 3.25em;
    font-weight: 800;
    color: var(--pdc-accent-dark);
    line-height: 1;
    letter-spacing: -0.02em;
    margin: 0;
}
.pdc-dose-hero__secondary {
    font-size: 1.15em;
    color: var(--pdc-brand-dark);
    margin-top: 0.35em;
    opacity: 0.85;
    font-weight: 500;
}
.pdc-dose-hero__form {
    font-size: 0.95em;
    color: var(--pdc-muted);
    margin-top: 0.5em;
    font-weight: 500;
}

.pdc-freq {
    margin: 0.25em 0 0.85em;
    padding: 0.7em 1em;
    background: #fff;
    border: 1px solid var(--pdc-border);
    border-radius: 8px;
    text-align: center;
    font-size: 1em;
}
.pdc-freq strong { color: var(--pdc-brand-dark); }

.pdc-tips {
    font-size: 0.88em;
    color: #333;
    padding: 0.75em 1em;
    background: #f7f5f7;
    border-radius: 8px;
    margin-bottom: 1em;
}

/* --- Result "Show full chart" accordion --------------------- */
.pdc-chart-toggle {
    display: block;
    width: 100%;
    appearance: none;
    background: transparent;
    border: 0;
    color: var(--pdc-brand-dark);
    font-weight: 700;
    font-size: 0.95em;
    padding: 0.75em;
    cursor: pointer;
    text-align: center;
    font-family: inherit;
    border-top: 1px dashed var(--pdc-border);
    border-bottom: 1px dashed var(--pdc-border);
    margin: 0.75em 0;
    min-height: var(--pdc-tap);
}
.pdc-chart-toggle:hover { background: var(--pdc-brand-tint); }
.pdc-chart-toggle:focus { outline: 3px solid rgba(31, 173, 235, 0.45); outline-offset: 2px; }
.pdc-chart-toggle__caret { transition: transform 200ms ease; display: inline-block; }
.pdc-chart-toggle[aria-expanded="true"] .pdc-chart-toggle__caret { transform: rotate(180deg); }
.pdc-full-chart {
    overflow-x: auto;
    margin: 0.5em 0 1em;
    border: 1px solid var(--pdc-border);
    border-radius: 8px;
}
.pdc-full-chart table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88em;
}
.pdc-full-chart th, .pdc-full-chart td {
    padding: 0.5em 0.75em;
    text-align: left;
    border-bottom: 1px solid var(--pdc-border);
}
.pdc-full-chart th {
    background: var(--pdc-brand-tint);
    color: var(--pdc-brand-dark);
    font-weight: 700;
    position: sticky;
    top: 0;
}
.pdc-full-chart tr.is-match {
    background: #fff9c4;
    font-weight: 700;
}
.pdc-full-chart tr.is-match td:first-child::before {
    content: "\25B6 ";
    color: var(--pdc-brand);
}

/* --- Result action row -------------------------------------- */
.pdc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    margin: 0.75em 0 1em;
}
.pdc-actions .pdc-btn { flex: 1 1 auto; font-size: 0.95em; }

/* --- Call-clinic CTA ---------------------------------------- */
.pdc-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75em;
    padding: 0.85em 1em;
    background: var(--pdc-brand-dark);
    border-radius: 10px;
}
.pdc-cta__label { color: #fff; font-weight: 600; flex: 1 1 auto; }
.pdc-cta__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4em;
    background: #fff;
    color: var(--pdc-brand-dark) !important;
    padding: 0 1.1em;
    min-height: var(--pdc-tap);
    border-radius: 999px;
    font-weight: 700;
    font-size: 1.05em;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    flex-shrink: 0;
}
.pdc-cta__button:hover,
.pdc-cta__button:focus {
    background: var(--pdc-brand-tint);
    color: var(--pdc-brand-dark) !important;
    outline: 3px solid rgba(255,255,255,0.6);
    outline-offset: 2px;
}
.pdc-cta__icon { font-size: 1.1em; }

/* --- Wizard nav (back) -------------------------------------- */
/* Global: respect the HTML [hidden] attribute even when our own rules set
   an explicit display (e.g. display: flex below). Without this, WP themes and
   our own flex rules override the UA default of display:none for [hidden]. */
.pdc-wrap [hidden] { display: none !important; }

.pdc-wizard-nav {
    display: flex;
    justify-content: flex-start;
    margin-top: 0.5em;
}

/* --- Welcome-pane action row (Back + Start on one line) --- */
.pdc-welcome-actions {
    display: flex;
    gap: 0.6em;
    align-items: stretch;
    margin-top: 0.5em;
}
.pdc-welcome-actions__back {
    flex: 0 0 auto;
    padding-left: 1em;
    padding-right: 1em;
}
.pdc-welcome-actions__start {
    flex: 1 1 auto;
}
@media (max-width: 380px) {
    /* On very narrow phones keep them inline but let Back shrink further. */
    .pdc-welcome-actions { gap: 0.45em; }
    .pdc-welcome-actions__back { padding-left: 0.65em; padding-right: 0.65em; font-size: 0.9em; }
}

/* --- Footer ------------------------------------------------- */
.pdc-footer {
    margin-top: 1.25em;
    padding-top: 0.75em;
    border-top: 1px solid var(--pdc-border);
    text-align: center;
    font-size: clamp(0.68rem, 2.2vw, 0.75rem);
    line-height: 1.4;
    color: var(--pdc-muted);
}
.pdc-footer__address { margin-bottom: 0.2em; }
.pdc-footer__contact a {
    color: var(--pdc-brand-dark);
    text-decoration: none;
    font-weight: 600;
}
.pdc-footer__contact a:hover { text-decoration: underline; }

/* --- Accessibility utilities -------------------------------- */
.pdc-sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* --- Reduced motion ----------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .pdc-wrap *, .pdc-wrap *::before, .pdc-wrap *::after {
        transition: none !important;
        animation: none !important;
        scroll-behavior: auto !important;
    }
}

/* --- Mobile breakpoints ------------------------------------- */
@media (max-width: 600px) {
    .pdc-wrap { margin: 0.5em; padding: 0.85em 0.75em 1em; border-radius: 10px; }
    .pdc-wrap .pdc-header { margin-bottom: 0.75em !important; }
    .pdc-safety-list { padding: 0.75em 0.85em 0.75em 1.5em; margin: 0 0 0.85em; font-size: 0.92em; }
    .pdc-safety-list li { margin-bottom: 0.4em; }
    .pdc-progress__label { display: none; }
    .pdc-progress { margin-bottom: 1.1em; }
    .pdc-progress::before { left: 10%; right: 10%; }
    .pdc-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6em; }
    .pdc-choice-grid--wide { grid-template-columns: 1fr; }
    /* Medication grid stays 3-up — shrink the card instead of wrapping. */
    .pdc-choice-grid--meds { gap: 0.35em; }
    .pdc-choice-grid--meds .pdc-choice-card { min-height: 110px; padding: 0.6em 0.3em; }
    .pdc-choice-grid--meds .pdc-choice-card__art { width: 48px; height: 48px; }
    .pdc-choice-grid--meds .pdc-choice-card__name { font-size: 0.95em; }
    .pdc-choice-grid--meds .pdc-choice-card__sub { display: none; }
    /* Form grid also stays on one row - compress card contents, height can grow. */
    .pdc-choice-grid--forms { gap: 0.35em; }
    .pdc-choice-grid--forms .pdc-choice-card { min-height: 120px; padding: 0.55em 0.3em; }
    .pdc-choice-grid--forms .pdc-choice-card__art { width: 44px; height: 44px; }
    .pdc-choice-grid--forms .pdc-choice-card__name { font-size: 0.85em; line-height: 1.15; }
    .pdc-choice-grid--forms .pdc-choice-card__strength { font-size: 0.7em; line-height: 1.2; }
    .pdc-choice-card { min-height: 120px; padding: 0.85em 0.5em; }
    .pdc-choice-card__art { width: 60px; height: 60px; }
    .pdc-choice-card--age { min-height: 56px; }
    .pdc-weight-big input { font-size: 1.4em; }
    .pdc-dose-hero__primary { font-size: 2.4em; }
    .pdc-cta { flex-direction: column; align-items: stretch; text-align: center; }
    .pdc-cta__button { width: 100%; }
}
@media (max-width: 380px) {
    .pdc-wrap { padding: 0.75em 0.6em 0.85em; }
    .pdc-safety-list { padding: 0.6em 0.7em 0.6em 1.3em; font-size: 0.88em; }
    .pdc-choice-grid { grid-template-columns: 1fr; }
    /* Even at 360px the 3-up med grid still fits because we further compress. */
    .pdc-choice-grid--meds .pdc-choice-card { min-height: 96px; padding: 0.5em 0.2em; }
    .pdc-choice-grid--meds .pdc-choice-card__art { width: 40px; height: 40px; }
    .pdc-choice-grid--meds .pdc-choice-card__name { font-size: 0.85em; }
    /* Ultra-narrow: keep forms one row, let height grow so long labels wrap at spaces. */
    .pdc-choice-grid--forms .pdc-choice-card { min-height: 108px; padding: 0.45em 0.2em; }
    .pdc-choice-grid--forms .pdc-choice-card__art { width: 36px; height: 36px; }
    .pdc-choice-grid--forms .pdc-choice-card__name { font-size: 0.78em; }
    .pdc-choice-grid--forms .pdc-choice-card__strength { font-size: 0.65em; }
    .pdc-weight-big input { font-size: 1.3em; }
    .pdc-dose-hero__primary { font-size: 2.1em; }
}

/* --- Print stylesheet --------------------------------------- */
@media print {
    body * { visibility: hidden !important; }
    .pdc-wrap, .pdc-wrap * { visibility: visible !important; }
    .pdc-wrap {
        position: absolute; top: 0; left: 0;
        width: 100%; max-width: 100%;
        margin: 0; padding: 1em;
        box-shadow: none; border: 0;
        border-top: 4px solid #000 !important;
        color: #000 !important;
    }
    .pdc-progress, .pdc-pane--welcome, .pdc-step, .pdc-actions,
    .pdc-wizard-nav, .pdc-chart-toggle, .pdc-header__subtitle { display: none !important; }
    .pdc-header__brand { color: #000 !important; }
    .pdc-header__title { color: #000 !important; font-size: 1.2em; }
    .pdc-card { border: 1px solid #999 !important; background: #fff !important; }
    .pdc-card h3 { color: #000 !important; }
    .pdc-dose-hero { background: #fff !important; border: 2px solid #000 !important; padding: 1em; }
    .pdc-dose-hero__primary,
    .pdc-dose-hero__secondary,
    .pdc-dose-hero__label,
    .pdc-dose-hero__form { color: #000 !important; }
    .pdc-cta { background: #fff !important; border: 1px solid #000 !important; }
    .pdc-cta__label, .pdc-cta__button { color: #000 !important; background: #fff !important; box-shadow: none !important; }
    .pdc-footer { color: #000 !important; }
    .pdc-footer a { color: #000 !important; }
}
