/*
 * assets/css/reducing-emissions.css
 * Styles for reducing-emissions-and-cost.php ("Reduce Embedded Emissions & CBAM Costs").
 *
 * EVERY rule starts with ".reduce-page", so nothing here can change any other page.
 * Same look as the other pages (european-union.europa.eu): flat colours, thin grey borders,
 * yellow accent lines, blue headings and buttons. No animations.
 *
 * Colours used (EU family + the deepened shades already used on the site):
 *   EC Blue #4073AF, EC Yellow #FFDE39, EC Grey #CFCFCF, #255D9D, #1D497C, amber #C29500,
 *   text #262626 / #444444, light grey #F4F4F4, and the pale yellow #FFF6C2 used by the
 *   EU CBAM checker for "please check this field".
 * The site variables (--blue, --yellow, --grey, --light, --text, --white) come from style.css.
 *
 * Contents: basics / titles / buttons / hero / lists / cards / graph / tables / calculator /
 *           market panels / sectors / process flow / callout and final block /
 *           tablet / phones
 * v36 (chat 12f): the intro sits beside its photo from 1000px (rule shared with the other three
 * pages, see design-system.css); cards, panels, notes, tables and image frames follow the
 * design-system rules; "What You Receive" runs in two columns from 900px.
 */

/* The "hidden" attribute must always win inside this page (used by the calculator) */
.reduce-page [hidden] {
    display: none !important;
}

/* Text for screen readers only */
.reduce-page .rp-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Space between the big blocks */
.reduce-page .rp-block + .rp-block {
    margin-top: 64px;
}

/* ---------- Titles ---------- */

/* Section titles */
.reduce-page h2 {
    margin: 0 0 6px 0;
    font-size: 1.65rem;
    font-weight: bold;
    line-height: 1.25;
    color: var(--text);
    overflow-wrap: break-word;
    scroll-margin-top: 16px;
}

/* Sub titles inside a section (h3 outside of cards) */
.reduce-page .rp-sub {
    margin: 44px 0 8px 0;
    font-size: 1.25rem;
    font-weight: bold;
    line-height: 1.35;
    color: var(--text);
    overflow-wrap: break-word;
}

/* Small sub title (the calculator heading, h4) */
.reduce-page .rp-sub-small {
    margin: 44px 0 8px 0;
    font-size: 1.1rem;
    font-weight: bold;
    line-height: 1.35;
    color: var(--blue);
}

/* Blue lead line under the page title */
.reduce-page .rp-lead {
    margin: 0 0 24px 0;
    max-width: 760px;
    color: var(--blue);
    font-size: 1.1rem;
    font-weight: bold;
    line-height: 1.4;
}

/* Comfortable line length for plain text */
.reduce-page .rp-text-width {
    max-width: 760px;
    margin: 0 0 16px 0;
}

.reduce-page .rp-block > h2 + .rp-text-width {
    margin-top: 6px;
}

/* ---------- Buttons (same as the other pages) ---------- */

.reduce-page .rp-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 16px 0 0 0;
}

