* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --theme-bg-1: #0F172A;
    --theme-bg-2: #1E293B;
    --theme-bg-1-rgb: 15, 23, 42;
    --theme-bg-2-rgb: 30, 41, 59;
    --theme-accent: #22D3EE;
    --theme-accent-hover: #06B6D4;
    --theme-accent-rgb: 34, 211, 238;
    --theme-text-muted: #a6afbd;
    --theme-text-muted-rgb: 100, 116, 139;
    --theme-text-secondary: #a7b2c3;
    --theme-panel-border: #334155;
}

html {
    overscroll-behavior-y: none;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--theme-bg-1) 0%, var(--theme-bg-2) 100%);
    color: #F4F4F4;
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    /* Support for iPhone notch and bottom gesture bar */
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
    /* Add safe area padding for iPhone notch and bottom gesture bar */
    padding-bottom: calc(2rem + env(safe-area-inset-bottom));
}

body.top-bar-visible .container {
    padding-top: calc(2rem + 2.50rem + env(safe-area-inset-top));
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 1rem;
    padding: 0.75rem 0;
}

/* User Auth Info - Fixed Top Bar */
.user-auth-info {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    min-height: 2.50rem;
    display: flex;
    padding-top: calc(0.24rem + env(safe-area-inset-top));
    padding-bottom: 0.24rem;
    background: rgba(var(--theme-bg-1-rgb), 0.96);
    border-bottom: 1px solid rgba(var(--theme-text-muted-rgb), 0.5);
    backdrop-filter: blur(10px);
    font-size: 0.9rem;
    z-index: 2000;
}

.top-bar-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.top-bar-user-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.top-bar-home-link {
    font-size: 2.05rem;
    font-weight: 800;
    padding: 0.18rem 0.3rem;
}

.top-bar-nav-link {
    font-size: 0.9rem;
    font-weight: 600;
}

