        :root {
            --lyon-navy: #001632;
            --lyon-crimson: #851C1A;
            --lyon-gold: #FFCF01;
            --lyon-blue: #3FB3E2;
            --lyon-paper: #f7f5f0;
            --lyon-border: #d8dce2;
            --lyon-text: #1f2933;
        }

        body {
            font-family: "Roboto", Arial, sans-serif;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            background-attachment: fixed;
            background:
                radial-gradient(circle at top left, rgba(63, 179, 226, 0.18), transparent 32rem),
                radial-gradient(circle at bottom right, rgba(133, 28, 26, 0.10), transparent 28rem),
                linear-gradient(180deg, rgba(0,22,50,0.08), rgba(0,22,50,0.02)),
                var(--lyon-paper);
            color: var(--lyon-text);
            margin: 0;
        }

        h1, h2, h3, h4,
        .app-title,
        button,
        .cat-btn,
        .small-btn {
            font-family: "Montserrat", "Roboto", Arial, sans-serif;
        }

        .login-card {
            background:
                linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.84)),
                #ffffff;
            padding: 2rem;
            border-radius: 12px;
            border-top: 6px solid var(--lyon-navy);
            box-shadow: 0 12px 32px rgba(0,22,50,0.16);
            text-align: center;
            width: 90%;
            max-width: 400px;
            backdrop-filter: blur(6px);
        }
        
        /* Button Container */
        .button-grid { display: flex; flex-direction: column; gap: 20px; align-items: center; margin-top: 20px; }

        /* Shared Square Button Style */
        .square-btn {
            width: 180px;
            height: 180px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            border: none;
            border-radius: 15px;
            color: white;
            font-size: 1.1rem;
            font-weight: bold;
            cursor: pointer;
            transition: transform 0.2s, box-shadow 0.2s;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        }
        .square-btn:active { transform: scale(0.95); }
        .square-btn i { font-size: 3rem; margin-bottom: 10px; }

        /* Specific Colors */
        .btn-lyon-red { background-color: var(--lyon-crimson); }
        .btn-checkin-green {
            background-color: var(--lyon-navy);
            color: white;
        }

        /* Category Menu Styles */
        .cat-btn {
            display: block; width: 100%; margin: 8px 0; padding: 12px; text-align: center;
            background: #f8f9fa; border: 1px solid #ccc; border-radius: 5px; cursor: pointer;
        }

        #status { margin-top: 1.5rem; font-weight: bold; color: #333; }
        .login-card h2::after {
            content: "";
            display: block;
            width: 72px;
            height: 4px;
            margin: 10px auto 0;
            border-radius: 999px;
            background: var(--lyon-gold);
        }
        #reader { width: 100%; margin-top: 20px; border-radius: 10px; overflow: hidden; }

        .admin-tools {
            display: none;
            margin-top: 30px;
            padding-top: 20px;
            border-top: 2px dashed #ddd;
            justify-content: center;
            gap: 10px;
            flex-wrap: wrap;
        }
        /* Update this one */
        .small-btn {
            padding: 8px 12px;
            font-size: 0.85rem;
            border: 1px solid #ccc;
            border-radius: 4px;
            background: white;
            cursor: pointer;
            /* display: none;  <-- REMOVE OR COMMENT THIS OUT */
        }

        /* Add this new rule to keep the dashboard buttons hidden initially */
        #admin-bar .small-btn {
            display: none;
        }
        .small-btn:hover { background: #eee; }
        .modal-overlay {
            display: none;
            position: fixed;
            inset: 0;
            width: 100%;
            height: 100dvh;
            background: rgba(0,0,0,0.8);
            z-index: 1000;
            padding: 16px;
            box-sizing: border-box;
            align-items: center;
            justify-content: center;
        }

        .config-section {
            margin-top: 14px;
        }

        .config-section:first-of-type {
            margin-top: 0;
        }

        .config-section-title {
            display: flex;
            align-items: center;
            gap: 10px;
            margin: 6px 0 8px;
            font-size: 0.78rem;
            font-weight: 700;
            color: #667085;
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }

        .config-section-title::after {
            content: "";
            height: 1px;
            flex: 1;
            background: #e5e7eb;
        }

        .config-button-row {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 8px;
            margin-bottom: 10px;
        }

        .config-button-row .small-btn {
            width: 100%;
            min-height: 42px;
            padding: 8px 6px;
            text-align: center;
            font-size: 0.8rem;
            font-weight: 700;
            white-space: normal;
        }

        .config-view-panel {
            margin-top: 10px;
            padding-top: 10px;
            border-top: 1px solid #eef0f3;
        }

        @media (max-width: 430px) {
            .config-button-row {
                grid-template-columns: 1fr;
            }
        }

        .modal-content {
            background: white;
            width: 100%;
            max-width: 500px;
            max-height: calc(100dvh - 32px);
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            padding: 25px;
            border-radius: 12px;
            position: relative;
            box-sizing: border-box;
        }
        .event-card { border: 1px solid #ddd; padding: 15px; border-radius: 8px; margin-bottom: 10px; cursor: pointer; text-align: left; }
        .event-card:hover { background: #f9f9f9; }
        input { display: block; width: 100%; margin-bottom: 10px; padding: 10px; box-sizing: border-box; border: 1px solid #ccc; border-radius: 5px; }
        .btn-raise {
            width: 100%;
            background-color: var(--lyon-crimson); /* Lyon Red */
            color: white;
            padding: 12px;
            border: none;
            border-radius: 5px;
            font-weight: bold;
            cursor: pointer;
        }
        .btn-scan { /* Used in the modal */
            padding: 10px 20px;
            border-radius: 5px;
            border: none;
            cursor: pointer;
        }

        #hr-table-body .small-btn, 
        #hr-table-body .btn-checkin-green {
            display: inline-block !important;
        }
        #login-section {
            display: flex;
            justify-content: center;
            align-items: center;
        }
        #event-items-container {
            max-height: 55dvh;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            padding-right: 4px;
        }
        @media (max-width: 600px) {
            body {
                align-items: flex-start;
                min-height: 100dvh;
            }

            .login-card {
                width: calc(100% - 24px);
                max-width: none;
                min-height: calc(100dvh - 24px);
                margin: 12px;
                border-radius: 14px;
                padding: 1rem;
                box-sizing: border-box;
            }

            .modal-overlay {
                padding: 8px;
                align-items: flex-start;
            }

            .modal-content {
                max-height: calc(100dvh - 16px);
                padding: 18px;
                border-radius: 10px;
            }

            #event-items-container {
                max-height: 60dvh;
            }

            .event-card {
                padding: 12px;
            }
        }
        #scanner-modal {
            z-index: 1300;
        }

        #scanner-modal .modal-content {
            max-width: 420px;
        }

        @media (max-width: 600px) {
            #scanner-modal {
                align-items: center;
                justify-content: center;
            }

            #scanner-modal .modal-content {
                max-height: calc(100dvh - 16px);
            }
        }
        #attendee-list {
            max-height: 35dvh;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
        }
        .modal-close-btn {
            position: absolute;
            right: 15px;
            top: 15px;
            border: none;
            background: #f1f1f1;
            border-radius: 999px;
            width: 32px;
            height: 32px;
            cursor: pointer;
            font-size: 1rem;
        }

        .handraise-modal {
            max-width: 900px;
        }

        .hr-modal-header h3 {
            margin: 0 40px 16px 0;
            text-align: left;
        }

        .hr-toolbar {
            display: flex;
            gap: 12px;
            align-items: center;
            margin-bottom: 12px;
        }

        .hr-toolbar input[type="text"] {
            margin-bottom: 0;
            flex: 1;
            min-width: 0;
        }

        .hr-checkbox-label {
            font-size: 0.85rem;
            display: flex;
            align-items: center;
            gap: 5px;
            white-space: nowrap;
        }

        .hr-checkbox-label input {
            width: auto;
            margin: 0;
        }

        .hr-sortbar {
            display: none;
            gap: 8px;
            margin-bottom: 12px;
        }

        .hr-sortbar button {
            flex: 1;
            padding: 8px;
            border: 1px solid #ddd;
            background: #f8f9fa;
            border-radius: 6px;
            cursor: pointer;
            font-size: 0.8rem;
        }

        .hr-table-wrap {
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }

        .hr-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.85rem;
        }

        .hr-table th {
            background: #eee;
            text-align: left;
            padding: 10px;
            cursor: pointer;
            white-space: nowrap;
        }

        .hr-table td {
            padding: 10px;
            border-bottom: 1px solid #eee;
            vertical-align: middle;
        }

        .hr-email {
            font-family: monospace;
            word-break: break-word;
        }

        .hr-email-link {
            color: var(--lyon-navy);
            text-decoration: underline;
            font-family: monospace;
            word-break: break-word;
        }

        .hr-email-link:hover {
            color: var(--lyon-crimson);
        }

        .hr-category {
            font-weight: 600;
        }

        .hr-date {
            color: #555;
            white-space: nowrap;
        }

        .hr-status {
            display: inline-block;
            padding: 3px 7px;
            border-radius: 999px;
            font-size: 0.72rem;
            font-weight: bold;
            text-transform: uppercase;
        }

        .hr-status-active {
            color: white;
            background: var(--lyon-crimson);
        }

        .hr-status-inactive {
            color: #4b5563;
            background: #e5e7eb;
        }

        .hr-status-progress {
            color: var(--lyon-navy);
            background: rgba(255, 207, 1, 0.35);
        }

        .hr-resolution-pill {
            display: inline-block;
            padding: 4px 9px;
            border-radius: 999px;
            background: rgba(255, 207, 1, 0.22);
            color: var(--lyon-navy);
            font-size: 0.75rem;
            font-weight: 700;
            border: 1px solid var(--lyon-gold);
        }

        .hr-resolve-btn {
            display: inline-block;
            padding: 8px 12px;
            font-size: 0.8rem;
            color: white;
            border: none;
            border-radius: 6px;
            background: var(--lyon-navy);
            cursor: pointer;
            font-weight: 700;
            box-shadow: 0 2px 4px rgba(0,0,0,0.15);
        }

        .hr-resolve-btn:hover {
            filter: brightness(0.95);
        }

        .hr-resolve-btn:active {
            transform: translateY(1px);
            box-shadow: 0 1px 2px rgba(0,0,0,0.18);
        }

        #hr-pagination {
            margin-top: 15px;
            text-align: center;
        }
    @media (max-width: 700px) {
        .handraise-modal {
            max-width: none;
        }

        .hr-toolbar {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin-bottom: 12px;
        }

        .hr-toolbar input[type="text"] {
            margin-bottom: 0;
            width: 100%;
        }

        .hr-toolbar-actions {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 8px;
        }

        .hr-filter-chip {
            border: 1px solid var(--lyon-border);
            background: white;
            color: var(--lyon-navy);
            border-radius: 999px;
            padding: 7px 12px;
            font-size: 0.8rem;
            font-weight: 700;
            cursor: pointer;
        }

        .hr-filter-chip[aria-pressed="true"] {
            background: rgba(255, 207, 1, 0.22);
            border-color: var(--lyon-gold);
            color: var(--lyon-navy);
        }

        .hr-export-btn {
            border: none;
            background: var(--lyon-navy);
            color: white;
            border-radius: 6px;
            padding: 8px 12px;
            font-size: 0.8rem;
            font-weight: 700;
            cursor: pointer;
        }

        .hr-export-btn:hover,
        .hr-filter-chip:hover {
            filter: brightness(0.96);
        }

        .hr-sortbar {
            display: flex;
        }

        .hr-table-wrap {
            overflow-x: visible;
        }

        .hr-table,
        .hr-table thead,
        .hr-table tbody,
        .hr-table tr,
        .hr-table td {
            display: block;
            width: 100%;
        }

        .hr-table thead {
            display: none;
        }

        .hr-table tr {
            border: 1px solid #ddd;
            border-radius: 10px;
            margin-bottom: 12px;
            padding: 10px;
            background: white;
            box-shadow: 0 2px 8px rgba(0,0,0,0.04);
            box-sizing: border-box;
        }

        .hr-table td {
            border-bottom: none;
            padding: 5px 0;
            box-sizing: border-box;
        }

        .hr-table td::before {
            content: attr(data-label);
            display: block;
            font-size: 0.72rem;
            font-weight: bold;
            color: #777;
            margin-bottom: 2px;
            text-transform: uppercase;
            letter-spacing: 0.03em;
        }

        .hr-email {
            font-size: 0.8rem;
        }

        .hr-category {
            font-size: 1rem;
        }

        .hr-date {
            white-space: normal;
        }

        .hr-resolve-btn,
        .hr-table .small-btn {
            width: 100%;
            margin-top: 6px;
            text-align: center;
        }
    }
        #raised-hands-modal .modal-content {
            max-height: calc(100dvh - 32px);
        }

        @media (max-width: 700px) {
            #raised-hands-modal .modal-content {
                max-height: calc(100dvh - 16px);
            }
        }
        input[type="time"] {
            font-family: inherit;
            font-size: 1rem;
            color: #333;
            appearance: none; /* Helps with consistent styling on mobile */
        }

    .help-btn {
        border: none;
        background: var(--lyon-gold);
        color: var(--lyon-navy);
        border-radius: 999px;
        width: 28px;
        height: 28px;
        font-weight: 800;
        cursor: pointer;
        margin-left: 6px;
    }

    .help-section {
        text-align: left;
        line-height: 1.45;
    }

    .help-section h4 {
        margin: 16px 0 6px;
        color: var(--lyon-navy);
    }

    .help-section ul {
        padding-left: 1.25rem;
    }

