/* =========================================================
   REYNOLDSZAHL-RECHNER
   Responsives CSS für Desktop, Tablet und Smartphone
   ========================================================= */


/* ---------------------------------------------------------
   Grundeinstellungen
   --------------------------------------------------------- */

.reynolds-rechner {
    width: 100%;
    max-width: 900px;
    margin: 20px auto;
    padding: 20px;
    box-sizing: border-box;

    background: #ffffff;
    border: 1px solid #d5d5d5;
    border-radius: 6px;

    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.45;

    color: #222;

    overflow: hidden;
}


/* ---------------------------------------------------------
   Überschrift
   --------------------------------------------------------- */

.reynolds-rechner h2 {
    margin: 0 0 18px 0;
    padding: 10px 12px;

    background: #eeeeee;

    border-left: 5px solid #777;

    font-size: 1.45rem;
    line-height: 1.25;
    font-weight: 600;

    box-sizing: border-box;
}


/* ---------------------------------------------------------
   Beschreibung
   --------------------------------------------------------- */

.rr-beschreibung {
    margin: 0 0 20px 0;
    padding: 0;
}


/* ---------------------------------------------------------
   Eingabebereich
   --------------------------------------------------------- */

.rr-eingaben {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr);

    gap: 12px 20px;

    width: 100%;
    box-sizing: border-box;
}


/* ---------------------------------------------------------
   Einzelnes Eingabefeld
   --------------------------------------------------------- */

.rr-feld {
    min-width: 0;
    box-sizing: border-box;
}


.rr-feld label {
    display: block;

    margin: 0 0 5px 0;

    font-weight: 600;

    line-height: 1.25;
}


/* ---------------------------------------------------------
   Eingabefelder und Select
   --------------------------------------------------------- */

.rr-feld input,
.rr-feld select {
    display: block;

    width: 100%;
    max-width: 100%;

    min-width: 0;

    height: 42px;

    padding: 8px 10px;

    box-sizing: border-box;

    border: 1px solid #aaa;
    border-radius: 4px;

    background: #fff;

    color: #222;

    font-family: inherit;
    font-size: 16px;

    outline: none;
}


/* Fokus */

.rr-feld input:focus,
.rr-feld select:focus {
    border-color: #555;

    box-shadow:
        0 0 0 2px rgba(0, 0, 0, 0.08);
}


/* ---------------------------------------------------------
   Einheit neben Durchfluss
   --------------------------------------------------------- */

.rr-durchfluss-zeile {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(110px, 0.45fr);

    gap: 8px;

    width: 100%;
}


.rr-durchfluss-zeile input,
.rr-durchfluss-zeile select {
    min-width: 0;
}


/* ---------------------------------------------------------
   Hinweis unter Feldern
   --------------------------------------------------------- */

.rr-hinweis {
    margin-top: 5px;

    font-size: 0.85rem;

    color: #666;
}


/* ---------------------------------------------------------
   Buttons
   --------------------------------------------------------- */

.rr-buttons {
    display: flex;

    flex-wrap: wrap;

    gap: 10px;

    margin-top: 20px;
}


.rr-buttons button {
    min-height: 42px;

    padding: 9px 18px;

    border: 1px solid #777;
    border-radius: 4px;

    background: #eeeeee;

    color: #222;

    font-family: inherit;
    font-size: 16px;

    cursor: pointer;

    box-sizing: border-box;
}


.rr-buttons button:hover {
    background: #dddddd;
}


.rr-buttons button:active {
    background: #cccccc;
}


/* ---------------------------------------------------------
   Fehlermeldung / Hinweis
   --------------------------------------------------------- */

.rr-fehler {
    display: none;

    margin-top: 15px;
    padding: 10px 12px;

    border: 1px solid #c8a800;

    background: #fff9d8;

    color: #5f5000;

    border-radius: 4px;

    box-sizing: border-box;
}


/* ---------------------------------------------------------
   Ergebnisbereich
   --------------------------------------------------------- */

.rr-ergebnis {
    margin-top: 25px;

    padding: 15px;

    border: 1px solid #ccc;
    border-radius: 5px;

    background: #f8f8f8;

    box-sizing: border-box;

    overflow: hidden;
}


.rr-ergebnis h3 {
    margin: 0 0 14px 0;

    font-size: 1.2rem;
}


/* ---------------------------------------------------------
   Ergebniswerte
   --------------------------------------------------------- */

