body {
    margin: 0;
    overflow-x: hidden;
}

.header-section {
    z-index: 999;
    box-shadow: 0 1px 9px 0px #8f8f8f;
    width: 100%;
    overflow: hidden;
    padding: 0;
    background: #ffffff;
}

.logo {
    margin: 0 auto;
    background: #fff;
    float: left;
    padding: 10px 0;
}

.logo img {
    width: 130px;
    transition: all 1s ease 0s;
    -webkit-transition: all 1s ease 0s;
}

#time {
    text-align: center;
    position: absolute;
    right: 10px;
    top: 10px;
    font-size: 10px;
    font-weight: bold;
}

#time strong {
    color: #2ECC45;
    font-style: italic;
}

.panel-header {
    padding: 0;
    background: #FFF;
    font-weight: bolder;
    font-size: 17px;
    text-align: center;
    color: #2567b3;
    padding-bottom: 1px;
    padding-top: 1px;
}

.panel-content {
    padding: 1px;
}

.status-table table,
.status-table-new table {
    width: 50%;
    margin: 0 auto;
    border: 1.6px solid #2567b3;
    border-radius: 6px;
    border-collapse: separate;
    border-spacing: 0;
    font-family: Arial, Helvetica, sans-serif;
    word-break: normal; 
}

.status-table table thead,
.status-table-new table thead {
    color: #fff;
    background: #2567b3;
}

.status-table table th,
.status-table-new table th {
    padding: 3px 10px;
    text-align: left;
    font-size: 15px;
}

.status-table table td,
.status-table-new table td {
    padding: 3px 10px;
    border: 1px solid #ccc;
}

.status-table table thead tr:first-child th:first-child,
.status-table-new table thead tr:first-child th:first-child {
    border-top-left-radius: 5px;
}

.status-table table thead tr:first-child th:last-child,
.status-table-new table thead tr:first-child th:last-child {
    border-top-right-radius: 5px;
}

.status-table table tbody tr:last-child td:first-child,
.status-table-new table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 6px;
}

.status-table table tbody tr:last-child td:last-child,
.status-table-new table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 6px;
}

.status-table tbody td,
.status-table-new tbody td {
    border: none;
    border-top: solid 1px #957030;
    background: #fff;
    white-space: pre-wrap;
    max-width: 200px;
    word-break: normal;
    overflow-wrap: break-word;
}

@media only screen and (max-width: 500px) {
    .status-table table,
    .status-table-new table {
        width: 100%;
    }
    .status-table tbody td,
    .status-table-new tbody td {
        word-break: normal;
        max-width: 100%;
    }
}

/* ==========================================================================
   STATUS ICONS & LEGEND
   ========================================================================== */

.success,
.status-available:before {
    background: url(../images/correct.png) no-repeat 0 0;
    background-size: 20px 27px;
}

.failure,
.status-disruption:before {
    background: url(../images/close.png) no-repeat 0 0;
    background-size: 20px 27px;
}

.maintenance,
.status-maintenance:before {
    background: url(../images/maintenance.png) no-repeat 0 0;
    background-size: 20px 27px;
}

.success, .failure, .maintenance {
    width: 20px;
    height: 22px;
    margin: -2px 0;
    padding: 0;
    flex-shrink: 0;
}

.status-maintenance:before,
.status-maintenance {
    width: 19px;
    height: 25px;
    margin: -6px 0;
}

.status-info-container {
    width: 100%;
    margin: 0 auto;
    text-align: center;
    background-color: #ffc632;
    padding: 5px;
}

.status-info-container strong {
    font-weight: bold;
    font-size: 13px;
    padding: 8px;
    font-family: Helvetica, Arial, sans-serif;
}

.status-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.status-text {
    color: #555;
    font-size: 14px;
}

.show-status {
    white-space: nowrap;
}

#status-table .status-line {
    justify-content: flex-start;
    min-width: 140px;
}

#disrupted-table .status-line {
    min-width: 220px;
}

