/* HEADER STYLES */
.header {
    border-radius: 8px;
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    text-align: center;
    background: linear-gradient(180deg, var(--ukraine-blue) 0%, var(--ukraine-blue) 50%, var(--ukraine-yellow) 50%, var(--ukraine-yellow) 100%);
}

.header-title {
    color: var(--ukraine-yellow);
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    margin-bottom: var(--spacing-md);
}

.header-subtitle {
    background-color: rgba(255, 215, 0, 0.9);
    color: var(--text-dark);
    font-weight: 600;
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: 4px;
    display: inline-block;
    font-size: 0.9rem;
}

/* NAVIGATION */
.nav {
    margin-bottom: var(--spacing-lg);
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    justify-content: center;
    position: relative;
}

.nav-link {
    padding: var(--spacing-sm) var(--spacing-md);
    text-decoration: none;
    background-color: var(--ukraine-blue);
    color: var(--ukraine-yellow);
    border: 2px solid var(--ukraine-yellow);
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-link:hover,
.nav-link:active {
    background-color: var(--ukraine-yellow);
    color: var(--text-dark);
    border-color: var(--ukraine-blue);
}

.nav-link.active {
    background-color: var(--ukraine-yellow);
    color: var(--text-dark);
    font-weight: bold;
}

/* DROPDOWN NAVIGATION */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropdown-toggle {
    padding: var(--spacing-sm) var(--spacing-md);
    text-decoration: none;
    background-color: var(--ukraine-blue);
    color: var(--ukraine-yellow);
    border: 2px solid var(--ukraine-yellow);
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    user-select: none;
}

.nav-dropdown-toggle:hover {
    background-color: var(--ukraine-yellow);
    color: var(--text-dark);
    border-color: var(--ukraine-blue);
}

.nav-dropdown-toggle.active {
    background-color: var(--ukraine-yellow);
    color: var(--text-dark);
    border-color: var(--ukraine-blue);
}

.nav-dropdown-toggle.active span {
    transform: rotate(180deg);
    transition: transform 0.3s ease;
}

.nav-dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--bg-secondary);
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 1000;
    border-radius: 6px;
    border: 2px solid var(--ukraine-blue);
    top: calc(100% + 5px);
    left: 0;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.nav-dropdown.open .nav-dropdown-content {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.nav-dropdown-item {
    color: var(--text-dark);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(0, 87, 183, 0.1);
}

.nav-dropdown-item:last-child {
    border-bottom: none;
    border-radius: 0 0 6px 6px;
}

.nav-dropdown-item:first-child {
    border-radius: 6px 6px 0 0;
}

.nav-dropdown-item:hover {
    background-color: var(--ukraine-yellow);
    color: var(--ukraine-blue);
}

.nav-dropdown-item.active {
    background-color: rgba(0, 87, 183, 0.1);
    color: var(--ukraine-blue);
    font-weight: 600;
}

.nav-dropdown-divider {
    height: 2px;
    background-color: var(--ukraine-blue);
    margin: 0;
    opacity: 0.2;
}

/* Collapsible admin nav sub-groups (feature-flagged: COLLAPSIBLE_NAV_DROPDOWNS).
   Harmless dead rules when the flag is off — the markup simply isn't rendered. */
.nav-subgroup {
    border-bottom: 1px solid rgba(0, 87, 183, 0.1);
}
.nav-subgroup:last-of-type {
    border-bottom: none;
}
.nav-subgroup-summary {
    color: var(--text-dark);
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 600;
    list-style: none;            /* hide default disclosure marker (Firefox) */
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
    transition: all 0.3s ease;
}
.nav-subgroup-summary::-webkit-details-marker { display: none; }  /* Safari/Chrome */
.nav-subgroup-summary::before {
    content: '▸';
    font-size: 0.75em;
    opacity: 0.7;
}
.nav-subgroup[open] > .nav-subgroup-summary::before {
    content: '▾';
}
.nav-subgroup-summary:hover {
    background-color: var(--ukraine-yellow);
    color: var(--ukraine-blue);
}
.nav-subgroup-item {
    padding-left: 34px;          /* indent items beneath their group header */
    font-size: 0.95em;
    border-bottom: none;
}

/* Mobile-only elements */
.mobile-only {
    display: none;
}

/* Desktop-only elements */
.desktop-only {
    display: block;
}

@media (max-width: 768px) {
    .mobile-only {
        display: block;
    }
    .desktop-only {
        display: none;
    }
}

/* Mobile touch-friendly */
@media (max-width: 768px) {
    .nav-dropdown-content {
        position: fixed;
        left: 10px;
        right: 10px;
        top: auto;
        bottom: auto;
        width: auto;
        z-index: 9999;
        max-height: 60vh;
        overflow-y: auto;
    }
    
    /* Position dropdown below the navigation */
    .nav-dropdown.open .nav-dropdown-content {
        top: 120px; /* Adjust based on header height */
    }
    
    /* Make dropdown items more touch-friendly on mobile */
    .nav-dropdown-item {
        padding: 16px 20px;
        font-size: 16px;
        border-bottom: 1px solid rgba(0, 87, 183, 0.1);
    }
    
    /* Add backdrop to make it clear dropdown is open */
    .nav-dropdown.open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.3);
        z-index: 999;
    }
}