/* Stage 13: moved selected static inline styles from index.html. */
.app-hidden { display: none; }
.user-info-summary { margin-bottom: 10px; color: #666; }
.main-menu-icon { font-size: 4.2rem; }
.relative-inline-button { position: relative; display: inline-block; }
.relative-button { position: relative; }
.badge-count-top {
    display: none;
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--lyon-gold);
    color: var(--lyon-navy);
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: bold;
    border: 2px solid white;
}
.badge-count-mine {
    display: none;
    position: absolute;
    bottom: -10px;
    right: -10px;
    background: var(--lyon-crimson);
    color: white;
    border-radius: 999px;
    padding: 2px 7px;
    font-size: 10px;
    font-weight: bold;
    border: 2px solid white;
    white-space: nowrap;
}
.logout-link-button {
    float: right;
    border: none;
    background: none;
    color: #666;
    text-decoration: underline;
    cursor: pointer;
}
.category-selection-panel {
    display: none;
    background: white;
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
}
.events-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-right: 40px;
}
.no-margin-heading { margin: 0; }
.compact-bottom-field { margin-bottom: 10px; }
.standard-select {
    display: block;
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 5px;
}
.full-width-navy-action {
    width: 100%;
    background: var(--lyon-navy);
    color: white;
    margin-bottom: 15px;
}
.time-row { display: flex; gap: 10px; }
.field-label {
    display: block;
    text-align: left;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 2px;
}
.plain-back-button {
    width: 100%;
    background: none;
    color: grey;
    border: none;
    margin-top: 10px;
}
.event-detail-view { display: none; text-align: center; }
.detail-meta {
    font-size: 0.85rem;
    color: #666;
    margin-top: -8px;
    margin-bottom: 12px;
}
.qr-code-box { display: inline-block; margin: 20px auto; }
.center-button-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
}
.blue-scan-button { background: #4a90e2; color: white; }
.left-text, .text-left { text-align: left; }
.top-margin-button { margin-top: 15px; }
.scanner-content { text-align: center; }
.modal-title-flush { margin-top: 0; }
.muted-small-text { font-size: 0.9rem; color: #666; }
.reader-box { width: 100%; margin-top: 15px; border-radius: 10px; overflow: hidden; }
.secondary-modal-button {
    margin-top: 15px;
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    background: white;
    cursor: pointer;
}
.modal-close-position-only { position: absolute; right: 15px; top: 15px; }
.config-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #eee;
    padding: 10px;
    border-radius: 5px;
}
.current-view-label { font-weight: bold; text-transform: capitalize; }
.compact-green-button {
    padding: 4px 10px;
    font-size: 0.8rem;
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
}
.compact-green-button-simple { padding: 4px 10px; font-size: 0.8rem; }
.config-scroll-list {
    max-height: 250px;
    overflow-y: auto;
    margin-top: 10px;
}
.full-width-top-button { margin-top: 20px; width: 100%; }
.full-width-top-button-small { margin-top: 15px; width: 100%; }
.subscriber-modal-layer { z-index: 1100; }
.subscriber-list {
    text-align: left;
    margin-bottom: 20px;
    max-height: 200px;
    overflow-y: auto;
}
.subscriber-add-box {
    background: #f4f4f9;
    padding: 10px;
    border-radius: 8px;
}
.flush-top { margin-top: 0; }
.subscriber-type-select { width: 100%; margin-bottom: 5px; padding: 5px; }
.full-width-button { width: 100%; }
.muted-left-note { font-size: 0.9rem; color: #666; text-align: left; }
.muted-text { color: #666; }
.resolve-modal-layer { z-index: 1250; }
.resolve-modal-content { max-width: 420px; }
.resolve-select { margin-bottom: 12px; }
.resolve-modal-status {
    min-height: 1.2rem;
    font-size: 0.85rem;
    color: var(--lyon-crimson);
    margin-bottom: 10px;
}
.tight-top { margin-top: 10px; }
.action-success-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--overlay-bg, var(--lyon-navy));
    z-index: 9999;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    font-family: sans-serif;
}
.action-success-icon { font-size: 5rem; margin-bottom: 10px; }
.action-success-title {
    margin: 0;
    font-size: 2.5rem;
    text-align: center;
    padding: 0 20px;
    font-weight: bold;
    tracking: 1px;
}
.action-success-msg {
    font-size: 1.2rem;
    margin-top: 10px;
    opacity: 0.9;
    text-align: center;
    padding: 0 20px;
}

/* Frontend Stage 14: classes for JavaScript-generated markup.
   These replace repeated template-string inline styles without changing behavior. */
.mgmt-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.mgmt-row-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mgmt-reorder {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mgmt-reorder-btn {
    cursor: pointer;
    border: none;
    background: none;
    font-size: 10px;
}

.mgmt-actions {
    display: flex;
    align-items: center;
}

.mgmt-link-btn {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.8rem;
}

.mgmt-link-btn-notify {
    color: green;
    margin-right: 10px;
}

.mgmt-link-btn-edit {
    color: #4a90e2;
    margin-right: 10px;
}

.mgmt-link-btn-delete {
    color: var(--lyon-crimson);
}

.mgmt-link-btn-strong {
    font-weight: bold;
}

.muted-list-empty {
    color: gray;
    padding: 10px;
}

.text-muted {
    color: #666;
}

.text-error {
    color: var(--lyon-crimson);
}

.subscriber-row {
    display: flex;
    justify-content: space-between;
    padding: 5px;
    border-bottom: 1px solid #ddd;
}

.subscriber-remove-btn {
    color: red;
    background: none;
    border: none;
    cursor: pointer;
}

.table-message-cell {
    text-align: center;
    padding: 20px;
}

.table-message-cell-error {
    color: var(--lyon-crimson);
}

.hr-action-detail {
    line-height: 1.35;
}

.hr-action-meta {
    font-size: 0.75rem;
    color: #666;
}

.hr-action-meta-spaced {
    margin-top: 3px;
}

.hr-action-meta-bottom {
    margin-bottom: 6px;
}

.hr-action-meta-top {
    margin-top: 4px;
}

.hr-pagination-note {
    text-align: center;
    margin-top: 12px;
    font-size: 0.85rem;
    color: #666;
}

.hr-pagination-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
}

.hr-pagination-page {
    align-self: center;
    font-size: 0.85rem;
    color: #666;
}

.event-delete-btn {
    background: none;
    border: none;
    color: var(--lyon-crimson);
    font-weight: bold;
    cursor: pointer;
    padding: 10px;
    font-size: 1.4rem;
    line-height: 1;
    display: flex;
    align-items: center;
}

.event-card-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    margin-bottom: 10px;
    cursor: pointer;
}