.reduce-page .rp-btn {
    display: inline-block;
    max-width: 100%;
    min-height: 46px;
    padding: 12px 24px;
    border: 2px solid var(--blue);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1rem;
    font-weight: bold;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    overflow-wrap: anywhere;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.reduce-page .rp-btn-primary {
    background: var(--blue);
    color: var(--white);
}

.reduce-page .rp-btn-primary:hover,
.reduce-page .rp-btn-primary:focus {
    background: #255D9D;
    border-color: #255D9D;
    color: var(--white);
    text-decoration: none;
}

.reduce-page .rp-btn:focus-visible {
    outline: 3px solid var(--yellow);
    outline-offset: 0;
    box-shadow: 0 0 0 5px var(--text);
}

/* ---------- Photos ---------- */

/* Hero photo (image frame: 1px grey line, 8px white padding, no yellow line).
   Under the text on small screens (already cut to a wide strip, shown whole, never stretched);
   beside the intro text from 1000px (design-system.css). */
.reduce-page .rp-hero {
    margin: 32px 0 0 0;
    padding: 8px;
    border: 1px solid var(--grey);
    background: var(--white);
}

.reduce-page .rp-hero img {
    width: 100%;
    height: auto;
}

/* Photo above the aluminium table */
.reduce-page .rp-hero-inline {
    margin: 0 0 24px 0;
}

/* ---------- Bullet lists ---------- */

.reduce-page .rp-list {
    max-width: 760px;
    margin: 14px 0 0 0;
    padding: 0 0 0 20px;
    line-height: 1.7;
}

.reduce-page .rp-list li {
    margin: 0 0 6px 0;
    overflow-wrap: anywhere;
}

/* "What You Receive": two columns from 900px, one column below */
@media (min-width: 900px) {

    .reduce-page .rp-list-columns {
        max-width: none;
        columns: 2;
        column-gap: 48px;
    }
}

.reduce-page .rp-list-columns li {
    break-inside: avoid;
}

.reduce-page .rp-receive-title {
    margin: 6px 0 0 0;
    font-size: 1.15rem;
    line-height: 1.4;
}

/* ---------- Cards (same card look as the numbered cards on the other pages) ---------- */

/* Three cards side by side on wide screens, stacked on phones. No arrows between them. */
.reduce-page .rp-cards-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin: 20px 0 0 0;
}

.reduce-page .rp-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--white);
    border: 1px solid var(--grey);
    border-top: 3px solid var(--yellow);
}

.reduce-page .rp-card-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid var(--grey);
}

.reduce-page .rp-card h3 {
    margin: 0;
    min-width: 0;
    font-size: 1.1rem;
    font-weight: bold;
    line-height: 1.35;
    color: var(--blue);
    overflow-wrap: break-word;
}

/* Big blue number: "01" in the step cards ... */
.reduce-page .rp-card-number {
    flex: 0 0 auto;
    margin: 0;
    color: var(--blue);
    font-size: 2rem;
    font-weight: bold;
    line-height: 1;
}

/* ... and "1." in front of the title in the three boxes */
.reduce-page .rp-card h3 .rp-card-number {
    display: inline-block;
    margin-right: 4px;
    font-size: 1.5rem;
    vertical-align: -2px;
}

.reduce-page .rp-card-body {
    flex: 1 1 auto;
    padding: 20px 24px 8px 24px;
}

.reduce-page .rp-card-body p {
    margin: 0 0 12px 0;
}

.reduce-page .rp-card-body .rp-card-lead {
    font-weight: bold;
}