/* CONTEXTUAL THREE-DOT MENUS */
.context-menu {
    position: relative;
    display: inline-block;
}

.context-menu-toggle {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.context-menu-toggle:hover {
    background-color: rgba(0, 87, 183, 0.1);
    color: var(--ukraine-blue);
}

.context-menu-toggle:active {
    background-color: rgba(0, 87, 183, 0.2);
}

.context-menu-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: var(--bg-secondary);
    min-width: 160px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    border-radius: 6px;
    border: 1px solid rgba(0, 87, 183, 0.2);
    overflow: hidden;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
}

.context-menu.open .context-menu-content {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.context-menu-item {
    display: block;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(0, 87, 183, 0.1);
    cursor: pointer;
}

.context-menu-item:last-child {
    border-bottom: none;
}

.context-menu-item:hover {
    background-color: var(--ukraine-yellow);
    color: var(--ukraine-blue);
}

.context-menu-item.danger {
    color: var(--danger);
}

.context-menu-item.danger:hover {
    background-color: var(--danger);
    color: white;
}

.context-menu-divider {
    height: 1px;
    background-color: rgba(0, 87, 183, 0.2);
    margin: 0;
}

/* Mobile context menu adjustments */
@media (max-width: 768px) {
    .context-menu-toggle {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
    
    .context-menu-content {
        min-width: 180px;
        right: -10px;
    }
    
    .context-menu-item {
        padding: 16px 18px;
        font-size: 16px;
    }
}

/* SCHEDULE GRID */
.schedule-grid {
    display: flex;
    overflow-x: auto;
    gap: var(--spacing-md);
    margin: var(--spacing-lg) 0;
    padding-bottom: var(--spacing-md);
    scroll-behavior: smooth;
}

/* Week transition markers - responsive design */
.week-transition {
    min-width: 280px;
    flex-shrink: 0;
}

/* Desktop: Overlay divider between weeks */
.week-transition-desktop {
    display: none;
    position: absolute;
    left: -8px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--ukraine-blue) 0%, var(--ukraine-yellow) 100%);
    border-radius: 2px;
    z-index: 10;
}