.user-email-header {
    color: var(--theme-text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.btn-text {
    background: none;
    border: none;
    color: var(--theme-accent);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-text:hover {
    color: var(--theme-accent-hover);
    text-decoration: underline;
}

.user-menu-email {
    display: none;
    padding: 0.6rem 1rem 0.5rem;
    font-size: 0.8rem;
    color: var(--theme-text-muted);
    border-bottom: 1px solid rgba(var(--theme-text-muted-rgb), 0.3);
    word-break: break-all;
}

/* Responsive adjustment for mobile */
@media (max-width: 768px) {
    body.top-bar-visible .container {
        padding-top: calc(1rem + 4.8rem + env(safe-area-inset-top));
    }

    .user-auth-info {
        font-size: 0.75rem;
        min-height: auto;
        padding: calc(0.48rem + env(safe-area-inset-top)) 0.75rem 0.54rem 0.75rem;
    }

    .top-bar-content {
        padding: 0 0.75rem;
    }

    .top-bar-user-actions {
        gap: 0.5rem;
    }

    .user-email-header {
        display: none;
    }

    .user-menu-email {
        display: block;
    }

    .btn-text {
        font-size: 0.75rem;
    }

    .top-bar-monitors-link {
        font-size: 1.78rem;
    }
}

/* User Menu Dropdown */
.user-menu-dropdown {
    position: relative;
}

.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.user-menu-content {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: rgba(var(--theme-bg-2-rgb), 0.95);
    border: 1px solid rgba(var(--theme-text-muted-rgb), 0.5);
    border-radius: 0.5rem;
    backdrop-filter: blur(10px);
    min-width: 180px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    overflow: hidden;
}

.user-menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    color: #E2E8F0;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-align: left;
}

.user-menu-item:hover {
    background: rgba(100, 116, 139, 0.3);
}

.user-menu-item svg {
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .user-menu-content {
        min-width: 160px;
    }

    .user-menu-item {
        font-size: 0.75rem;
        padding: 0.65rem 0.85rem;
    }
}

/* Timezone Sub-section (inside user menu) */
.user-menu-tz-section {
    border-top: 1px solid rgba(100, 116, 139, 0.2);
}

.tz-menu-content {
    background: rgba(var(--theme-bg-2-rgb), 0.5);
}

.tz-search-wrapper {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(100, 116, 139, 0.2);
}

.tz-search-input {
    width: 100%;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(100, 116, 139, 0.4);
    border-radius: 0.25rem;
    color: #E2E8F0;
    font-size: 0.8rem;
    padding: 0.35rem 0.5rem;
    outline: none;
    box-sizing: border-box;
}

.tz-search-input:focus {
    border-color: var(--theme-accent, #22D3EE);
}

.tz-list {
    max-height: 240px;
    overflow-y: auto;
}

.tz-item {
    display: block;
    width: 100%;
    padding: 0.45rem 0.9rem;
    background: none;
    border: none;
    color: #E2E8F0;
    font-size: 0.8rem;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tz-item:hover {
    background: rgba(var(--theme-accent-rgb), 0.15);
    color: var(--theme-accent);
}

.tz-item.active {
    background: rgba(var(--theme-accent-rgb), 0.2);
    color: var(--theme-accent);
    font-weight: 600;
}

.logo {
    font-size: 2.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--theme-accent), var(--theme-accent-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 30px rgba(var(--theme-accent-rgb), 0.3);
}

.tagline {
    color: var(--theme-text-muted);
    font-size: 1.1rem;
    font-weight: 400;
}

/* Auth Container */
.auth-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Buttons */
.btn {
    background: linear-gradient(135deg, var(--theme-accent), var(--theme-accent-hover));
    color: var(--theme-bg-1);
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(var(--theme-accent-rgb), 0.2);
    position: relative;
    z-index: 1;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(var(--theme-accent-rgb), 0.3);
    z-index: 10;
}

.btn-danger {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: #F4F4F4;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: #F4F4F4;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.2);
}

.btn-warning:hover {
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #10B981, #059669);
    color: #F4F4F4;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Cards */
.card {
    background: rgba(var(--theme-bg-2-rgb), 0.8);
    border: 1px solid var(--theme-text-muted);
    border-radius: 1rem;
    padding: 1.5rem;
    margin: 1rem 0;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    border-color: var(--theme-accent);
}

#signin-page .card:hover,
#signup-page .card:hover,
.card-static:hover {
    transform: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border-color: var(--theme-text-muted);
    cursor: default;
}

/* Form Styles */
.form-container {
    background: rgba(var(--theme-bg-2-rgb), 0.6);
    border: 1px solid var(--theme-text-muted);
    border-radius: 1rem;
    padding: 2rem;
    margin: 2rem 0;
    backdrop-filter: blur(10px);
    max-width: 100%;
    overflow-x: hidden;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--theme-accent);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(var(--theme-bg-1-rgb), 0.8);
    border: 1px solid var(--theme-text-muted);
    border-radius: 0.5rem;
    color: #F4F4F4;
    font-size: 1rem;
    transition: all 0.3s ease;
    max-width: 100%;
    box-sizing: border-box;
}

/* Fix datetime-local input to prevent calendar icon from hiding minutes */
.form-input[type="datetime-local"] {
    padding-right: 2.5rem;
}

/* Make calendar icon more visible on dark background */
.form-input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(0.8) brightness(1.2);
    cursor: pointer;
}

.form-input:focus {
    outline: none;
    border-color: var(--theme-accent);
    box-shadow: 0 0 0 3px rgba(var(--theme-accent-rgb), 0.1);
}

.form-input::placeholder {
    color: var(--theme-text-muted);
}

/* Global autofill override — browser autofill ignores normal CSS/inline styles */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px var(--theme-bg-1) inset !important;
    -webkit-text-fill-color: #E2E8F0 !important;
    caret-color: #E2E8F0;
}

.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(var(--theme-bg-1-rgb), 0.8);
    border: 1px solid var(--theme-text-muted);
    border-radius: 0.5rem;
    color: #F4F4F4;
    font-size: 1rem;
    transition: all 0.3s ease;
    max-width: 100%;
    box-sizing: border-box;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748B' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.form-select:focus {
    outline: none;
    border-color: var(--theme-accent);
    box-shadow: 0 0 0 3px rgba(var(--theme-accent-rgb), 0.1);
}

.form-select option {
    background: #1E293B;
    color: #F4F4F4;
}

.form-help {
    color: var(--theme-text-muted);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.form-help a,
.form-help a:visited {
    color: var(--theme-accent);
    text-decoration: underline;
}

.form-help a:hover,
.form-help a:focus {
    color: var(--theme-accent-hover);
}

/* Advanced settings collapsible section */
.advanced-section {
    border: 1px solid var(--theme-panel-border);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
}

.advanced-section-summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--theme-text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    user-select: none;
}

.advanced-section-summary:hover {
    color: var(--theme-text-secondary);
}


/* Header row styles for key-value pairs */
.headers-container,
.edit-headers-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.header-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.header-row .form-input {
    margin-bottom: 0;
}

.header-row button {
    flex-shrink: 0;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox {
    width: 1.2rem;
    height: 1.2rem;
    accent-color: var(--theme-accent);
}

/* Section headers with action buttons */
.section-header-with-action {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    gap: 1rem;
}

.section-header-with-action>div {
    flex: 1;
}

/* Responsive header layout */
@media (max-width: 768px) {
    .section-header-with-action {
        flex-direction: column;
        align-items: stretch;
    }

    .section-header-with-action button {
        align-self: flex-start;
    }
}

/* Job Rows - Compact Table-like Design */
.job-row {
    background: rgba(var(--theme-bg-2-rgb), 0.8);
    border: 1px solid var(--theme-text-muted);
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    min-height: 60px;
    overflow: visible;
    max-width: 100%;
    position: relative;
    z-index: 1;
}

.job-row:hover {
    border-color: var(--theme-accent);
    box-shadow: 0 4px 16px rgba(var(--theme-accent-rgb), 0.1);
    z-index: 2;
}

.job-row-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
    overflow: visible;
}

.job-name {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
    overflow: hidden;
}

.job-title {
    color: var(--theme-accent);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    word-break: break-word;
    overflow-wrap: break-word;
    cursor: pointer;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

.job-title:hover {
    color: var(--theme-accent-hover);
    text-decoration: underline;
}

.job-url {
    color: #F4F4F4;
    font-size: 0.9rem;
    opacity: 0.8;
    font-family: monospace;
    word-break: break-all;
    overflow-wrap: break-word;
    margin-right: 0.5rem;
}

.job-details {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.job-detail {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    font-size: 0.85rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.job-detail-label {
    color: var(--theme-text-muted);
    font-weight: 500;
}

.job-detail-value {
    color: #F4F4F4;
    font-weight: 600;
}

.back-to-top-link {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    color: var(--theme-text-secondary);
    font-size: 0.8rem;
    text-decoration: none;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, color 0.2s ease;
    z-index: 25;
}

.back-to-top-link.visible {
    opacity: 0.75;
    pointer-events: auto;
}

.back-to-top-link:hover,
.back-to-top-link:focus {
    color: var(--theme-text-secondary);
    opacity: 1;
}

.job-status {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

/* Health Indicator Styles */
.health-indicator {
    display: inline-flex;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
}

.health-indicator-loading {
    color: var(--theme-text-muted);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.health-indicator-healthy {
    color: #10B981;
    font-weight: 700;
}

.health-indicator-unhealthy {
    color: #EF4444;
    font-weight: 700;
}

.health-indicator-error {
    color: #F59E0B;
    font-weight: 700;
}

.job-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

/* Small button variant */
.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

#detail-edit-btn,
.btn-no-glow {
    box-shadow: none;
}

#detail-edit-btn:hover,
.btn-no-glow:hover {
    box-shadow: none;
    transform: none;
    filter: brightness(1.15);
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
    .job-row {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 0.75rem;
    }

    .job-actions {
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .job-details {
        justify-content: flex-start;
        gap: 0.75rem;
    }

    .job-title {
        font-size: 1rem;
    }

    .job-url {
        font-size: 0.8rem;
    }
}

/* Extra small screens - mobile phones */
@media (max-width: 480px) {
    .container {
        padding: 1rem 0.5rem;
    }

    .job-row {
        padding: 0.5rem;
        margin: 0.5rem 0;
    }

    .job-title {
        font-size: 0.95rem;
    }

    .job-url {
        font-size: 0.75rem;
    }

    .job-actions {
        width: 100%;
    }

    .job-actions button {
        flex: 1;
        min-width: 0;
        white-space: nowrap;
    }

    .btn-sm {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }

    .job-details {
        gap: 0.5rem;
    }

    .job-detail {
        font-size: 0.75rem;
    }

    .job-status {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }

    .back-to-top-link {
        right: 0.75rem;
        bottom: 0.75rem;
    }
}

/* Status indicators */
.status-enabled {
    color: #10B981;
    font-weight: 600;
}

.status-disabled {
    color: #EF4444;
    font-weight: 600;
}

/* Tooltip styles */
.tooltip-container {
    position: relative;
    display: inline-block;
    margin-left: 0.25rem;
    z-index: 1;
}

.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--theme-text-muted);
    color: #F4F4F4;
    font-size: 10px;
    font-weight: bold;
    cursor: help;
    transition: all 0.2s ease;
}

.tooltip-icon:hover {
    background: var(--theme-accent);
    transform: scale(1.1);
}

.tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(var(--theme-bg-1-rgb), 0.95);
    color: #F4F4F4;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.8rem;
    line-height: 1.4;
    white-space: nowrap;
    max-width: 250px;
    white-space: normal;
    width: max-content;
    border: 1px solid var(--theme-text-muted);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    transition: all 0.2s ease;
    pointer-events: none;
}

.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(var(--theme-bg-1-rgb), 0.95);
}

.tooltip-container:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Region Count Hover Tooltip */
.region-count-container {
    position: relative;
    display: inline-block;
    cursor: help;
}

.region-count-hover {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(var(--theme-bg-1-rgb), 0.95);
    color: #F4F4F4;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.8rem;
    line-height: 1.4;
    white-space: nowrap;
    border: 1px solid var(--theme-text-muted);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    transition: all 0.2s ease;
    pointer-events: none;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    max-width: 300px;
    min-width: max-content;
}

.region-count-hover::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-bottom-color: rgba(var(--theme-bg-1-rgb), 0.95);
}

.region-count-container:hover .region-count-hover {
    visibility: visible;
    opacity: 1;
}

/* Monitor Detail Table - compact, no hover */
.monitor-detail-table td {
    padding: 0.5rem 1rem;
}

.monitor-detail-table-container {
    overflow-x: visible;
}

.monitor-detail-table {
    min-width: 0;
    table-layout: fixed;
}

.monitor-detail-table td {
    white-space: normal;
}

.monitor-detail-table td:first-child {
    white-space: nowrap;
}

#job-detail-regions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    align-items: center;
}

.job-detail-region-item {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.monitor-detail-table tbody tr {
    cursor: default;
}

.monitor-detail-table tbody tr:hover {
    background: transparent;
}

/* Loading and Messages */
.loading {
    text-align: center;
    color: var(--theme-accent);
    font-size: 1.1rem;
    padding: 2rem;
}

.error {
    color: #EF4444;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
}

.success {
    color: #10B981;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
}

.test-ping-result {
    margin-top: 1rem;
    padding: 1rem 1.1rem;
    background: linear-gradient(135deg, rgba(var(--theme-bg-1-rgb), 0.96) 0%, rgba(var(--theme-bg-2-rgb), 0.92) 100%);
    border: 1px solid rgba(var(--theme-accent-rgb), 0.38);
    border-radius: 0.75rem;
    box-shadow: 0 8px 24px rgba(var(--theme-bg-1-rgb), 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    color: #F4F4F4;
}

.test-ping-result-title {
    margin-top: 0;
    margin-bottom: 0.75rem;
    color: var(--theme-accent);
    font-size: 1.15rem;
    line-height: 1.2;
}

.test-ping-result-status {
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.test-ping-result-message {
    margin-bottom: 0.75rem;
}

.test-ping-result-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.test-ping-result-table tr {
    border-bottom: 1px solid rgba(100, 116, 139, 0.25);
}

.test-ping-result-table tr:last-child {
    border-bottom: none;
}

.test-ping-label {
    padding: 0.4rem 0;
    color: var(--theme-text-secondary);
    font-weight: 600;
    width: 62%;
}

.test-ping-value {
    padding: 0.4rem 0;
    color: #F4F4F4;
    font-weight: 500;
    text-align: left;
    padding-left: 0.5rem;
    white-space: nowrap;
}

/* Section Headers */
.section-header {
    color: #F4F4F4;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
    hyphens: auto;
}

.section-subheader {
    color: var(--theme-text-muted);
    text-align: center;
    margin-bottom: 2rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

.back-link {
    display: inline-block;
    margin-bottom: 1rem;
    color: var(--theme-accent);
    text-decoration: none;
    font-size: 0.95rem;
}

.back-link:hover {
    text-decoration: underline;
}

.section-url {
    color: var(--theme-accent);
    text-align: center;
    font-family: monospace;
    font-size: 0.95rem;
    margin-top: -1rem;
    margin-bottom: 2rem;
    overflow-wrap: break-word;
    max-width: 100%;
}

.section-url a {
    color: inherit;
    text-decoration: none;
}

.section-url a:hover {
    text-decoration: underline;
}

#job-detail-url a {
    color: inherit;
    text-decoration: none;
    cursor: default;
}

#job-detail-url a:hover {
    text-decoration: underline;
    cursor: default;
}

#job-detail-status .job-status {
    padding: 0;
    border-radius: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
        /* Ensure safe area padding on smaller screens */
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
        max-width: 100%;
    }

    .logo {
        font-size: 2rem;
    }

    .job-info {
        grid-template-columns: 1fr;
    }

    .form-container {
        padding: 1.5rem;
        margin-left: 0;
        margin-right: 0;
    }

    .section-header {
        font-size: 1.3rem;
        line-height: 1.3;
        padding: 0 0.5rem;
    }

    .section-subheader {
        font-size: 0.9rem;
        line-height: 1.4;
        padding: 0 0.5rem;
    }

    .btn {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* Extra small screens - mobile phones */
@media (max-width: 480px) {
    .container {
        padding: 1rem 0.5rem;
        /* Extra padding for bottom gesture bar on iPhone */
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
        max-width: 100%;
    }

    .logo {
        font-size: 1.75rem;
    }

    .tagline {
        font-size: 0.95rem;
    }

    .section-header {
        font-size: 1.1rem;
        line-height: 1.3;
        padding: 0 0.25rem;
    }

    .section-subheader {
        font-size: 0.85rem;
        line-height: 1.4;
        padding: 0 0.25rem;
    }

    .form-container {
        padding: 1rem;
        /* Add extra bottom padding for safe area */
        margin-bottom: calc(1rem + env(safe-area-inset-bottom));
        margin-left: 0;
        margin-right: 0;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}

/* Animations */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* Glassmorphism effect */
.glass {
    background: rgba(var(--theme-bg-2-rgb), 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(100, 116, 139, 0.2);
}

/* Date Filter Controls */
.date-filter-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
    padding-top: 2px;
}

@media (max-width: 768px) {
    .date-filter-buttons {
        gap: 0.5rem;
        justify-content: stretch;
    }

    .date-filter-buttons .btn {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
        white-space: nowrap;
        flex: 1 1 auto;
    }
}

@media (max-width: 480px) {
    .date-filter-buttons {
        flex-direction: row;
        width: 100%;
        gap: 0.25rem;
    }

    .date-filter-buttons .btn {
        width: auto;
        flex: 1 1 0%;
        min-width: 0;
        font-size: 0.7rem;
        padding: 0.5rem 0.15rem;
        white-space: normal;
        line-height: 1.2;
        overflow-wrap: break-word;
    }
}

/* Date/Time Input Grid */
.date-time-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
}

@media (max-width: 768px) {
    .date-time-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .date-time-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .date-time-grid .btn {
        width: 100%;
    }
}

/* Regional Performance Summary Grid */
.region-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    max-width: 100%;
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.region-stats-title {
    color: #F4F4F4;
    margin-bottom: 1rem;
    text-align: center;
    overflow-wrap: break-word;
}

.region-map-spacing {
    margin-bottom: 1.5rem;
}

.region-stat-row {
    margin-bottom: 0.5rem;
}

.region-stat-count {
    color: var(--theme-text-muted);
    font-size: 0.9rem;
}

.region-latency-label {
    color: #F4F4F4;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    font-family: Inter, sans-serif;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.region-popup-theme .leaflet-popup-content-wrapper {
    background: rgba(var(--theme-bg-1-rgb), 0.95);
    border: 1px solid var(--theme-text-muted);
    color: #F4F4F4;
}

.region-popup-theme .leaflet-popup-tip {
    background: rgba(var(--theme-bg-1-rgb), 0.95);
    border: 1px solid var(--theme-text-muted);
}

.region-popup-content {
    color: #F4F4F4;
    font-family: Inter, sans-serif;
}

@media (max-width: 768px) {
    .region-stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        width: 100%;
    }

    .region-summary-table th:nth-child(3),
    .region-summary-table td:nth-child(3),
    .region-summary-table th:nth-child(4),
    .region-summary-table td:nth-child(4),
    .region-summary-table th:nth-child(5),
    .region-summary-table td:nth-child(5) {
        display: none;
    }

    .ping-detail-item {
        padding: 0.75rem;
        max-width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 480px) {
    .region-stats-grid {
        gap: 0.5rem;
        grid-template-columns: 1fr;
        width: 100%;
        max-width: 100%;
    }

    .ping-detail-item {
        max-width: 100%;
        width: 100%;
    }

    /* Override any inline grid styles that might cause overflow */
    div[style*="grid-template-columns: repeat(auto-fit, minmax(250px"] {
        grid-template-columns: 1fr !important;
    }
}

/* Section Header with Back Button */
.section-header-with-back {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
    max-width: 100%;
    overflow: hidden;
}

.section-header-with-back>div {
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    overflow-wrap: break-word;
}

@media (max-width: 768px) {
    .section-header-with-back {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .section-header-with-back .btn {
        align-self: flex-start;
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }

    .section-header-with-back>div {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .section-header-with-back {
        gap: 0.5rem;
        margin-bottom: 1.5rem;
    }

    .section-header-with-back .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.75rem;
    }

    .section-header-with-back .section-header {
        font-size: 1.1rem;
        text-align: left;
        margin-bottom: 0.5rem;
        word-break: break-all;
    }

    .section-header-with-back .section-subheader {
        text-align: left;
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
        overflow-wrap: anywhere;
        word-break: break-all;
    }
}

/* Table Styles */
.table-container {
    background: rgba(var(--theme-bg-2-rgb), 0.8);
    border: 1px solid var(--theme-text-muted);
    border-radius: 1rem;
    overflow: hidden;
    backdrop-filter: blur(10px);
    margin-bottom: 2rem;
}

.ping-results-table {
    width: 100%;
    border-collapse: collapse;
    color: #F4F4F4;
}

.ping-results-table th {
    background: rgba(var(--theme-bg-1-rgb), 0.8);
    color: var(--theme-accent);
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--theme-text-muted);
    white-space: nowrap;
}

.ping-results-table td {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid rgba(100, 116, 139, 0.3);
    vertical-align: middle;
    white-space: nowrap;
}

.ping-results-table tbody tr {
    transition: all 0.2s ease;
    cursor: pointer;
}

.ping-results-table tbody tr:hover {
    background: rgba(var(--theme-accent-rgb), 0.05);
}

.ping-results-table tbody tr.expanded {
    background: rgba(var(--theme-accent-rgb), 0.1);
}

/* Status indicators */
.status-success {
    color: #10B981;
    font-weight: 600;
}

.status-failure {
    color: #EF4444;
    font-weight: 600;
}

/* Expandable row details */
.ping-details-row {
    background: rgba(var(--theme-bg-1-rgb), 0.6) !important;
}

.ping-results-table tbody tr.ping-details-row {
    cursor: default;
    transition: none;
}

.ping-results-table tbody tr.ping-details-row:hover {
    background: rgba(var(--theme-bg-1-rgb), 0.6) !important;
}

.ping-details-row td {
    padding: 0 !important;
    white-space: normal !important;
}

.ping-details-content {
    padding: 1.5rem;
    border-top: 1px solid var(--theme-text-muted);
}

.ping-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    max-width: 100%;
    overflow: visible;
}

.ping-detail-item {
    background: rgba(var(--theme-bg-2-rgb), 0.6);
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--theme-text-muted);
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow: visible;
    position: relative;
    cursor: default;
}

.ping-detail-label {
    color: var(--theme-text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    word-wrap: break-word;
}

.ping-detail-value {
    color: #F4F4F4;
    font-size: 1rem;
    font-weight: 500;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.ping-detail-secondary {
    color: var(--theme-text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.pagination-container .btn {
    min-width: 7rem;
}

.pagination-info {
    color: var(--theme-text-muted);
    font-weight: 500;
    text-align: center;
    word-wrap: break-word;
}

@media (max-width: 480px) {
    .pagination-container {
        flex-direction: column;
        gap: 0.5rem;
    }

    .pagination-container .btn {
        width: 100%;
        max-width: 200px;
    }

    .pagination-info {
        font-size: 0.85rem;
    }
}

/* Responsive table */
@media (max-width: 768px) {
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
        border-left: none;
        border-right: none;
        border-radius: 0;
    }

    .ping-results-table {
        min-width: 600px;
        font-size: 0.85rem;
    }

    #ping-results-table-container .ping-results-table {
        min-width: 0;
        width: 100%;
    }

    .ping-results-table th,
    .ping-results-table td {
        padding: 0.75rem 0.5rem;
        white-space: nowrap;
    }

    #ping-results-table-container .ping-results-table th,
    #ping-results-table-container .ping-results-table td {
        white-space: normal;
    }

    #ping-results-table-container .ping-results-table th:nth-child(1),
    #ping-results-table-container .ping-results-table td:nth-child(1),
    #ping-results-table-container .ping-results-table th:nth-child(2),
    #ping-results-table-container .ping-results-table td:nth-child(2) {
        white-space: nowrap;
    }

    #ping-results-table-container .ping-results-table th:nth-child(4),
    #ping-results-table-container .ping-results-table td:nth-child(4) {
        max-width: 7.5rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #ping-results-table-container .ping-results-table th:nth-child(3),
    #ping-results-table-container .ping-results-table td:nth-child(3),
    #ping-results-table-container .ping-results-table th:nth-child(5),
    #ping-results-table-container .ping-results-table td:nth-child(5),
    #ping-results-table-container .ping-results-table th:nth-child(6),
    #ping-results-table-container .ping-results-table td:nth-child(6) {
        display: none;
    }

    .monitor-detail-table-container {
        overflow-x: visible;
        -webkit-overflow-scrolling: auto;
    }

    .monitor-detail-table {
        min-width: 0;
        width: 100%;
        table-layout: fixed;
    }

    .monitor-detail-table td {
        white-space: normal !important;
        overflow-wrap: anywhere;
    }

    .monitor-detail-table td:first-child {
        white-space: normal !important;
        width: 42% !important;
    }

    .ping-details-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .ping-details-content,
    .execution-timing-breakdown {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .execution-timing-breakdown div[style*="min-width:0"] {
        min-width: 0;
    }

    .section-header-with-back {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .table-container {
        border-radius: 0;
        margin-inline: 0;
        width: 100%;
    }

    .ping-results-table {
        font-size: 0.75rem;
        min-width: 550px;
    }

    #ping-results-table-container .ping-results-table {
        min-width: 0;
        width: 100%;
    }

    .monitor-detail-table {
        min-width: 0;
    }

    .monitor-detail-table td:first-child {
        width: 40% !important;
    }

    .ping-results-table th,
    .ping-results-table td {
        padding: 0.5rem 0.3rem;
    }

    .ping-results-table th {
        font-size: 0.7rem;
    }

    .ping-results-table .btn {
        font-size: 0.7rem;
        padding: 0.3rem 0.4rem;
        white-space: nowrap;
    }

    .ping-details-grid {
        gap: 0.5rem;
    }

    .region-stats-grid {
        gap: 0.5rem;
    }
}

/* Chart Styles */
.chart-wrapper {
    position: relative;
    height: 400px;
    background: rgba(var(--theme-bg-1-rgb), 0.8);
    border-radius: 0.5rem;
    padding: 1rem;
    border: 1px solid var(--theme-text-muted);
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.chart-wrapper canvas {
    background: transparent !important;
    max-width: 100%;
    /* !important needed to override Chart.js inline styles */
    height: 100% !important;
    width: 100% !important;
}

.chart-wrapper.chart-loading::after {
    content: 'Loading\2026';
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(148, 163, 184, 0.85);
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    border-radius: 0.5rem;
    pointer-events: none;
    z-index: 2;
}

@media (max-width: 768px) {
    .chart-wrapper {
        height: 300px;
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .chart-wrapper {
        height: 250px;
        padding: 0.5rem;
    }
}

/* Region Map Styles */
#region-stats-container {
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

#region-map {
    height: 400px;
    width: 100%;
    max-width: 100%;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid var(--theme-text-muted);
    box-sizing: border-box;
    /* Prevent layout shift by ensuring dimensions are stable */
    min-height: 400px;
    position: relative;
}

/* Leaflet map container overrides to prevent layout shift */
#region-map .leaflet-container {
    height: 100%;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

@media (max-width: 768px) {
    #region-map {
        height: 300px;
        min-height: 300px;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    #region-map {
        height: 250px;
        min-height: 250px;
        max-width: 100vw;
        margin-left: 0;
        margin-right: 0;
    }
}

/* Timing Breakdown Styles */
#timing-breakdown-container {
    max-width: 100%;
    width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

#timing-spans {
    max-width: 100%;
    width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

#timing-spans>div {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

#ping-chart-container {
    max-width: 100%;
    width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

.timing-card {
    background: rgba(var(--theme-bg-2-rgb), 0.8);
    border: 1px solid var(--theme-text-muted);
    border-radius: 0.5rem;
    padding: 1.5rem;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.timing-section {
    margin-bottom: 1.5rem;
    max-width: 100%;
    overflow: hidden;
}

.timing-section-sub {
    border-left: 3px solid #10B981;
    padding-left: 0.75rem;
}

.timing-heading {
    color: #F4F4F4;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    overflow-wrap: break-word;
}

.timing-heading-tight {
    margin-bottom: 0.35rem;
}

.timing-subtext {
    color: var(--theme-text-secondary);
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
}

.timing-bar {
    display: flex;
    width: 100%;
    border-radius: 4px;
    overflow: visible;
    border: 1px solid var(--theme-text-muted);
    box-sizing: border-box;
    position: relative;
}

.timing-bar-main {
    height: 30px;
}

.timing-bar-sub {
    height: 25px;
}

.timing-legend-row {
    display: flex;
    width: 100%;
    margin-top: 0.75rem;
    box-sizing: border-box;
}

.timing-legend-row-main {
    font-size: 0.8rem;
}

.timing-legend-row-sub {
    font-size: 0.75rem;
}

.timing-value-note {
    font-size: 0.75rem;
    color: var(--theme-text-secondary);
}

.timing-value-note-sub {
    font-size: 0.7rem;
    color: var(--theme-text-secondary);
}

.timing-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    overflow: visible;
    cursor: help;
    position: relative;
}

.timing-segment-z {
    z-index: 20;
}

.timing-segment-z-tcp {
    z-index: 25;
}

.timing-segment-small {
    font-size: 0.75rem;
}

.timing-floating-label {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    white-space: nowrap;
    background: rgba(var(--theme-bg-1-rgb), 0.9);
    padding: 2px 4px;
    border-radius: 3px;
    z-index: 50;
}

.timing-floating-label-dns {
    color: #A855F7;
}

.timing-floating-label-tcp {
    color: #EF4444;
}

.timing-floating-label-tls {
    color: #F59E0B;
}

.timing-floating-label-sub {
    top: -18px;
}

.timing-floating-label-ttfb {
    color: #8B5CF6;
}

.timing-floating-label-receiving {
    color: var(--theme-accent-hover);
}

.timing-legend-segment {
    text-align: center;
}

.timing-legend-title {
    font-weight: 600;
}

.timing-legend-tcp {
    overflow: visible;
    position: relative;
    z-index: 10;
}

.timing-legend-title-nowrap {
    white-space: nowrap;
}

.timing-section-dns {
    margin-bottom: 0;
    margin-top: 0.75rem;
    padding-left: 0.75rem;
}

.timing-dns-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--theme-text-secondary);
}