/* Lists inside the step cards run in two columns on wide screens */
.reduce-page .rp-card-list {
    margin: 0 0 14px 0;
    padding: 0 0 0 20px;
    columns: 2;
    column-gap: 36px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.reduce-page .rp-card-list li {
    margin: 0 0 6px 0;
    break-inside: avoid;
    overflow-wrap: anywhere;
}

/* "You receive:" sits on a light band at the bottom of the card (same as filing-obligations.php) */
.reduce-page .rp-card-receive {
    margin: 0;
    padding: 16px 24px;
    background: var(--light);
    border-top: 1px solid var(--grey);
    line-height: 1.5;
}

/* The seven step cards: one under the other */
.reduce-page .rp-steps {
    margin: 28px 0 0 0;
}

.reduce-page .rp-steps .rp-card + .rp-card {
    margin-top: 20px;
}

/* ---------- The cost graph ---------- */

.reduce-page .rp-graph {
    margin: 24px 0 0 0;
    padding: 24px;
    border: 1px solid var(--grey);
    border-top: 3px solid var(--yellow);
    background: var(--white);
}

.reduce-page .rp-svg {
    display: block;
    width: 100%;
    max-width: 760px;
    height: auto;
    margin: 0 auto;
}

/* The phone layout is hidden on wide screens (and the other way round on phones) */
.reduce-page .rp-svg-narrow {
    display: none;
}

/* Graph colours (palette only) */
.reduce-page .rp-svg .rp-f-eff   { fill: #4073AF; }
.reduce-page .rp-svg .rp-s-eff   { stroke: #4073AF; }
.reduce-page .rp-svg .rp-f-avg   { fill: #1D497C; }
.reduce-page .rp-svg .rp-s-avg   { stroke: #1D497C; }
.reduce-page .rp-svg .rp-f-def   { fill: #262626; }
.reduce-page .rp-svg .rp-s-def   { stroke: #262626; }
.reduce-page .rp-svg .rp-f-amber { fill: #C29500; }
.reduce-page .rp-svg .rp-s-amber { stroke: #C29500; }
.reduce-page .rp-svg .rp-f-text  { fill: #262626; }
.reduce-page .rp-svg .rp-s-text  { stroke: #262626; }
.reduce-page .rp-svg .rp-f-muted { fill: #444444; }
.reduce-page .rp-svg .rp-s-grey  { stroke: #CFCFCF; }

.reduce-page .rp-basis {
    margin-top: 18px;
}

.reduce-page .rp-illustrates {
    margin-top: 22px;
}

.reduce-page .rp-italic-note {
    margin: 14px 0 0 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #444444;
}

/* ---------- Tables ---------- */

/* The wrapper is only a safety net: if a table is ever too wide, only the table scrolls, never the page */
.reduce-page .rp-table-wrap {
    max-width: 100%;
    margin: 20px 0 0 0;
    overflow-x: auto;
}

.reduce-page .rp-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--grey);
    background: var(--white);
    font-size: 0.95rem;
    line-height: 1.5;
}

.reduce-page .rp-table th,
.reduce-page .rp-table td {
    padding: 10px 14px;
    border: 1px solid var(--grey);
    text-align: left;
    vertical-align: top;
    overflow-wrap: break-word;
}

.reduce-page .rp-table thead th {
    background: var(--blue);
    border-color: var(--blue);
    color: var(--white);
    font-weight: bold;
}

/* First column = the row title */
.reduce-page .rp-table tbody th {
    background: var(--white);
    font-weight: bold;
}

/* Zebra: every second row on light grey */
.reduce-page .rp-table tbody tr:nth-child(even) th,
.reduce-page .rp-table tbody tr:nth-child(even) td {
    background: var(--light);
}

/* ---------- Calculator ---------- */

.reduce-page .rp-calc {
    margin: 24px 0 0 0;
    padding: 28px;
    background: var(--light);
    border-top: 4px solid var(--yellow);
    border-left: 4px solid var(--blue);
}

.reduce-page .rp-calc-field {
    max-width: 560px;
}

.reduce-page .rp-calc-field label {
    display: block;
    margin: 0 0 8px 0;
    font-weight: bold;
    line-height: 1.35;
}

.reduce-page .rp-calc-row {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.reduce-page .rp-calc input[type="text"] {
    flex: 1 1 auto;
    display: block;
    width: 100%;
    min-width: 0;
    height: 52px;
    padding: 8px 12px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.1rem;
    color: var(--text);
    background: var(--white);
    border: 1px solid #595959;
    border-radius: 0;
}

.reduce-page .rp-calc input[type="text"]:focus {
    outline: 3px solid var(--yellow);
    outline-offset: 0;
    border-color: var(--text);
}

.reduce-page .rp-calc .rp-btn {
    flex: 0 0 auto;
    min-height: 52px;
}

/* Problem: pale yellow band, dark line and a plain message (like the EU CBAM checker; never colour alone) */
.reduce-page .rp-calc-field.rp-invalid {
    margin: 0 -12px;
    padding: 10px 12px;
    background: #FFF6C2;
    border-left: 6px solid var(--text);
}

.reduce-page .rp-invalid input[type="text"] {
    border: 2px solid var(--text);
}

.reduce-page .rp-error {
    margin: 8px 0 0 0;
    font-size: 0.95rem;
    font-weight: bold;
    line-height: 1.4;
    color: var(--text);
}

/* Result */
.reduce-page .rp-calc-output:not(:empty) {
    margin: 22px 0 0 0;
    padding: 20px 0 0 0;
    border-top: 1px solid var(--grey);
}

.reduce-page .rp-result-volume {
    margin: 0 0 12px 0;
}

.reduce-page .rp-result-list {
    margin: 0 0 6px 0;
    padding: 0;
    list-style: none;
}

.reduce-page .rp-result-list li {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 4px 16px;
    align-items: baseline;
    margin: 0 0 8px 0;
    padding: 12px 16px;
    background: var(--white);
    border: 1px solid var(--grey);
    border-left: 4px solid var(--blue);
}

.reduce-page .rp-result-label {
    font-weight: bold;
}

.reduce-page .rp-result-value {
    font-size: 1.1rem;
    font-weight: bold;
    overflow-wrap: anywhere;
}

.reduce-page .rp-result-diff {
    color: #1D497C;
    overflow-wrap: anywhere;
}

.reduce-page .rp-result-rates {
    margin: 10px 0 0 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #444444;
}

/* "See what this could mean for your product" */
.reduce-page .rp-cta-lead {
    margin: 36px 0 0 0;
    font-size: 1.1rem;
}

/* ---------- Start With the Relevant Market ---------- */

.reduce-page .rp-panels {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin: 20px 0 0 0;
}

.reduce-page .rp-panel {
    min-width: 0;
    padding: 24px;
    background: var(--white);
    border: 1px solid var(--grey);
    border-top: 3px solid var(--yellow);
}

.reduce-page .rp-panel h3 {
    margin: 0 0 4px 0;
    color: var(--blue);
    font-size: 1.1rem;
    font-weight: bold;
    line-height: 1.35;
}

.reduce-page .rp-panel .rp-list {
    margin-top: 10px;
    line-height: 1.6;
}

.reduce-page .rp-panel .rp-list li:last-child {
    margin-bottom: 0;
}

/* Highlighted closing sentence is a Note: pale yellow, 4px yellow bar on the left */
.reduce-page .rp-note {
    margin: 24px 0 0 0;
    padding: 16px 20px;
    background: var(--yellow-tint);
    border-left: 4px solid var(--yellow);
    color: var(--text);
    font-weight: bold;
}

/* ---------- Choose Your Sector: one card per sector ---------- */

.reduce-page .rp-sector-list {
    margin: 20px 0 0 0;
}

.reduce-page .rp-sector {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    padding: 24px;
    background: var(--white);
    border: 1px solid var(--grey);
    border-top: 3px solid var(--yellow);
}

.reduce-page .rp-sector + .rp-sector {
    margin-top: 20px;
}

.reduce-page .rp-sector-media img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border: 1px solid var(--grey);
}

.reduce-page .rp-sector-text {
    min-width: 0;
}

.reduce-page .rp-sector-text h3 {
    margin: 0 0 12px 0;
    color: var(--blue);
    font-size: 1.1rem;
    font-weight: bold;
    line-height: 1.35;
}

.reduce-page .rp-parts {
    margin: 0;
}

.reduce-page .rp-part {
    margin: 0 0 14px 0;
}

.reduce-page .rp-part:last-child {
    margin-bottom: 0;
}

.reduce-page .rp-part dt {
    margin: 0 0 4px 0;
    color: var(--text);
    font-weight: bold;
}

.reduce-page .rp-part dd {
    margin: 0;
    overflow-wrap: break-word;
}

/* ---------- Process flows (8-step diagram and the step 05 chain) ----------
 * Fixed layouts, so an arrow never ends a row and points at nothing:
 *   wide screens (901px and up):  8-step diagram 4 per row, step 05 chain 3 per row, arrows pointing right
 *   medium screens (641-900px):   2 per row, arrows pointing right
 *   phones (640px and below):     1 per row, arrows pointing down
 * The boxes sit in equal columns with a 32px gap. Each arrow is a plain text character placed in that gap.
 * The last box of every row has no arrow, so the boxes always line up with the edges of the page column.
 */

.reduce-page .rp-flow {
    display: grid;
    gap: 10px 32px;
    margin: 20px 0 0 0;
    padding: 0;
    list-style: none;
}

.reduce-page .rp-flow-nodes {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.reduce-page .rp-flow-chain {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 4px 0 16px 0;
}

.reduce-page .rp-flow li {
    position: relative;
    display: flex;
    min-width: 0;
    margin: 0;
}

.reduce-page .rp-flow-step {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 8px 12px;
    background: var(--white);
    border: 1px solid var(--grey);
    border-bottom: 3px solid var(--yellow);
    font-size: 0.95rem;
    font-weight: bold;
    line-height: 1.35;
}

.reduce-page .rp-flow-text {
    min-width: 0;
    overflow-wrap: break-word;
}

/* Numbered node (1 to 8) */
.reduce-page .rp-flow-num {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: var(--blue);
    color: var(--white);
    font-size: 0.85rem;
    font-weight: bold;
    line-height: 1;
}

/* The arrow is a plain text character drawn by the style sheet, so it can turn from "right" to "down".
   It sits in the gap to the right of its box. */
.reduce-page .rp-flow-arrow {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 100%;
    width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--blue);
    font-size: 1.2rem;
    font-weight: bold;
    line-height: 1;
}

.reduce-page .rp-flow-arrow::before {
    content: "\2192";
}

/* Wide screens: no arrow after the 4th and 8th box (diagram) or the 3rd and 6th box (chain) */
.reduce-page .rp-flow-nodes li:nth-child(4n) .rp-flow-arrow,
.reduce-page .rp-flow-chain li:nth-child(3n) .rp-flow-arrow {
    display: none;
}

/* ---------- Independent Technology Assessment ---------- */

.reduce-page .rp-callout {
    margin: 20px 0 0 0;
    padding: 28px;
    background: var(--light);
    border-left: 4px solid var(--blue);
}

.reduce-page .rp-callout p {
    margin: 0 0 16px 0;
}

.reduce-page .rp-callout p:last-child {
    margin-bottom: 0;
}

.reduce-page .rp-callout p:first-child {
    font-size: 1.1rem;
    line-height: 1.5;
}

/* ---------- Final block ---------- */

/* Closing call-to-action Panel (same as the EU and UK pages): grey, yellow top line, blue bar on the left */
.reduce-page .rp-final {
    padding: 28px;
    background: var(--light);
    border-top: 4px solid var(--yellow);
    border-left: 4px solid var(--blue);
}

.reduce-page .rp-final h2 {
    margin-bottom: 14px;
    font-size: 1.5rem;
    color: #255D9D;
}

.reduce-page .rp-final .rp-text-width {
    margin-bottom: 0;
}

.reduce-page .rp-final .rp-buttons {
    margin-top: 22px;
}

/* ---------- Tablet ---------- */

@media (max-width: 900px) {

    .reduce-page .rp-sector {
        grid-template-columns: 200px minmax(0, 1fr);
        gap: 20px;
    }

    .reduce-page .rp-calc .rp-btn {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* Medium screens: process flows show 2 boxes per row */
@media (min-width: 641px) and (max-width: 900px) {

    .reduce-page .rp-flow-nodes,
    .reduce-page .rp-flow-chain {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .reduce-page .rp-flow-nodes li:nth-child(4n) .rp-flow-arrow,
    .reduce-page .rp-flow-chain li:nth-child(3n) .rp-flow-arrow {
        display: flex;
    }

    .reduce-page .rp-flow-nodes li:nth-child(2n) .rp-flow-arrow,
    .reduce-page .rp-flow-chain li:nth-child(2n) .rp-flow-arrow {
        display: none;
    }
}

/* Three boxes and two panels: one under the other */
@media (max-width: 800px) {

    .reduce-page .rp-cards-3 {
        grid-template-columns: minmax(0, 1fr);
    }

    .reduce-page .rp-panels {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ---------- Phones and small tablets ---------- */

@media (max-width: 700px) {

    .reduce-page .rp-block + .rp-block {
        margin-top: 40px;
    }

    .reduce-page .rp-sub,
    .reduce-page .rp-sub-small {
        margin-top: 36px;
    }

    .reduce-page .rp-panel {
        padding: 16px;
    }

    .reduce-page .rp-note {
        padding: 14px 16px;
    }

    .reduce-page .rp-card-list,
    .reduce-page .rp-list-columns {
        columns: 1;
    }

    /* Buttons stack full width with a comfortable tap height */
    .reduce-page .rp-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .reduce-page .rp-btn {
        width: 100%;
    }

    .reduce-page .rp-card-head,
    .reduce-page .rp-card-body,
    .reduce-page .rp-card-receive {
        padding-left: 14px;
        padding-right: 14px;
    }

    /* Graph: show the phone layout instead of the wide one */
    .reduce-page .rp-graph {
        padding: 6px;
    }

    .reduce-page .rp-svg-wide {
        display: none;
    }

    .reduce-page .rp-svg-narrow {
        display: block;
        max-width: 500px;
    }

    /* Tables: every row becomes a card. First column = card title, other values show their column name. */
    .reduce-page .rp-table-wrap {
        overflow-x: visible;
    }

    /* no zebra on the row cards (every card is white) */
    .reduce-page .rp-table tbody tr:nth-child(even) th,
    .reduce-page .rp-table tbody tr:nth-child(even) td {
        background: transparent;
    }

    .reduce-page .rp-table,
    .reduce-page .rp-table tbody,
    .reduce-page .rp-table tr,
    .reduce-page .rp-table th,
    .reduce-page .rp-table td {
        display: block;
        width: 100%;
    }

    .reduce-page .rp-table {
        border: 0;
        background: transparent;
    }

    /* The column names move into each card, so the header row is hidden (still read by screen readers) */
    .reduce-page .rp-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    .reduce-page .rp-table tr {
        margin: 0 0 16px 0;
        background: var(--white);
        border: 1px solid var(--grey);
        border-top: 3px solid var(--yellow);
    }

    .reduce-page .rp-table tbody th {
        padding: 12px 14px;
        border: 0;
        border-bottom: 1px solid var(--grey);
        font-size: 1.05rem;
        color: var(--text);
    }

    .reduce-page .rp-table td {
        padding: 10px 14px;
        border: 0;
        border-top: 1px solid #EBEBEB;
    }

    .reduce-page .rp-table tbody th + td {
        border-top: 0;
    }

    .reduce-page .rp-table td::before {
        content: attr(data-label);
        display: block;
        margin: 0 0 2px 0;
        color: #1D497C;
        font-size: 0.85rem;
        font-weight: bold;
        line-height: 1.35;
    }

    /* Calculator */
    .reduce-page .rp-calc {
        padding: 18px 16px;
    }

    .reduce-page .rp-calc-row {
        flex-direction: column;
    }

    .reduce-page .rp-calc input[type="text"] {
        flex: 0 0 auto;
    }

    .reduce-page .rp-calc-field.rp-invalid {
        margin: 0 -8px;
        padding: 10px 8px;
    }

    .reduce-page .rp-result-list li {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Sector cards: photo above the text */
    .reduce-page .rp-sector {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
        padding: 14px;
    }

    .reduce-page .rp-sector-media {
        max-width: 360px;
    }

    .reduce-page .rp-callout {
        padding: 20px 16px;
    }

    .reduce-page .rp-final {
        padding: 20px 16px;
    }
}

/* Phones: both process flows become one column, each box under the other with a down arrow */
@media (max-width: 640px) {

    .reduce-page .rp-flow-nodes,
    .reduce-page .rp-flow-chain {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .reduce-page .rp-flow li {
        flex-direction: column;
    }

    .reduce-page .rp-flow-step {
        flex: 0 0 auto;
        padding: 10px 12px;
    }

    .reduce-page .rp-flow-nodes li .rp-flow-arrow,
    .reduce-page .rp-flow-nodes li:nth-child(4n) .rp-flow-arrow,
    .reduce-page .rp-flow-nodes li:nth-child(2n) .rp-flow-arrow,
    .reduce-page .rp-flow-chain li .rp-flow-arrow,
    .reduce-page .rp-flow-chain li:nth-child(3n) .rp-flow-arrow,
    .reduce-page .rp-flow-chain li:nth-child(2n) .rp-flow-arrow {
        position: static;
        display: flex;
        width: auto;
        padding: 4px 0;
    }

    .reduce-page .rp-flow-arrow::before {
        content: "\2193";
    }
}

/* Very small screens (down to 320px) */
@media (max-width: 380px) {

    .reduce-page .rp-card-number {
        font-size: 1.6rem;
    }

    .reduce-page .rp-flow-step {
        padding: 7px 9px;
        font-size: 0.9rem;
    }
}