.event-card-main {
    text-align: left;
    flex-grow: 1;
    min-width: 0;
}

.event-card-title {
    font-size: 1.1rem;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-card-date {
    color: #666;
}

.event-card-meta {
    color: #888;
}

.event-card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.event-attendee-count {
    background: var(--lyon-crimson);
    color: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    white-space: nowrap;
}

.attendee-row-content {
    font-size: 0.8rem;
    padding: 8px;
    border-bottom: 1px solid #eee;
}

.event-empty-message {
    padding: 20px;
    color: gray;
}

.my-hr-cancel-btn {
    background: var(--lyon-crimson);
    margin-top: 10px;
}

.my-hr-progress-note {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #666;
}

.my-hr-resolution-detail {
    margin-top: 10px;
    line-height: 1.45;
}

.my-hr-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.my-hr-category {
    font-size: 1rem;
}

.my-hr-date {
    margin-top: 4px;
}
/* Front page toolbar layout.
   Single source of truth for the dashboard shell.
   Matches current index.html:
   .app-dashboard > .app-toolbar + .app-main-panel
*/

#action-section {
    width: 100%;
}

.app-dashboard {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    width: 100%;
    margin-top: 18px;
}

.app-toolbar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;

    gap: 10px;
    width: 74px;
    box-sizing: border-box;

    padding: 4px 12px 4px 0;
    border-right: 1px solid rgba(0, 22, 50, 0.16);
    min-height: 390px;
}