.rr-ergebnis-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr);

    gap: 0;

    width: 100%;

    border-top: 1px solid #ccc;
    border-left: 1px solid #ccc;

    box-sizing: border-box;
}


.rr-ergebnis-zeile {
    display: grid;

    grid-template-columns:
        minmax(120px, 0.9fr)
        minmax(0, 1fr);

    min-width: 0;

    border-right: 1px solid #ccc;
    border-bottom: 1px solid #ccc;

    box-sizing: border-box;
}


.rr-ergebnis-label {
    min-width: 0;

    padding: 8px;

    background: #eeeeee;

    font-weight: 600;

    overflow-wrap: anywhere;
}


.rr-ergebnis-wert {
    min-width: 0;

    padding: 8px;

    background: #fff;

    overflow-wrap: anywhere;
}


/* ---------------------------------------------------------
   Reynolds-Zahl hervorheben
   --------------------------------------------------------- */

.rr-reynolds-ergebnis {
    margin-top: 18px;

    padding: 15px;

    text-align: center;

    border: 2px solid #777;
    border-radius: 5px;

    background: #fff;
}


.rr-reynolds-ergebnis .rr-reynolds-wert {
    display: block;

    margin-top: 5px;

    font-size: 2rem;
    line-height: 1.2;

    font-weight: bold;

    overflow-wrap: anywhere;
}


.rr-reynolds-ergebnis .rr-stroemungsart {
    margin-top: 8px;

    font-size: 1.1rem;
    font-weight: 600;
}


/* ---------------------------------------------------------
   Klassifizierung
   --------------------------------------------------------- */

.rr-klassifizierung {
    margin-top: 12px;

    padding: 10px;

    text-align: center;

    font-size: 0.95rem;

    box-sizing: border-box;
}


/* ---------------------------------------------------------
   Stoffdatentabelle
   --------------------------------------------------------- */

.rr-stoffdaten {
    width: 100%;

    margin-top: 30px;

    overflow-x: auto;

    -webkit-overflow-scrolling: touch;
}


.rr-stoffdaten h3 {
    margin: 0 0 10px 0;

    font-size: 1.15rem;
}


.rr-tabelle {
    width: 100%;

    min-width: 650px;

    border-collapse: collapse;

    font-size: 14px;
}


.rr-tabelle th,
.rr-tabelle td {
    padding: 7px 8px;

    border: 1px solid #ccc;

    text-align: left;

    white-space: nowrap;
}


.rr-tabelle th {
    background: #eeeeee;

    font-weight: 600;
}


/* ---------------------------------------------------------
   Tablet
   --------------------------------------------------------- */

@media (max-width: 700px) {

    .reynolds-rechner {
        margin: 15px 0;
        padding: 15px;

        border-radius: 4px;
    }


    .reynolds-rechner h2 {
        font-size: 1.3rem;

        padding: 9px 10px;
    }


    .rr-eingaben {
        grid-template-columns: 1fr;

        gap: 12px;
    }


    .rr-ergebnis-grid {
        grid-template-columns: 1fr;
    }


    .rr-ergebnis-zeile {
        grid-template-columns:
            minmax(130px, 0.8fr)
            minmax(0, 1.2fr);
    }
}


/* ---------------------------------------------------------
   Smartphone
   --------------------------------------------------------- */

@media (max-width: 480px) {

    .reynolds-rechner {
        width: 100%;

        margin: 10px 0;

        padding: 10px;

        border-left: 0;
        border-right: 0;

        border-radius: 0;
    }


    .reynolds-rechner h2 {
        margin-bottom: 15px;

        padding: 8px;

        font-size: 1.18rem;
    }


    .rr-beschreibung {
        font-size: 0.95rem;

        margin-bottom: 15px;
    }


    .rr-eingaben {
        gap: 10px;
    }


    .rr-feld label {
        font-size: 15px;
    }


    .rr-feld input,
    .rr-feld select {
        height: 44px;

        font-size: 16px;
    }


    .rr-durchfluss-zeile {
        grid-template-columns:
            minmax(0, 1fr)
            minmax(100px, 0.6fr);

        gap: 6px;
    }


    .rr-buttons {
        flex-direction: column;

        gap: 8px;
    }


    .rr-buttons button {
        width: 100%;

        min-height: 44px;
    }


    .rr-ergebnis {
        margin-top: 20px;

        padding: 10px;
    }


    .rr-ergebnis h3 {
        font-size: 1.1rem;
    }


    .rr-ergebnis-grid {
        display: block;
    }


    .rr-ergebnis-zeile {
        display: grid;

        grid-template-columns:
            minmax(115px, 0.9fr)
            minmax(0, 1.1fr);

        width: 100%;
    }


    .rr-ergebnis-label,
    .rr-ergebnis-wert {
        padding: 7px 6px;

        font-size: 14px;
    }


    .rr-reynolds-ergebnis {
        margin-top: 12px;

        padding: 12px;
    }


    .rr-reynolds-ergebnis .rr-reynolds-wert {
        font-size: 1.65rem;
    }


    .rr-reynolds-ergebnis .rr-stroemungsart {
        font-size: 1rem;
    }


    .rr-stoffdaten {
        margin-top: 20px;
    }


    .rr-tabelle {
        font-size: 13px;
    }
}