/* ==========================================================================
   INDENTATION & ALIGNMENT FIX
   ========================================================================== */

.toggle-icon {
    display: inline-block;
    width: 1.5em;
    text-align: center;
    font-size: 1.15em;
    font-weight: bold;
    color: #2567b3;
    margin-right: 4px;
    transition: color 0.2s;
}

.child-indent {
    display: inline-block;
    width: 1.5em;
    text-align: center;
    font-size: 1.1em;
    margin-right: 4px;
}

.no-indent {
    display: inline-block;
    width: 1.5em;
    margin-right: 4px;
}

.site-name {
    padding-left: 20px !important;
}

.child-row .site-name {
    padding-left: 20px !important;
    font-size: 0.935em;
    color: #444;
    padding: 7px 20px !important;
}

.child-row .site-name + td {
    padding: 7px 20px !important;
    font-size: 0.935em;
}

/* ==========================================================================
   DURATION VISIBILITY RULES
   ========================================================================== */

#status-table .status-text {
    display: none;
}

/* Show duration on hover (desktop only) */
#status-table .status-line:hover .status-text,
#status-table .status:hover + .status-text,
#status-table .status.blink:hover + .status-text {
    display: inline !important;
}

/* ==========================================================================
   TABLE ROW STYLING
   ========================================================================== */

#disrupted-table tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

#disrupted-table tbody tr:nth-child(even) {
    background-color: #d1d5db;
}

#status-table tbody tr {
    background-color: #ffffff;
}

#status-table td,
#disrupted-table td {
    background-color: inherit;
}

/* White groups (even) */
#status-table tbody tr[data-group="g0"],
#status-table tbody tr[data-group="g2"],
#status-table tbody tr[data-group="g4"],
#status-table tbody tr[data-group="g6"],
#status-table tbody tr[data-group="g8"],
#status-table tbody tr[data-group="g10"],
#status-table tbody tr[data-group="g12"],
#status-table tbody tr[data-group="g14"],
#status-table tbody tr[data-group="g16"],
#status-table tbody tr[data-group="g18"],
#status-table tbody tr[data-group="g20"],
#status-table tbody tr[data-group="g22"],
#status-table tbody tr[data-group="g24"],
#status-table tbody tr[data-group="g26"],
#status-table tbody tr[data-group="g28"] {
    background-color: #ffffff;
}

/* Grey groups (odd) */
#status-table tbody tr[data-group="g1"],
#status-table tbody tr[data-group="g3"],
#status-table tbody tr[data-group="g5"],
#status-table tbody tr[data-group="g7"],
#status-table tbody tr[data-group="g9"],
#status-table tbody tr[data-group="g11"],
#status-table tbody tr[data-group="g13"],
#status-table tbody tr[data-group="g15"],
#status-table tbody tr[data-group="g17"],
#status-table tbody tr[data-group="g19"],
#status-table tbody tr[data-group="g21"],
#status-table tbody tr[data-group="g23"],
#status-table tbody tr[data-group="g25"],
#status-table tbody tr[data-group="g27"],
#status-table tbody tr[data-group="g29"] {
    background-color: #d1d5db;
}

#status-table tbody tr td[style*="padding-left: 20px"] {
    border-top: 1px solid #cbd5e1;
    border-bottom: 1px solid #cbd5e1;
    font-size: 1.04em;
    font-weight: 600;
    color: #111;
}

#status-table tbody tr[data-group] {
    border-top: 1px solid #dee2e6;
}

#status-table tbody tr[data-group]:first-of-type {
    border-top: 2px solid #cbd5e1;
}

/* ==========================================================================
   PARENT ROW INTERACTION
   ========================================================================== */

.parent-row {
    cursor: pointer;
    user-select: none;
}

.parent-row:hover {
    background-color: #f0f4f8 !important;
}

.parent-row:hover .toggle-icon {
    color: #1e4e8c;
}

/* ==========================================================================
   MOBILE FIXES – improved wrapping + no scroll
   ========================================================================== */