.app-main-panel {
    min-width: 0;
}

.app-main-panel .button-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 26px;
    margin-top: 0;
}

.app-toolbar-divider {
    width: 100%;
    height: 1px;
    margin: 2px 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(0, 22, 50, 0.18),
        transparent
    );
}

.app-toolbar-session-divider {
    margin-top: 0;
}

/* The auth/role scripts control whether admin-bar and its buttons are visible.
   Keep the toolbar version vertical whenever it is shown. */
.app-toolbar #admin-bar,
.app-toolbar .admin-tools,
.app-toolbar-admin {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    flex-wrap: nowrap;
}

/* Keep admin buttons hidden until auth.js reveals the allowed ones. */
.app-toolbar #admin-bar .small-btn {
    display: none;
}

/* Toolbar buttons. Preserve existing IDs and badge spans. */
.app-toolbar .toolbar-btn,
.app-toolbar .small-btn.toolbar-btn,
.app-toolbar .helpful-links-btn.toolbar-btn,
.app-toolbar .logout-link-button.toolbar-btn {
    float: none;
    width: 52px;
    min-width: 52px;
    max-width: 52px;
    height: 52px;
    min-height: 52px;

    padding: 5px 4px;
    margin: 0;
    box-sizing: border-box;

    border: 1px solid var(--lyon-border);
    border-radius: 14px;
    background: #ffffff;
    color: var(--lyon-navy);
    text-decoration: none;

    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 22, 50, 0.08);

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;

    text-align: center;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.05;
    white-space: normal;

    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
}

