body {
    margin: 0;
    padding: 0;
    color: #333;
    background: #F38129;
    font: 1em/1.2 "Helvetica Neue", Helvetica, Arial, Geneva, sans-serif;
    height: 100%;
    width: 100%;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 .5em;
    font-weight: 500;
    line-height: 1.0;
}

h1 {
    font-size: 2.25em;
}/* 36px */
h2 {
    font-size: 1.75em;
}/* 28px */
h3 {
    font-size: 1.375em;
}/* 22px */
h4 {
    font-size: 1.125em;
}/* 18px */
h5 {
    font-size: 1em;
}/* 16px */
h6 {
    font-size: .875em;
}/* 14px */

p {
    margin: 0 0 1.5em;
    line-height: 1.5;
}

blockquote {
    padding: 1em 2em;
    margin: 0 0 2em;
    border-left: 5px solid #eee;
}

hr {
    height: 0;
    margin-top: 1em;
    margin-bottom: 2em;
    border: 0;
    border-top: 1px solid #ddd;
}

table {
    background-color: transparent;
    border-spacing: 0;
    border-collapse: collapse;
    border-top: 1px solid #ddd;
}

th, td {
    padding: .2em 0.5em;
    vertical-align: top;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

a:link {
    color: royalblue;
}
a:visited {
    color: purple;
}
a:focus {
    color: black;
}
a:hover {
    color: green;
}
a:active {
    color: red;
}

/* -----------------------
Layout styles
------------------------*/

.container {
    height: 100%;
    padding: 0;
    margin: 0 auto;
    position: relative;
}

.container nav {
    float: left;
}

.header {
    position: relative;
    color: #F38129;
    background: #F38129;
    padding: 0.5em;
    min-height: 40px;
    display: inline;
}

.header li{
    display: inline-block;	
}

.header-heading {
    display: flex;
    align-items: center;
    position: relative;
    margin: 0;
    min-height: 100%;
}

.nav-bar {
    background: #005596;
    padding: 0;
    margin: 0;
    min-height: 35px;
}

.content {
    overflow-x: auto;
    overflow-y: visible;
    padding: 1em 1.25em;
    background-color: #fff;
    min-height: 70%;
}

.main, .aside {
    margin-bottom: 1em;
}

.footer {
    background-color: #005596;
    color: #fff;
    background: #000;
    padding: 0.5em 1.25em;
    min-height: 35px;
}

.footerOnIndex {
    background-color: #005596;
    color: #fff;
    background: #000;
    padding: 0.5em 1.25em;
    max-height: 35px;
}

.vertical-line {
    border-left: thin solid #005596;
}

textarea{
    width: 100%;
    max-width: 450px;
    min-width: 8em;
    box-sizing: border-box;
    height: 3em;
}

.wideText{
    width: 100%;
    max-width: 450px;
}

/* -----------------------
Nav
------------------------*/

.nav {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
}

#save {
    margin-left: auto;
}

.nav li {
    display: inline;
    margin: 0;
    position: relative;
    -moz-border-radius-topright: 5px;
    -moz-border-radius-bottomright: 5px;                
    -moz-border-radius-topleft: 5px;
    -moz-border-radius-bottomleft: 5px; 
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px; 
}

.nav a {
    display: block;
    padding: 10px 12px;
    color: #F38129;
    text-decoration: none;

    -moz-border-radius-topright: 5px;
    -moz-border-radius-bottomright: 5px;                
    -moz-border-radius-topleft: 5px;
    -moz-border-radius-bottomleft: 5px; 
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px; 
}

.nav>li>a:link {
    color: white;
}
.nav>li>a:visited {
    color: white;
}

input:invalid{
    outline: 2px solid red;
    outline-offset: -1px;
}

/*.nav>li>a:focus {
    color: black;
    background-color: #f1f1f1;
}*/

.nav>li>a:hover {
    color: black;
    background-color: #f1f1f1;
}

c.nav>li>a:active {
    color: white;
    background-color: #F38129;
}

.dropbtn {
    background-color: #005596;
    color: white;
    padding: 7px 0px 6px 0px;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    position: relative;
    z-index: 10;
    -moz-border-radius-topright: 5px;
    -moz-border-radius-bottomright: 5px;                
    -moz-border-radius-topleft: 5px;
    -moz-border-radius-bottomleft: 5px; 
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px; 
}