.timing-dns-label-title {
    font-weight: 600;
    color: #A855F7;
}

.timing-dns-label-value {
    color: #F4F4F4;
    font-weight: 500;
}

/* Execution Timing Breakdown (for individual job executions) */
.execution-timing-breakdown {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--theme-bg-2) 0%, var(--theme-bg-1) 100%);
    border: 1px solid var(--theme-panel-border);
    border-radius: 8px;
}

.execution-timing-heading {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #F4F4F4;
}

.timing-bar-execution {
    height: 28px;
}

.timing-legend-row-execution {
    font-size: 0.75rem;
}

@media (max-width: 768px) {

    #timing-breakdown-container h5,
    #timing-breakdown-container h6 {
        font-size: 0.95rem;
        overflow-wrap: break-word;
        max-width: 100%;
    }

    #timing-breakdown-container .ping-detail-item {
        padding: 0.75rem;
        max-width: 100%;
    }

    #ping-chart-container .section-header {
        font-size: 1.1rem;
        max-width: 100%;
    }

    /* Prevent overflow */
    #timing-breakdown-container {
        margin-left: 0;
        margin-right: 0;
        width: 100%;
    }

    #timing-spans {
        width: 100%;
        overflow-x: hidden;
    }

    #timing-spans>div {
        width: 100%;
        overflow-x: hidden;
    }

    #timing-spans>div>div {
        max-width: 100%;
        overflow-x: hidden;
    }
}