.app-toolbar .toolbar-btn:hover,
.app-toolbar .small-btn.toolbar-btn:hover,
.app-toolbar .helpful-links-btn.toolbar-btn:hover,
.app-toolbar .logout-link-button.toolbar-btn:hover {
    filter: brightness(0.97);
    box-shadow: 0 4px 9px rgba(0, 22, 50, 0.12);
}

.app-toolbar .toolbar-btn:active,
.app-toolbar .small-btn.toolbar-btn:active,
.app-toolbar .helpful-links-btn.toolbar-btn:active,
.app-toolbar .logout-link-button.toolbar-btn:active {
    transform: scale(0.96);
}

.app-toolbar .helpful-links-btn.toolbar-btn {
    background: #ffffff;
    color: var(--lyon-navy);
    border-color: var(--lyon-border);
}

.app-toolbar .logout-link-button.toolbar-btn {
    background: #fafafa;
    color: #6b7280;
}

.toolbar-icon {
    display: block;
    font-size: 1.25rem;
    line-height: 1;
}

.toolbar-label {
    display: block;
    font-size: 0.62rem;
    line-height: 1.05;
}

/* Badge placement inside narrow toolbar buttons. */
.app-toolbar .relative-inline-button,
.app-toolbar .relative-button {
    position: relative;
}