/* The container needed to position the dropdown content */ 
.dropdown { position: relative; display: inline-block; } 

/* Dropdown Content (Hidden by Default) */ 
.dropdown-content { display: none; 
                    position: absolute;
                    background-color: #f9f9f9;
                    min-width: 180px;
                    color: black;
                    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
                    z-index: 10;
}

/* Links inside the dropdown */
.dropdown-content a { color: black;
                      padding: 10px 12px;
                      text-decoration: none;
                      display: block;
                      min-width: 180px;
}


/* Change color of dropdown links on hover */
.dropdown-content a:hover { background-color: #f1f1f1 }


/* Show the dropdown menu on hover */
.dropdown:hover .dropdown-content { display: block; }

/* Also open on keyboard focus / tap (touch devices) */
.dropdown:focus-within .dropdown-content { display: block; }

/* Change the background color of the dropdown button when the dropdown content is shown */
.dropdown:hover .dropbtn { color: black; background-color: #f1f1f1; }

/* Change the background color of the dropdown button when the dropdown content is shown */
.dropdown-right:hover .dropbtn { background-color: #f1f1f1; }

.dropside-dropbtn {
    background-color: #f9f9f9;
    color: black;
    padding: 10px 12px;
    border: none;
    cursor: pointer;
    display: block;
    text-decoration: none;
    z-index: 10;
}

.active {
    background-color: #F38129;
    color: white;
}

/* Show the dropdown menu on hover */
.dropside:hover .dropside-content { display: block; }

/* Also open on keyboard focus / tap (touch devices) */
.dropside:focus-within .dropside-content { display: block; }

/* Change color of dropside links on hover */
.dropside-dropbtn:hover { background-color: #f1f1f1 }

/* Change the background color of the dropdown button when the dropdown content is shown */
.dropside:hover .dropside-dropbtn { background-color: #f1f1f1; }

/* The container needed to position the dropside content */ 
.dropside {
    position: relative;
    display: inline-block;
}

/* Dropdown Content (Hidden by Default) */ 
.dropside-content {        top:0;
                           left:100%;
                           display: none;
                           position: absolute;
                           background-color: #f9f9f9;
                           min-width: 385px;
                           max-width: min(385px, 90vw);
                           max-height: 80vh;
                           overflow-y: auto;
                           box-sizing: border-box;
                           box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
                           z-index: 1;
}


.aside { float: left;
         margin-bottom: 1em;
         padding: 20px;
}

.onIndexAside { float: left;
                margin-bottom: 1em;
                padding: 20px;
}

.navAside { float: left;
            margin-bottom: 0em;
            max-width: 40px;
            height: 83vh;
            position: relative;
}

/* Nav strips must hug the true left/right edges of the page, not float
   along with the content. Pull them out of the float flow and pin them to
   the (position:relative) .container edges; reserve 40px gutters so the
   form/aside never slide underneath. */
.content .container:has(#leftNavigationContent) {
    padding-left: 40px;
    padding-right: 40px;
    box-sizing: border-box;
}
#leftNavigationContent, #rightNavigationContent {
    position: absolute;
    top: 0;
}
#leftNavigationContent { left: 0; }
#rightNavigationContent { right: 0; }

.navAside a { display: flex;
              align-items: center;
              position: relative; 
              min-height: 100%;
              opacity: 0.5;
}

/* -----------}------------ Single styles ------------------------*/
.img-responsive { max-width: 100%; }

.btn {color: #fff !important;
      background-color: royalblue;
      border-color: #222;
      display: inline-block;
      padding: .5em 1em;
      margin-bottom: 0;
      font-weight: 400;
      line-height: 1.2;
      text-align: center;
      white-space: nowrap;
      vertical-align: middle;
      cursor: pointer; 
      border: 1px solid transparent; 
      border-radius: .2em; 
      text-decoration: none; 
} 

.btn:hover {
    color: #fff !important; 
    background-color: green; 
} 

.btn:focus { color: #fff !important; 
             background-color: black; 
} 

.btn:active { color: #fff !important; 
              background-color: red; 
} 

.table { width: 100%; 
         max-width: 100%; 
         margin-bottom: 20px; 
} 

.list-unstyled { padding-left: 0;
                 list-style: none; 
} 

.list-inline { padding: 0; 
               margin-left: -5px;
               list-style: none; 
} 

.list-inline > li { display: inline-block; 
                    padding: 0; 
} 

.rotate90 { display: none; 
            -webkit-transform: rotate(90deg);
            -moz-transform: rotate(90deg); 
            -o-transform: rotate(90deg);
            -ms-transform: rotate(90deg); 
            transform: rotate(90deg); 
} 

.rotate270 {
    display: none; 
    -webkit-transform: rotate(270deg); 
    -moz-transform: rotate(270deg); 
    -o-transform: rotate(270deg); 
    -ms-transform: rotate(270deg); 
    transform: rotate(270deg); 
} 

.onindex{ padding: 0; 
          float: left; 
} 

.image { position: relative; 
         width: 100%; 
}

.select-editable {
    position:relative;
    background-color:white;
    border:solid grey 1px;
    width:120px;
    min-height:28px;
    height:auto;
    overflow:visible;
}
.select-editable select {
    position:absolute;
    top:0px;
    left:0px;
    font-size:0.875rem;
    border:none;
    width:120px;
    margin:0;
}
.select-editable input {
    position:absolute;
    top:0px;
    left:0px;
    width:100px;
    padding:1px;
    font-size:0.75rem;
    border:none;
}
.select-editable select:focus, .select-editable input:focus {
    outline:none;
}

.tableWithoutBorders {
    border: none;
    border-collapse:collapse;
}

.tableWithoutBorders td{
    border: none;
    outline: none;
    padding: 0;
}

.tableWithoutBorders p{
    height: 10px;
    max-height: 10px;
    min-height: 10px;
}

.substanceTable {
    display: block;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
}

.substanceTable tr:nth-child(even) {
    background-color: #eee;
}
.substanceTable tr:nth-child(odd) {
    background-color: #fff;
}

.substanceTable th {
    padding: .2em 0.5em;
    vertical-align: top;
    text-align: left;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    width: auto;
    max-width: 80px;
}

.substanceTable td {
    padding: .2em 0.5em;
    vertical-align: top;
    text-align: left;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    width: auto;
    max-width: 80px;
    overflow: hidden;
    white-space: nowrap;
}

.substanceTable td:hover{
    text-overflow: clip;
    white-space: normal;
    word-break: break-all;
}

.largemain {
    position:relative;
    overflow:auto;
    margin-bottom: 1em;
}

.wrapper {
    overflow: auto;
    position: relative;
}

.small-wrapper {
    overflow: auto;
    position: relative;
    width: 69%;
    float: left
}

.hazardousSubstancesProperties{
    width: 100px;
    max-width: 100px;
    min-width: 100px;
}

.new-section-border-bottom{
    border-bottom: 3px solid;
}

.new-section-border-top{
    border-top: 3px solid;
}


.pop-outer {
    background-color: rgba(0, 0, 0, .5);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

}

.pop-inner {
    background-color: #fff;
    width: 90%;
    max-width: 600px;
    min-height: 300px;
    padding: 25px;
    margin: 15% auto;
    border: 2px solid #000;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    box-sizing: border-box;
}

.styled-select {
    height: 29px;
    max-width: 240px;
    overflow: hidden;
    background: transparent;
}

.styled-select select {
    background: transparent;
    border: none;
    font-size: 0.875rem;
    height: 29px;
    padding: 5px; /* If you add too much padding here, the options won't show in IE */
    max-width: 268px;
}

.semi-square {
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    border-radius: 5px;
}

.unit-select{
    max-width: 42px;
}

.styled-text{
    height: 23px;
    max-width: 200px;
    background: transparent;
}

.largeTextarea { width: 100%; max-width: 500px; min-height: 200px; max-height: 200px; box-sizing: border-box; resize: vertical; overflow: auto}

/* CR-10: the Beschreibung textareas from "Relevante Randbedingungen" downwards must be
   adjustable in width AND height. `.largeTextarea` pins max-width/max-height, which makes
   the resize handle a no-op; this variant drops both caps and allows resizing on both axes.
   `box-sizing: border-box` stays, and the enclosing table keeps `width: 100%`, so a resized
   box cannot break the surrounding 4-column layout (it only widens `.content`, which
   already has `overflow-x: auto`). */
.resizableTextarea { width: 100%; max-width: none; height: 200px; box-sizing: border-box; resize: both; overflow: auto}

/* CR-9: "Behälterform bitte jeweils farbig markieren" — highlight the selected
   Behälter radio's own label. Each <label> immediately follows its <input> in the
   markup, so the adjacent-sibling selector needs no JS. */
.containerTypeFieldset input[type="radio"]:checked + label { background-color: #ffe083; padding: 2px 4px; border-radius: 3px; }
.containerTypeFieldset label small { color: #666; font-weight: normal; }

/* CR-7: companys.php had N stacked Ändern/Speichern buttons per cell with no bound,
   pushing rows to arbitrary heights and forcing horizontal scroll on long descriptions.
   Caps each company's Sicherheitsfachkraft/Lager list to a fixed, independently
   scrollable height instead, and keeps each entry's name + its single visible button
   on one line with an ellipsis (full text still available via the `title` attribute). */
.companysTable { table-layout: fixed; width: 100%; }
.companysSubHeaderRow td { font-size: 0.85em; color: #666; }
.subEntryList { max-height: 130px; overflow-y: auto; display: block; }
.subEntryItem { display: flex; align-items: center; gap: 6px; padding: 2px 0; border-bottom: 1px solid #eee; }
.subEntryItem span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subEntryItem input[type="text"] { flex: 1 1 auto; min-width: 0; }
.subEntryButton { flex: 0 0 auto; }

/* Wide styles ------------------------*/

@media (min-width: 860px) 
{
    .header { padding: 0; } 
    .nav-bar { padding: 0em 0em; } 
    .content { padding: 0em 0em; } 
    .main { padding: 1em 0em 0em 0em; 
            float: left; 
            width: 69%;
            margin-bottom: 0em; 
    }

    .largemain{
        padding: 1em 0em 0em 0em; 
        float: left; 
        width: 100%;
        margin-bottom: 0em;
    }

    .onIndexMain{ padding: 0em 7em 0em 0em;
                  float: left; 
                  width: 40%;
                  height: 80vh;
                  margin-bottom: 0em; 
    } 

    .aside{ padding: 20px 0px 0px 20px; 
            float: left; 
            width: 23.5%;
            margin-bottom: 0em; 
    } 

    .onIndexAside{ padding: 20px 0px 0px 20px; 
                   float: left;
                   width: 45%; 
                   margin-bottom: 0em; 
    } 

    .onindex main { padding: 2em 1em 1em 1em;
                    float: left; 
                    width: 50%; 
                    margin-bottom: 0em; 
    } 

    .navAside {width: 40px;
               min-height: 120%;
    }

    #leftAside:hover{ background: #bcdbcb;
                      /* For browsers that do not support gradients */ 
                      background: -webkit-linear-gradient(left, #bcdbcb , white); 
                      /* For Safari 5.1 to 6.0 */ 
                      background: -o-linear-gradient(right, #bcdbcb, white); 
                      /* For Opera 11.1 to 12.0 */ 
                      background: -moz-linear-gradient(right, #bcdbcb, white); 
                      /* For Firefox 3.6 to 15 */ 
                      background: linear-gradient(to right, #bcdbcb , white);
                      /* Standard syntax */ 
    } 

    #rightAside:hover{
        background: #bcdbcb; 
        /* For browsers that do not support gradients */
        background: -webkit-linear-gradient(right, #bcdbcb , white);
        /* For Safari 5.1 to 6.0 */ 
        background: -o-linear-gradient(left, #bcdbcb, white);
        /* For Opera 11.1 to 12.0 */
        background: -moz-linear-gradient(left, #bcdbcb, white);
        /* For Firefox 3.6 to 15 */
        background: linear-gradient(to left, #bcdbcb , white);
        /* Standard syntax */ 
    }

    /* Arrow always visible; the grey gradient still only shows on hover.
       Sized to the 40px column (overrides the img's hardcoded width="256"). */
    .navAside img{ display: block;
                   width: 100%;
                   min-width: 0;      /* flex item min-width defaults to the
                                         img's 256px intrinsic size; without
                                         this it never shrinks to the column. */
                   height: auto;
    }
    .navAside a:hover{ opacity: 1; }

    .footer { max-height:30px;
              background-color: #005596;
              padding: 0.5em 1em; 
    }

    .footerOnIndex { max-height:30px;
                     background-color: #005596;
                     padding: 0.5em 1em; 
    }

    .nav>li { display: inline; 
              margin: 0 0 0 0; 
    }

    .nav>li>a { display: inline;
                border-bottom: 0; 
    }

} 

@media (min-width: 540px) and (max-width: 860px) { 
    .header { 
        padding: 1em 1em; 
    } 

    .nav-bar { 
        padding: 0em 0em; 
    }

    .content { padding: 3em 3em; } 
    .main { float: left; 
            width: 69%; 
            margin-right: 0%; 
            margin-bottom: 1em;
    }

    .largemain{
        float: left; 
        width: 100%; 
        margin-right: 0%; 
        margin-bottom: 1em; 
    }

    .aside { width: 25%; }
    .navAside { width: 40px; }
    .footer { padding: 1em 1em; max-height: 30px}
    .nav { padding: 0px 0px 4px 0px; }
    .nav>li { display: inline; 
              margin: 0 0 0 0; 
              z-index: 0; 
    }

    .nav>li>a { margin: 5px;
                display: inline;
                padding: 6px;
                border-bottom: 0;
    }
}

@media (max-width: 1350px) {
    .nav-sep { display: none; }
    .nav a { padding: 5px 3px 6px 3px; }
    .dropbtn { font-size: 0.875rem; }
}

@media (max-width: 900px) {
    .nav {
        overflow-x: auto;
        white-space: nowrap;
    }
    .small-wrapper {
        width: 100%;
        float: none;
    }
}

@media (max-width: 599px) {
    .content { padding: 0.5em; }
    .container { height: auto; }
    .wrapper, .small-wrapper { width: 100%; float: none; }
    .main { width: 100%; float: none; }
    .aside { width: 100%; float: none; padding: 20px 0; }
    .main table, .main tbody, .main tr, .main td { display: block; width: 100%; box-sizing: border-box; }
    .main td { border-bottom: 0; padding: .2em 0; }
}

@media (min-width: 600px) {
    .main table { display: table; width: 100%; }
    .main tbody { display: table-row-group; }
    .main tr { display: table-row; }
    .main td { display: table-cell; width: auto; padding: .2em 0.5em; border-bottom: 1px solid #ddd; }
}

/* UI-8 (rollout: description.php, protection.php, riskJudgement.php's main
   table — opt-in via class="formGrid" on the <table>).
   In the 600–900px band the 4/5-column label/field form table reflows to 2
   columns (label + field) via CSS grid, instead of a fixed-width table that
   can't shrink. Desktop (>=900) keeps the normal table; below 600 it stacks
   (the max-width:599 rule above).
   Each <tr> is its own subgrid (not display:contents on the row) so a row
   with an odd cell count or a colspan can't shift the column alignment of
   every row after it — the pilot version had cells flow continuously across
   the whole table, which broke on protection.php/riskJudgement.php's
   irregular rows. Cells with a colspan attribute (ignored by CSS grid
   otherwise) are forced to span both columns. Empty spacer cells collapse.
   Requires subgrid (Chrome/Edge 117+, Firefox 71+, Safari 16+); older
   browsers just fall back to a single stacked column — no breakage. */
@media (min-width: 600px) and (max-width: 900px) {
    table.formGrid {
        display: grid;
        grid-template-columns: minmax(120px, max-content) minmax(180px, 1fr);
        gap: .2em .5em;
        border-top: 0;
        width: 100%;
    }
    table.formGrid tbody {
        display: contents;
    }
    table.formGrid tr {
        display: grid;
        grid-template-columns: subgrid;
        grid-column: 1 / -1;
        gap: .2em .5em;
    }
    table.formGrid td {
        display: block;
        width: auto;
        padding: .2em 0;
        border-bottom: 1px solid #ddd;
        box-sizing: border-box;
    }
    /* spacer cells in section-header/colspan rows collapse (a cell holding a
       textarea/input is not :empty, so real fields are unaffected) */
    table.formGrid td:empty {
        display: none;
    }
    /* colspan is a table-model attribute; CSS grid ignores it entirely, so
       without this a colspan cell would just take one column like any other
       and desync every following cell in its row */
    table.formGrid td[colspan] {
        grid-column: 1 / -1;
    }
    /* bold section header spans the full row width */
    table.formGrid tr.new-section-border-top td:first-child {
        grid-column: 1 / -1;
        border-top: 2px solid #ccc;
        margin-top: .4em;
    }
}

@media (min-width: 900px) {
    .wrapper, .small-wrapper { float: left; }
    .main { float: left; width: 69%; }
    .aside { float: left; width: 23.5%; }
    .content .container { margin: 0 auto; }
}

@media (min-width: 1400px) {
    .content .container { max-width: 1500px; margin-inline: auto; }
}