/* 1. Birth-time controls must shrink with their form, including 320px screens. */
@media (max-width: 719px) {
    .azh-input fieldset, .azv-input fieldset { min-width: 0; }
    .azh .azh-time, .azv .azv-time {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        width: 100%;
        max-width: 100%;
        gap: 8px;
    }
    .azh .azh-time label, .azv .azv-time label { width: auto; min-width: 0; }
    .azh .azh-time select, .azv .azv-time select { min-width: 0; padding-inline: 10px; }
}

/* 2. Give each result summary enough reading width on phones. */
@media (max-width: 719px) {
    .azs-visual-result .azs-highlights, .azm-result .azm-highlights {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }
    .azs-visual-result .azs-highlight, .azm-result .azm-highlights > div { padding: 16px 18px; }
    .azs-visual-result .azs-highlight > span, .azm-result .azm-highlights small { font-size: 13px; margin-bottom: 5px; }
    .azs-visual-result .azs-highlight strong, .azm-result .azm-highlights strong { font-size: 16px; line-height: 1.7; }
}

/* 3. Fit the existing form heading without an orphaned final character. */
@media (max-width: 719px) {
    .azm .azm-input h2, .azh .azh-input h2, .azk .azk-input h2 {
        font-size: clamp(16px, 5vw, 22px) !important;
        line-height: 1.65 !important;
        letter-spacing: 0 !important;
        text-wrap: balance;
    }
}

/* 4. Separate the oracle header copy and portrait on phones. */
@media (max-width: 719px) {
    .azor-page-hero, .azor-page-hero > .wp-block-group__inner-container {
        display: flex;
        flex-direction: column;
        height: auto !important;
        min-height: 0;
    }
    .azor-page-hero { background: #fcf5f8; }
    .azor-page-hero .azor-hero-inner {
        order: 0;
        width: calc(100% - 32px);
        height: auto;
        padding: 18px 0 !important;
        text-align: center;
    }
    .azor-hero-inner > .wp-block-group__inner-container { width: 100%; }
    .azor-page-hero .azor-hero-inner :is(h1, p) { max-width: none !important; }
    .azor-page-hero .azor-hero-eyebrow { font-size: 12px; line-height: 1.7; }
    .azor-page-hero .azor-hero-title { font-size: clamp(23px, 6.4vw, 27px) !important; }
    .azor-page-hero .azor-hero-lead { font-size: 13px; line-height: 1.8; }
    .azor-page-hero .azor-hero-image {
        position: relative !important;
        inset: auto;
        order: 1;
        flex: 0 0 200px;
        height: 200px !important;
        overflow: hidden;
    }
    .azor-page-hero .azor-hero-image img { object-position: center 65%; }
}

/* 5. Keep the same table data, but read one labelled row at a time on phones. */
.azami-responsive-cell-value { display: contents; }
@media (max-width: 719px) {
    :is(.azh-table, .azv-table)[data-responsive-ready="true"] {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: none;
    }
    :is(.azh-table, .azv-table)[data-responsive-ready="true"] thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
    :is(.azh-table, .azv-table)[data-responsive-ready="true"] tbody { display: block; width: 100%; }
    :is(.azh-table, .azv-table)[data-responsive-ready="true"] tbody tr {
        display: block;
        margin: 0 0 14px;
        padding: 8px 16px;
        border: 1px solid #e4d7e8;
        border-radius: 16px;
        background: #fff;
    }
    :is(.azh-table, .azv-table)[data-responsive-ready="true"] td {
        display: grid;
        grid-template-columns: 5.5em minmax(0, 1fr);
        gap: 12px;
        width: 100%;
        min-width: 0;
        padding: 10px 0;
        border: 0;
        border-bottom: 1px solid #eee5ef;
        font-size: 14px;
        line-height: 1.8;
        background: none;
        overflow-wrap: anywhere;
    }
    :is(.azh-table, .azv-table)[data-responsive-ready="true"] td::before {
        content: attr(data-label);
        color: #806e84;
        font-size: 12px;
        font-weight: 700;
    }
    :is(.azh-table, .azv-table)[data-responsive-ready="true"] td:last-child {
        grid-template-columns: minmax(0, 1fr);
        gap: 5px;
        border-bottom: 0;
    }
    :is(.azh-table, .azv-table)[data-responsive-ready="true"] .azami-responsive-cell-value { display: block; min-width: 0; }
    .azv-table[data-responsive-ready="true"] td:first-child .azami-responsive-cell-value {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 8px;
    }
    .azv-table[data-responsive-ready="true"] tbody tr { border-color: #e6d1b3; background: #fffaf2; }
    .azv-table[data-responsive-ready="true"] td { border-bottom-color: #efe1cd; }
    .azv-table[data-responsive-ready="true"] td::before { color: #8f766a; }
}