.app-toolbar .badge-count-top {
    top: -8px;
    right: -8px;
    z-index: 2;
}

.app-toolbar .badge-count-mine {
    bottom: -9px;
    right: -10px;
    z-index: 2;
    font-size: 9px;
    padding: 2px 6px;
}

/* Main buttons remain the dominant actions. */
.app-main-panel .square-btn {
    width: 270px;
    height: 270px;
    font-size: 1.35rem;
}

/* Phone layout: still a left-hand toolbar.
   This targets the actual current HTML classes, not old .app-shell names. */
@media (max-width: 700px) {
    body {
        align-items: flex-start;
        min-height: 100dvh;
    }

    .login-card {
        width: calc(100% - 24px);
        max-width: none;
        min-height: calc(100dvh - 24px);
        margin: 12px;
        border-radius: 14px;
        padding: 1rem;
        box-sizing: border-box;
    }

    #action-section {
        width: 100%;
    }

    .app-dashboard {
        display: grid;
        grid-template-columns: 64px minmax(0, 1fr);
        gap: 12px;
        align-items: start;
        width: 100%;
        margin-top: 16px;
    }

    .app-toolbar {
        width: 64px;
        min-height: 360px;
        gap: 8px;
        padding: 4px 10px 4px 0;
        border-right: 1px solid rgba(0, 22, 50, 0.16);
        border-bottom: none;
        box-sizing: border-box;
    }

    .app-main-panel .button-grid {
        gap: 24px;
    }

    .app-toolbar .toolbar-btn,
    .app-toolbar .small-btn.toolbar-btn,
    .app-toolbar .helpful-links-btn.toolbar-btn,
    .app-toolbar .logout-link-button.toolbar-btn {
        width: 48px;
        min-width: 48px;
        max-width: 48px;
        height: 48px;
        min-height: 48px;
        padding: 4px 3px;
        border-radius: 13px;
        font-size: 0.6rem;
    }

    .toolbar-icon {
        font-size: 1.15rem;
    }

    .toolbar-label {
        font-size: 0.56rem;
    }

    .app-main-panel .square-btn {
        width: 258px;
        height: 258px;
        font-size: 1.25rem;
    }

    .app-toolbar .badge-count-top {
        top: -8px;
        right: -8px;
    }

    .app-toolbar .badge-count-mine {
        bottom: -9px;
        right: -10px;
        font-size: 9px;
        padding: 2px 6px;
    }
}

