.mud-main-content {
    flex: 1;
}

/* Secondary text: replace opacity hacks with readable color */
.mud-typography[style*="opacity"] {
    opacity: 1 !important;
    color: var(--mud-palette-text-secondary) !important;
}

.main-container {
    min-height: 100%;
    margin-top: var(--mud-appbar-height);
    padding-top: 12px !important;
    padding-bottom: 48px !important;
    padding-left: 0px !important;
    padding-right: 0px !important;
}

/* Mobile menu popup */
.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1300;
}

.menu-popup {
    position: fixed;
    top: 64px;
    right: 12px;
    left: 12px;
    z-index: 1301;
    padding: 16px;
    display: flex;
    flex-direction: column;
}

/* Prediction tiles */
.prediction-tile {
    width: calc(50% - 12px);
    min-width: 140px;
    max-width: 200px;
}

@media (min-width: 960px) {
    .prediction-tile {
        width: 200px;
    }
}

/* Welcome dialog — rounded friendly style */
.welcome-dialog.mud-dialog {
    border-radius: 28px;
    overflow: hidden;
}

/* Mobile: fullscreen dialogs with dropdowns so keyboard doesn't cover options */
@media (max-width: 959.98px) {
    .welcome-dialog.mud-dialog {
        position: fixed;
        inset: 0;
        margin: 0;
        max-height: 100%;
        max-width: 100%;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .welcome-dialog .mud-dialog-content {
        max-height: 100%;
        overflow-y: auto;
    }

    .mud-autocomplete .mud-popover {
        max-height: 40vh;
    }
}

/* Bottom navigation bar */

.alert-toast-container {
    position: fixed;
    top: calc(var(--mud-appbar-height) + 8px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1200;
    width: 90%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.alert-toast-container > * {
    pointer-events: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border-radius: 12px !important;
}

.bottom-nav {
    position: fixed;
    bottom: 12px;
    left: 16px;
    right: 16px;
    z-index: 1100;
    background: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    padding: 4px 8px;
}

.bottom-nav-scroll {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 2px;
}

.bottom-nav-scroll::-webkit-scrollbar {
    display: none;
}

.bottom-nav-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    padding: 8px 10px;
    border: none;
    background: none;
    color: rgba(255, 255, 255, 0.7);
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    border-radius: 20px;
    transition: color 0.2s, background 0.2s;
}

.bottom-nav-tab.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

.bottom-nav-tab .bottom-nav-emoji {
    font-size: 1.2rem;
    line-height: 1;
    height: 20px;
    display: flex;
    align-items: center;
}

.bottom-nav-label {
    font-size: 0.6rem;
    line-height: 1.2;
    margin-top: 3px;
    letter-spacing: 0.02em;
}

@media (min-width: 960px) {
    .main-container {
        padding-left: 24px !important;
        padding-right: 24px !important;
    }
}

/* Prevent tables and wide content from overflowing on mobile */
.mud-table-container {
    overflow-x: auto;
}

/* Make MudSelect and MudTextField full width on mobile */
@media (max-width: 959.98px) {
    .mud-input-control {
        min-width: 0 !important;
    }
    .mud-typography-h5 {
        font-size: 1.125rem !important;
        margin-bottom: 4px !important;
    }
    .mud-main-content {
        padding-top: 0px !important;
    }
    .main-container {
        padding-top: 0px !important;
        padding-bottom: 100px !important;
    }
    .main-container .mud-container {
        margin-top: 4px !important;
        padding-top: 4px !important;
    }
    .mud-simple-table table {
        width: 100% !important;
    }
    .filter-bar {
        gap: 4px !important;
        margin-bottom: 8px !important;
    }
    .filter-bar .mud-input-control {
        font-size: 0.8125rem !important;
        max-width: none !important;
    }
    .filter-bar .mud-input-label {
        font-size: 0.75rem !important;
    }
}

/* Compact table on mobile */
@media (max-width: 959.98px) {
    .mobile-table .mud-table-cell {
        padding: 8px 4px !important;
    }
    .mobile-table .mud-table-head .mud-table-cell {
        padding: 8px 4px !important;
    }
    .mobile-table .mud-table-cell:first-child,
    .mobile-table .mud-table-head .mud-table-cell:first-child {
        padding-left: 8px !important;
    }
    .mobile-table .mud-table-cell:last-child,
    .mobile-table .mud-table-head .mud-table-cell:last-child {
        padding-right: 8px !important;
    }
}

/* Bracket slide animations */
.bracket-slide {
    animation-duration: 0.3s;
    animation-timing-function: ease-out;
    animation-fill-mode: both;
}
.slide-from-right {
    animation-name: slideFromRight;
}
.slide-from-left {
    animation-name: slideFromLeft;
}
@keyframes slideFromRight {
    from { transform: translateX(60px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes slideFromLeft {
    from { transform: translateX(-60px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.live-pulse {
    width: 8px;
    height: 8px;
    background: #f44336;
    border-radius: 50%;
    animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