.week-transition-desktop::before {
    content: "NEXT WEEK";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(90deg);
    background-color: var(--ukraine-blue);
    color: var(--ukraine-yellow);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.day-column {
    flex: 0 0 300px;
    min-width: 300px;
    max-width: 300px;
    position: relative;
}

/* DAY HEADER STYLES */
.day-header {
    background-color: #e9ecef;
    padding: var(--spacing-md);
    border-radius: 8px 8px 0 0;
    text-align: center;
    font-weight: bold;
}

.day-header.today {
    background-color: var(--success);
    color: var(--text-light);
}

.day-header.past {
    background-color: #6c757d;
    color: var(--text-light);
}

.day-header.weekend {
    background-color: #ffc107;
    color: var(--text-dark);
}

/* Fix for TODAY label visibility */
.day-header.today .day-label {
    color: var(--text-light);
    font-weight: bold;
}

/* JOB SECTIONS */
.job-section {
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    border-radius: 6px;
    border-left: 4px solid var(--border-color);
    background-color: var(--bg-secondary);
}

.job-section.job-full {
    background-color: var(--job-full);
    border-left-color: var(--success);
}

.job-section.job-partial {
    background-color: var(--job-partial);
    border-left-color: var(--warning);
}

.job-section.job-understaffed {
    background-color: var(--job-understaffed);
    border-left-color: var(--danger);
}

.job-title {
    font-weight: bold;
    margin-bottom: var(--spacing-sm);
}

/* ===== COMPONENT CLASSES ===== */

/* CARD */
.card {
    background-color: var(--bg-secondary);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.card-compact {
    background-color: var(--bg-secondary);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* SECTION HEADING (colored banner) */
.section-heading {
    color: #ffffff;
    padding: 15px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    font-weight: 600;
}
.section-heading--danger { background-color: #dc3545; }
.section-heading--warning { background-color: #ffc107; color: #333; }
.section-heading--info { background-color: #17a2b8; }
.section-heading--success { background-color: #28a745; }
.section-heading--blue { background-color: #0057b7; }
.section-heading--purple { background-color: #6f42c1; }

/* STAT CARD (centered card with colored top border) */
.stat-card {
    background-color: var(--bg-secondary);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
    border-top: 4px solid var(--border-color);
}
.stat-card--success { border-top-color: #28a745; }
.stat-card--danger { border-top-color: #dc3545; }
.stat-card--info { border-top-color: #17a2b8; }
.stat-card--warning { border-top-color: #ffc107; }

/* FIELD LABEL / VALUE */
.field-label {
    text-transform: uppercase;
    font-size: 0.875rem;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}
.field-value {
    font-weight: 500;
    color: var(--text-primary);
}

/* BADGE */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.badge--success { background-color: #d4edda; color: #155724; }
.badge--danger { background-color: #f8d7da; color: #721c24; }
.badge--warning { background-color: #fff3cd; color: #856404; }
.badge--info { background-color: #d1ecf1; color: #0c5460; }

/* ACTION BUTTON (small colored button with CSS hover) */
.btn-action {
    display: inline-block;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: filter 0.2s ease, transform 0.1s ease;
    color: #ffffff;
}
.btn-action:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}
.btn-action--green { background-color: #28a745; }
.btn-action--green:hover { background-color: #218838; }
.btn-action--blue { background-color: #007bff; }
.btn-action--blue:hover { background-color: #0069d9; }
.btn-action--purple { background-color: #6f42c1; }
.btn-action--purple:hover { background-color: #5a32a3; }
.btn-action--ukr-blue { background-color: #0057b7; }
.btn-action--ukr-blue:hover { background-color: #004494; }
.btn-action--red { background-color: #dc3545; }
.btn-action--red:hover { background-color: #c82333; }
.btn-action--gray { background-color: #6c757d; }
.btn-action--gray:hover { background-color: #5a6268; }

/* ADMIN LINK (menu item with left border color) */
.admin-link {
    display: flex;
    align-items: center;
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 12px 15px;
    text-decoration: none;
    color: var(--text-primary);
    border-left: 4px solid transparent;
    transition: background-color 0.2s ease, transform 0.1s ease;
}
.admin-link:hover {
    background-color: #e9ecef;
    transform: translateX(3px);
}
.admin-link--success { border-left-color: #28a745; }
.admin-link--warning { border-left-color: #ffc107; }
.admin-link--danger { border-left-color: #dc3545; }
.admin-link--critical { border-left-color: #dc3545; }
.admin-link--info { border-left-color: #17a2b8; }
.admin-link--blue { border-left-color: #0057b7; }
.admin-link--purple { border-left-color: #6f42c1; }

/* EMPTY MESSAGE */
.empty-message {
    text-align: center;
    font-style: italic;
    color: var(--text-secondary);
    padding: 20px;
}

/* RESPONSIVE DESIGN */
@media (min-width: 768px) {
    .container {
        max-width: 1200px;
        padding: var(--spacing-xl);
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .schedule-grid {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        overflow-x: visible;
    }
    
    .day-column {
        flex: 1;
        min-width: auto;
        max-width: none;
    }
    
    /* Hide mobile week transition, show desktop version */
    .week-transition {
        display: none;
    }
    
    .week-transition-desktop {
        display: block;
    }
}

@media (min-width: 1200px) {
    .container {
        padding: var(--spacing-xl) 3rem;
    }
}

/* FLOATING ACTION BUTTON (FAB) SYSTEM */
.fab-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

.fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 24px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    position: relative;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.fab-main {
    background-color: var(--ukraine-blue);
    color: var(--ukraine-yellow);
    border: 2px solid var(--ukraine-yellow);
}

.fab-main:hover {
    background-color: var(--ukraine-yellow);
    color: var(--ukraine-blue);
    border-color: var(--ukraine-blue);
}

.fab-main .fab-icon-close {
    display: none;
}

.fab-main.active .fab-icon {
    display: none;
}

.fab-main.active .fab-icon-close {
    display: inline;
}

.fab-menu {
    position: absolute;
    bottom: 70px;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 15px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.fab-menu.show {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.fab-mini {
    width: 48px;
    height: 48px;
    font-size: 20px;
    background-color: var(--bg-secondary);
    color: var(--ukraine-blue);
    border: 2px solid var(--ukraine-blue);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    position: relative;
}

.fab-mini:hover {
    background-color: var(--ukraine-blue);
    color: var(--ukraine-yellow);
    border-color: var(--ukraine-yellow);
}

.fab-mini::before {
    content: attr(data-tooltip);
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0,0,0,0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: normal;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.fab-mini:hover::before {
    opacity: 1;
}

/* Hide FAB on mobile landscape to avoid keyboard conflicts */
@media (max-width: 768px) and (orientation: landscape) {
    .fab-container {
        display: none;
    }
}

/* Adjust position on small screens */
@media (max-width: 480px) {
    .fab-container {
        bottom: 20px;
        right: 20px;
    }
}
/* Error Modal Styles */
.error-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.error-modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

.error-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 0 20px;
    border-bottom: 1px solid #e1e5e9;
}

.error-modal-header h3 {
    margin: 0;
    color: #dc3545;
    font-size: 1.2rem;
}

.error-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.error-modal-close:hover {
    background-color: #f8f9fa;
    color: #dc3545;
}

.error-modal-body {
    padding: 20px;
    font-size: 1rem;
    line-height: 1.5;
    color: #333;
}

.error-modal-footer {
    padding: 0 20px 20px 20px;
    text-align: right;
}

.error-modal-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s ease;
}

.error-modal-btn:hover {
    background-color: #c82333;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Improved alert styles for success messages */
.alert {
    padding: 12px 16px;
    margin: 10px 0;
    border-radius: 6px;
    border-left: 4px solid;
    font-weight: 500;
}

.alert-success {
    background-color: #d4edda;
    border-left-color: #28a745;
    color: #155724;
}

.alert-info {
    background-color: #d1ecf1;
    border-left-color: #17a2b8;
    color: #0c5460;
}

.alert-warning {
    background-color: #fff3cd;
    border-left-color: #ffc107;
    color: #856404;
}


/* ===========================================================================
   Responsive data tables (#86)
   ---------------------------------------------------------------------------
   A wide table on a phone either scrolls sideways — so the name you are reading
   loses its row — or squeezes until every column is two words tall. Below 768px
   this turns each ROW into a CARD, and each cell prints its own column name.

   The pattern was hand-written inside admin/fixed_schedules.html and
   admin/expectations.html. Copying ~40 lines per page is why 24 of 26 data
   pages never got it. It lives here now, so a page opts in with one class.

   TO USE — two steps, and the second is not optional:
     1. <table class="responsive-table">
     2. every <td> needs data-label="<its column heading>"

   A cell with no data-label renders with a blank heading above it, which reads
   as a gap rather than a bug. Label every cell, including the actions column.

   CONVERGENCE (#96, 2026-08-19). admin/fixed_schedules.html and
   admin/expectations.html use this class and carry no private copy — the old note
   here claimed otherwise and was wrong. Since 2026-08-19 address_book/list.html,
   applicant_review/list.html and signal_uuid_mapping.html use it too, each keeping
   only what this class does not do.

   ONE PAGE DELIBERATELY DOES NOT. user_eject.html puts the label to the LEFT of
   the value in a fixed 80px column, not above it, and stacks the Contact and
   Actions cells inside that layout. It is a different design, not a copy of this
   one, so adopting this class there would change what an admin sees. Leave it
   until somebody decides the two should look the same.
   =========================================================================== */
.responsive-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.responsive-table thead {
    background-color: #005BBB;
    color: white;
}

.responsive-table thead th {
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    border: none;
}

.responsive-table tbody td {
    padding: 10px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: top;
}

.responsive-table tbody tr:hover {
    background-color: #f8f9fa;
}

@media (max-width: 768px) {
    .responsive-table {
        border: none;
        background: transparent;
    }

    /* The headings move into each cell via data-label, so the real thead goes. */
    .responsive-table thead {
        display: none;
    }

    .responsive-table tbody,
    .responsive-table tbody tr,
    .responsive-table tbody td {
        display: block;
    }

    .responsive-table tbody tr {
        background: white;
        border: 1px solid #ddd;
        border-radius: 8px;
        margin-bottom: 15px;
        padding: 15px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        position: relative;
    }

    .responsive-table tbody td {
        border: none;
        padding: 8px 0;
        text-align: left;
        /* Desktop column widths must not survive into a card. Several pages set
           per-column widths with !important to hold a wide table together, so
           this needs the same weight to undo them. */
        width: auto !important;
    }

    /* A cell with NO data-label prints no heading at all. That is the opt-out for
       a cell that is the card's title or its footer of buttons — omit the
       attribute rather than reach for a page-specific :last-child override. */
    .responsive-table tbody td:not([data-label])::before {
        content: none;
    }

    /* Nor does a cell with a label but NO CONTENT (#96). A JS row builder often
       sets the label first and the value second, so "Phone" with nothing after it
       is a blank line, not information. Note :empty is strict — a Jinja-rendered
       cell holds whitespace and is never :empty, so a server-rendered page that
       prints "-" for a missing value is unaffected. */
    .responsive-table tbody td:empty::before {
        content: none;
    }

    .responsive-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #005BBB;
        display: block;
        margin-bottom: 5px;
        font-size: 14px;
    }

    /* The actions column reads as the card's footer, not another field. */
    .responsive-table tbody td:last-child {
        text-align: center;
        padding-top: 15px;
        border-top: 1px solid #eee;
        margin-top: 8px;
    }

    /* Rows hover as a unit on desktop; on a phone there is no hover to give. */
    .responsive-table tbody tr:hover {
        background: white;
    }

    /* A cell told not to wrap keeps a desktop ROW tidy. Inside a card there is
       no row to protect, and one long value then pushes the card past the screen
       edge — the exact sideways scroll this layout exists to remove. Code and
       pre keep their own wrapping, where line breaks carry meaning. */
    .responsive-table tbody td,
    .responsive-table tbody td *:not(code):not(pre) {
        white-space: normal;
    }

    /* Long unbroken strings — a UUID, an email, a user agent — have no space to
       break at, so they need an explicit escape. */
    .responsive-table tbody td {
        overflow-wrap: anywhere;
    }

    /* A cell that truncates with an ellipsis to protect a desktop row has room
       to wrap once it is a card. Inline styles set those widths, so this needs
       !important to reach them. */
    .responsive-table tbody td > div[style*="nowrap"] {
        max-width: none !important;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }
}