@media (max-width: 380px) {
    .app-dashboard {
        grid-template-columns: 58px minmax(0, 1fr);
        gap: 10px;
    }

    .app-toolbar {
        width: 58px;
        padding-right: 8px;
    }

    .app-toolbar .toolbar-btn,
    .app-toolbar .small-btn.toolbar-btn,
    .app-toolbar .helpful-links-btn.toolbar-btn,
    .app-toolbar .logout-link-button.toolbar-btn {
        width: 50px;
        min-width: 50px;
        max-width: 50px;
        height: 50px;
        min-height: 50px;
        font-size: 0.56rem;
    }
    .app-main-panel .square-btn {
        width: 237px;
        height: 237px;
        font-size: 1.15rem;
    }
}

/* Helpful Links modal table, descriptions, editor, and scroll cue. */
.helpful-links-list {
    text-align: left;
}

.helpful-links-table-wrap {
    position: relative;
    max-height: min(58dvh, 520px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--lyon-border);
    border-radius: 12px;
    background: #fff;
}

.helpful-links-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.helpful-links-table th,
.helpful-links-table td {
    padding: 12px 14px;
    border: 1px solid #e7eaf0;
    vertical-align: top;
}

.helpful-links-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8fafc;
    color: var(--lyon-navy);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.helpful-links-link-cell {
    width: 34%;
    min-width: 130px;
}