@media (max-width: 480px) {

    #timing-breakdown-container h5,
    #timing-breakdown-container h6 {
        font-size: 0.9rem;
        max-width: 100%;
        overflow-wrap: break-word;
    }

    #timing-breakdown-container .ping-detail-item {
        padding: 0.75rem;
        max-width: 100%;
    }

    #timing-breakdown-container>div {
        font-size: 0.85rem;
        padding: 1rem;
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Make timing bars stack better on mobile */
    #timing-breakdown-container .ping-detail-value {
        font-size: 0.9rem;
        max-width: 100%;
    }

    #ping-chart-container .section-header {
        font-size: 1rem;
        max-width: 100%;
    }

    /* Ensure timing breakdown doesn't overflow */
    #timing-breakdown-container {
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        padding: 0;
    }

    #timing-spans {
        width: 100%;
        overflow-x: hidden;
        padding: 0;
    }

    #timing-spans>div {
        padding: 1rem;
        width: 100%;
        overflow-x: hidden;
    }

    #timing-spans>div>div {
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Force timing bar containers to not overflow */
    #timing-spans>div>div>div[style*="display: flex"] {
        max-width: 100% !important;
        overflow: hidden !important;
    }
}

/* Additional mobile fixes for dynamically generated content */
@media (max-width: 768px) {

    /* Override inline styles for statistics grid on mobile */
    #region-stats-container .region-stats-grid {
        grid-template-columns: 1fr !important;
        max-width: 100% !important;
        width: 100% !important;
    }
}

@media (max-width: 480px) {

    /* Ensure all flex containers respect viewport width */
    div[style*="display: flex"] {
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Statistics grid mobile override */
    #region-stats-container,
    #region-stats-container>div {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }
}