@media only screen and (max-width: 768px) {

    .status-table table,
    .status-table-new table {
        width: 100% !important;
        margin: 0;
        border-radius: 0;
        border: none;
        table-layout: fixed;
    }

    #status-table th:nth-child(1),
    #status-table td:nth-child(1) {
        width: 60%;
    }

    #status-table th:nth-child(2),
    #status-table td:nth-child(2) {
        width: 40%;
    }

    .status-line {
        white-space: normal !important;
        flex-wrap: wrap !important;
        gap: 6px 10px;
        align-items: flex-start;
        min-width: 0 !important;
        width: 100%;
    }

    .status,
    .status.blink {
        flex-shrink: 0;
        align-self: flex-start;
        margin-top: 2px;
    }

    td.site-name,
    .status-text,
    .show-status {
        white-space: normal !important;
        word-break: normal !important;  
        overflow-wrap: break-word !important;
        hyphens: auto;
    }

    #status-table tbody tr,
    #disrupted-table tbody tr {
        min-height: 54px;
    }

    .status-table td,
    .status-table th {
        padding: 10px 8px !important;
        vertical-align: top;
    }

    body {
        overflow-x: hidden !important;
    }

    .panel-content {
        padding: 0 6px;
        box-sizing: border-box;
    }

    .show-status {
        padding: 10px 6px 10px 4px !important;
    }
}

.status-available:before,
.status-disruption:before,
.status-maintenance:before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 22px;
    background-size: 20px 27px;
    margin-right: 6px;
    vertical-align: middle;
}

/* ==========================================================================
   BLINK ANIMATION
   ========================================================================== */

.blink {
    -webkit-animation-name: blinker;
    -webkit-animation-duration: 0.3s;
    -webkit-animation-iteration-count: 2;
    -webkit-animation-timing-function: ease-in-out;
    -webkit-animation-direction: alternate;
    animation-name: blinker;
    animation-duration: 0.3s;
    animation-iteration-count: 2;
    animation-timing-function: ease-in-out;
    animation-direction: alternate;
}

@-webkit-keyframes blinker {
    from { opacity: 1.0; }
    to   { opacity: 0.0; }
}

/* ==========================================================================
   OTHER SECTIONS
   ========================================================================== */

.top-header {
    padding: 15px;
    background: #2D3752;
}

.top-header p {
    color: #fff;
    margin: 0;
}

.about-tally-container {
    background: #2567b3;
    padding: 15px 0 0;
}

.about-tally-container h2 {
    color: #fff;
    margin-top: 0;
}

.about-tally-container p {
    color: #fff;
    font-size: 16px;
    margin: 0;  
}

.content-part {
    float: left;
    width: 70%;
}

.support-logo {
    width: 30%;
    float: left;
}

.support-logo img {
    width: 200px;
}

@media (max-width: 640px) {
    .tally-panel {
        width: 80%;
        margin: 0 auto;
    }
    .content-part {
        width: 100%;
    }
    .support-logo img {
        width: 100%;
    }
    .status-info-container strong {
        font-size: 10px;
    }
}

#disrupted-section .panel-header {
    color: #d9534f;
    margin-bottom: 20px;
}

#disrupted-table .status.failure,
#disrupted-table .status.maintenance {
    font-weight: bold;
}

#disrupted-table small {
    color: #666;
    font-size: 0.9em;
}

.footer {
    position: static;
    left: 0;
    bottom: 0;
    width: 100%;
    text-align: center;
    font-style: italic;
    padding-top: 15px;
}

@media (max-width: 1024px) {
    .footer {
        position: unset;
    }
}

/* ==========================================================================
   CENTER SERVICE NAMES + REDUCE SPACING ON MOBILE ONLY
   ========================================================================== */

@media only screen and (max-width: 768px) {

    /* Ensure duration is hidden by default on mobile (JS will show on tap) */
    #status-table .status-text {
        display: none !important;
    }
}