.helpful-link-item {
    color: var(--lyon-navy);
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 2px;
    overflow-wrap: anywhere;
}

.helpful-link-item:hover {
    color: var(--lyon-crimson);
}

.helpful-links-description-cell {
    color: #374151;
    line-height: 1.45;
    white-space: pre-line;
}

.helpful-links-table tbody tr:nth-child(even) {
    background: #fbfcfe;
}

.helpful-links-scroll-cue {
    position: sticky;
    bottom: 8px;
    width: fit-content;
    min-width: 0;
    max-width: calc(100% - 24px);
    margin: 10px auto 0;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255, 207, 1, 0.92);
    color: var(--lyon-navy);
    display: none;
    align-items: center;
    text-align: center;
    color: #667085;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    margin-top: 8px;
    line-height: 1;
    box-shadow: 0 3px 8px rgba(0, 22, 50, 0.16);
    animation: helpfulLinksBounce 1.6s infinite;
    pointer-events: none;
}

@keyframes helpfulLinksBounce {
    0%, 100% { transform: translateY(0); opacity: 0.7; }
    50% { transform: translateY(5px); opacity: 1; }
}

.helpful-link-description-preview {
    margin-top: 5px;
    color: #4b5563;
    font-size: 0.78rem;
    line-height: 1.35;
    white-space: pre-line;
}

.helpful-link-editor-overlay {
    z-index: 1400;
}

.helpful-link-editor-modal {
    max-width: 540px;
}

.helpful-link-editor-label {
    display: block;
    text-align: left;
    margin: 12px 0 4px;
    color: var(--lyon-navy);
    font-size: 0.82rem;
    font-weight: 800;
}

#helpful-link-editor-description {
    display: block;
    width: 100%;
    min-height: 120px;
    margin-bottom: 10px;
    padding: 10px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 5px;
    font: inherit;
    resize: vertical;
}

.helpful-link-editor-error {
    min-height: 1.2rem;
    color: var(--lyon-crimson);
    font-size: 0.85rem;
    text-align: left;
    margin: 4px 0 8px;
}

.helpful-link-editor-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
}

.helpful-link-editor-actions .secondary-modal-button,
.helpful-link-editor-actions .btn-raise {
    width: auto;
    min-width: 110px;
    margin-top: 0;
}

@media (max-width: 600px) {
    .helpful-links-table-wrap {
        max-height: 62dvh;
    }

    .helpful-links-table th,
    .helpful-links-table td {
        padding: 10px;
    }

    .helpful-links-link-cell {
        width: 38%;
        min-width: 105px;
    }

    .helpful-links-table {
        font-size: 0.84rem;
    }

    .helpful-link-editor-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .helpful-link-editor-actions .secondary-modal-button,
    .helpful-link-editor-actions .btn-raise {
        width: 100%;
    }
}