/* ---------------------------------------------------------
   Sehr kleine Smartphones
   --------------------------------------------------------- */

@media (max-width: 350px) {

    .reynolds-rechner {
        padding: 8px;
    }


    .rr-durchfluss-zeile {
        grid-template-columns: 1fr;
    }


    .rr-ergebnis-zeile {
        grid-template-columns: 1fr;
    }


    .rr-ergebnis-label {
        border-bottom: 0;
    }


    .rr-ergebnis-wert {
        padding-top: 4px;
    }


    .rr-reynolds-ergebnis .rr-reynolds-wert {
        font-size: 1.45rem;
    }
}


/* =========================================================
   DRUCK - DIN A4
   ========================================================= */

@media print {

    @page {
        size: A4 portrait;
        margin: 12mm;
    }


    html,
    body {
        margin: 0;
        padding: 0;

        width: 100%;

        background: #fff;
    }


    .reynolds-rechner {

        width: 100%;
        max-width: none;

        margin: 0;
        padding: 0;

        border: 0;
        border-radius: 0;

        font-size: 10pt;

        overflow: visible;
    }


    /* Beschreibung beim Drucken ausblenden */

    .rr-beschreibung {
        display: none !important;
    }


    /* Buttons ausblenden */

    .rr-buttons {
        display: none !important;
    }


    /* Stoffdatentabelle ausblenden */

    .rr-stoffdaten {
        display: none !important;
    }


    /* Hinweise ausblenden */

    .rr-hinweis {
        display: none !important;
    }


    /* Fehlermeldungen ausblenden */

    .rr-fehler {
        display: none !important;
    }


    .reynolds-rechner h2 {
        margin: 0 0 8px 0;

        padding: 5px 8px;

        font-size: 16pt;
    }


    .rr-eingaben {

        grid-template-columns:
            1fr 1fr;

        gap: 5px 12px;
    }


    .rr-feld label {
        margin-bottom: 2px;

        font-size: 9pt;
    }


    .rr-feld input,
    .rr-feld select {

        height: 25px;

        padding: 2px 5px;

        font-size: 9pt;

        border: 1px solid #888;
    }


    .rr-durchfluss-zeile {
        grid-template-columns:
            1fr 75px;

        gap: 4px;
    }


    .rr-ergebnis {

        margin-top: 10px;

        padding: 8px;

        border: 1px solid #999;

        page-break-inside: avoid;
        break-inside: avoid;
    }


    .rr-ergebnis h3 {

        margin: 0 0 5px 0;

        font-size: 11pt;
    }


    .rr-ergebnis-grid {

        grid-template-columns:
            1fr 1fr;

        border-top: 1px solid #aaa;
        border-left: 1px solid #aaa;
    }


    .rr-ergebnis-zeile {

        grid-template-columns:
            95px minmax(0, 1fr);

        font-size: 8.5pt;
    }


    .rr-ergebnis-label,
    .rr-ergebnis-wert {

        padding: 3px 5px;
    }


    .rr-reynolds-ergebnis {

        margin-top: 7px;

        padding: 7px;

        border: 1px solid #777;
    }


    .rr-reynolds-ergebnis .rr-reynolds-wert {

        font-size: 16pt;
    }


    .rr-reynolds-ergebnis .rr-stroemungsart {

        margin-top: 3px;

        font-size: 10pt;
    }


    .rr-klassifizierung {

        margin-top: 5px;

        padding: 4px;

        font-size: 8.5pt;
    }


    /* Druckfarbe erzwingen */

    * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}