:root {
    --neon-cyan: #00f2ff;
    --neon-purple: #bc13fe;
    --neon-pink: #ff00de;
    --deep-space: #050505;
    --neon-white: white;
}

html {
    width: 100%;
    min-height: 100%;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    color-scheme: dark;
}

* {
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

button,
[role="button"] {
    touch-action: manipulation;
    user-select: none;
}

input,
textarea,
select,
[contenteditable="true"] {
    user-select: text;
}

img,
svg,
video,
canvas {
    max-width: 100%;
}

body {
    font-family: 'Rajdhani', sans-serif;
    background-color: var(--deep-space);
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    max-width: 100%;
    overflow-x: hidden;
    overflow-x: clip;
}

body.modal-open,
body.sidebar-open {
    overflow: hidden;
    overscroll-behavior: none;
}

:focus-visible {
    outline: 3px solid var(--neon-cyan);
    outline-offset: 3px;
}

/* All background layers must be fixed so they don't add document height */
.stars-container {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at bottom, #1B2735 0%, #090A0F 100%);
    z-index: -5;
    pointer-events: none;
}

.digital-rain {
    position: fixed;
    inset: 0;
    background: url('https://www.transparenttextures.com/patterns/stardust.png');
    opacity: 0.15;
    z-index: -4;
    animation: drift 60s linear infinite;
    pointer-events: none;
}

.cyber-grid {
    position: fixed; bottom: -30%; left: -50%; width: 200%; height: 200%;
    background-image: linear-gradient(var(--neon-cyan) 1px, transparent 1px), linear-gradient(90deg, var(--neon-cyan) 1px, transparent 1px);
    background-size: 45px 45px;
    transform: perspective(500px) rotateX(65deg);
    opacity: 0.12;
    -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,1), rgba(0,0,0,0));
    mask-image: linear-gradient(to top, rgba(0,0,0,1), rgba(0,0,0,0));
    z-index: -3;
}

#particle-container {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;  /* stops particles from extending page height */
}

@keyframes drift { from { background-position: 0 0; } to { background-position: 500px 1000px; } }

/* --- TEXT STYLES --- */
.glitch-title {
    text-shadow: 2px 0 var(--neon-pink), -2px 0 var(--neon-cyan);
    animation: glitch 3s infinite alternate;
}

@keyframes glitch {
    0% { text-shadow: 2px 0 var(--neon-pink), -2px 0 var(--neon-cyan); }
    50% { text-shadow: -3px 0 var(--neon-purple), 3px 0 var(--neon-cyan); transform: skew(0.5deg); }
    100% { text-shadow: 1px 0 var(--neon-pink), -1px 0 var(--neon-cyan); }
}

.input-label {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--neon-cyan);
    margin-bottom: 6px;
    margin-left: 4px;
}

/* --- UI COMPONENTS --- */
.portal-frame {
    background: rgba(10, 10, 15, 0.94);
    -webkit-backdrop-filter: blur(25px);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(0, 242, 255, 0.25);
    box-shadow: 0 0 50px rgba(0,0,0,0.9);
    -webkit-clip-path: polygon(0 25px, 25px 0, calc(100% - 25px) 0, 100% 25px, 100% calc(100% - 25px), calc(100% - 25px) 100%, 25px 100%, 0 calc(100% - 25px));
    clip-path: polygon(0 25px, 25px 0, calc(100% - 25px) 0, 100% 25px, 100% calc(100% - 25px), calc(100% - 25px) 100%, 25px 100%, 0 calc(100% - 25px));
    transition: filter 0.5s ease;
}

.corner {
    position: absolute; width: 12px; height: 12px;
    border: 2px solid var(--neon-cyan); opacity: 0.8;
}

.input-icon {
    position: absolute; left: 14px; top: 50%;
    transform: translateY(-50%);
    color: #475569; font-size: 14px; z-index: 10;
}

.input-mobile-ultra {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 14px 12px 42px;
    border-radius: 8px;
    width: 100%; color: white;
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px; transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.input-mobile-ultra::placeholder { color: #64748b; }
.input-mobile-ultra:focus { border-color: var(--neon-cyan); outline: none; box-shadow: 0 0 15px rgba(0, 242, 255, 0.1); }

.role-card {
    padding: 12px; border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px; text-align: center; color: #475569;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-mobile-ultra {
    background: linear-gradient(135deg, var(--neon-white), var(--neon-cyan), var(--neon-cyan));
    color: #000; font-family: 'Orbitron', sans-serif;
    font-weight: 900; letter-spacing: 1.5px; text-transform: uppercase;
    padding: 15px 0; -webkit-clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%); clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%);
    width: 100%; cursor: pointer; border: none;
    transition: filter 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s;
}

/* --- PARTICLES & BLUR --- */
.particle {
    position: absolute; pointer-events: none; opacity: 0;
    font-weight: 900; animation: floatUpAnim 10s linear infinite, glowPulse 2s ease-in-out infinite alternate;
    filter: drop-shadow(0 0 10px currentColor); z-index: -1;
}

@keyframes floatUpAnim {
    from { transform: translateY(110vh) rotate(0deg) scale(0.8); opacity: 0; }
    20% { opacity: 0.8; }
    80% { opacity: 0.8; }
    to { transform: translateY(-10vh) rotate(180deg) scale(1.2); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .digital-rain,
    .cyber-grid,
    #particle-container {
        display: none !important;
    }
}

@keyframes glowPulse { from { filter: drop-shadow(0 0 5px currentColor); } to { filter: drop-shadow(0 0 15px currentColor); } }

.blur-bg { filter: blur(15px) brightness(0.3); pointer-events: none; transition: filter 0.5s cubic-bezier(0.16, 1, 0.3, 1); }

.module { display: none; }
.module-active { display: block; animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* --- AUTONOMOUS LEARNING HUB --- */
.learning-hero-card,
.learning-dashboard-card,
.learning-mode-card,
.learning-topic-card {
    transition: transform 0.2s ease, border-color 0.2s ease, filter 0.2s ease;
}

.learning-dashboard-card:hover,
.learning-mode-card:hover,
.learning-topic-card:hover,
.learning-topic-card:focus-visible {
    transform: translateY(-3px);
    border-color: rgba(34, 211, 238, 0.55);
    filter: brightness(1.08);
}

.learning-topic-card {
    display: block;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.learning-topic-card:hover,
.learning-topic-card:focus-visible {
    border-color: var(--topic-color);
    box-shadow: 0 0 34px color-mix(in srgb, var(--topic-color) 15%, transparent);
}

.learning-term-section {
    scroll-margin-top: 6rem;
}

.learning-term-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 2.25rem;
    border: 1px solid rgba(34, 211, 238, 0.3);
    border-radius: 0.55rem;
    background: rgba(34, 211, 238, 0.08);
    color: #22d3ee;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    font-weight: 900;
}

.practice-question-frame {
    border-color: color-mix(in srgb, var(--practice-accent) 45%, transparent);
}

.practice-hud-pill {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 2.75rem;
    padding: 0.6rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.6rem;
    background: rgba(255, 255, 255, 0.04);
    color: #cbd5e1;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.72rem;
    font-weight: 700;
}

.practice-progress-segment {
    height: 0.42rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.practice-progress-segment.complete {
    background: rgba(34, 211, 238, 0.45);
}

.practice-progress-segment.current {
    background: var(--practice-accent);
    box-shadow: 0 0 14px color-mix(in srgb, var(--practice-accent) 60%, transparent);
    transform: scaleY(1.35);
}

.practice-progress-segment.current.incorrect {
    background: #f87171;
    box-shadow: 0 0 14px rgba(248, 113, 113, 0.55);
}

.practice-progress-segment.current.correct {
    background: #4ade80;
    box-shadow: 0 0 14px rgba(74, 222, 128, 0.55);
}

.practice-choice {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-height: 4.2rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.75rem;
    background: rgba(15, 23, 42, 0.78);
    color: white;
    font-size: 1rem;
    font-weight: 700;
    text-align: left;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.practice-choice:hover,
.practice-choice.selected {
    border-color: var(--practice-accent);
    background: color-mix(in srgb, var(--practice-accent) 12%, rgba(15, 23, 42, 0.88));
    transform: translateY(-2px);
}

.practice-choice-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    flex: 0 0 2rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.45rem;
    color: var(--practice-accent);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.72rem;
}

.practice-feedback-visible.correct {
    border-color: rgba(74, 222, 128, 0.3);
    background: rgba(34, 197, 94, 0.07);
}

.practice-feedback-visible.incorrect {
    border-color: rgba(248, 113, 113, 0.3);
    background: rgba(239, 68, 68, 0.07);
}

.practice-reward-particle {
    position: fixed;
    left: 50%;
    top: 58%;
    z-index: 500;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 2px;
    pointer-events: none;
    animation: practiceRewardBurst 850ms ease-out forwards;
}

@keyframes practiceRewardBurst {
    from { opacity: 1; transform: translate(0, 0) rotate(0); }
    to { opacity: 0; transform: translate(var(--reward-x), var(--reward-y)) rotate(260deg); }
}

/* Sidebar Nav Links */
.nav-link {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    color: #94a3b8;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 4px;
    border: 1px solid transparent;
}
.nav-link.active {
    color: #00f2ff;
    background: rgba(0, 242, 255, 0.08);
    border-color: rgba(0, 242, 255, 0.2);
}

/* MODAL OVERLAY - HEAVY BLUR */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* BUTTONS */
.btn-rect-primary {
    background: #00f2ff;
    color: #000;
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    text-transform: uppercase;
    font-size: 11px;
    padding: 14px;
    border-radius: 4px;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-rect-primary:hover {
    background: #fff;
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.4);
    transform: translateY(-2px);
}

.btn-rect-secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    padding: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-rect-danger {
    background: #dc2626;
    color: #fff;
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    padding: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-action-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.modal-cancel {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.25rem;
    text-align: center;
    text-transform: uppercase;
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
    transition: color 0.2s ease;
}

.modal-cancel:hover,
.modal-cancel:focus-visible {
    color: #fff;
}

/* INPUT WITH ICON INSIDE */
.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.2);
    font-size: 14px;
    pointer-events: none;
}

.input-mobile-ultra {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 14px 12px 42px; /* Fixed space for icon */
    border-radius: 4px;
    width: 100%;
    color: white;
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.input-mobile-ultra:focus {
    border-color: #00f2ff;
    outline: none;
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.1);
}

/* --- NEW GLOBAL SECTION/MODAL ANIMATION --- */
@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.96) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.animate-fade-in {
    animation: fadeInScale 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* --- BACKGROUND FX --- */
.particle {
    position: absolute; pointer-events: none; opacity: 0;
    font-weight: 900; animation: floatUpAnim 10s linear infinite;
    filter: drop-shadow(0 0 10px currentColor); z-index: -1;
}
@keyframes floatUpAnim {
    from { transform: translateY(110vh) rotate(0deg); opacity: 0; }
    15% { opacity: 0.7; }
    85% { opacity: 0.7; }
    to { transform: translateY(-10vh) rotate(360deg); opacity: 0; }
}

/* Hide browser's native password reveal button */

/* Chrome, Edge, Safari */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
    display: none;
}

/* Edge specific */
input::-ms-reveal,
input::-ms-clear {
    display: none;
}

/* Chrome */
input[type="password"]::-webkit-credentials-auto-fill-button,
input[type="password"]::-webkit-strong-password-auto-fill-button {
    display: none !important;
    visibility: hidden;
    pointer-events: none;
}

/* Suppress autofill highlight color bleeding into your dark inputs */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0px 1000px rgba(15, 23, 42, 0.85) inset !important;
    -webkit-text-fill-color: white !important;
    caret-color: white;
    border-color: rgba(255, 255, 255, 0.1) !important;
    transition: background-color 5000s ease-in-out 0s;
}

.profile-menu.open {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.profile-menu {
    transform-origin: top right;
    transition: all 0.15s ease;
}

/* Dark form controls used by moderation and classroom exception modals. */
.input-field {
    width: 100%;
    min-height: 46px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.96) !important;
    background-color: rgb(15, 23, 42) !important;
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc;
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    line-height: 1.4;
    color-scheme: dark;
    user-select: text;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

textarea.input-field {
    min-height: 96px;
    resize: vertical;
}

.input-field::placeholder {
    color: #64748b;
}

.input-field:focus {
    outline: none;
    border-color: var(--neon-cyan);
    background: rgba(15, 23, 42, 1);
    box-shadow: 0 0 0 3px rgba(0, 242, 255, 0.08), 0 0 16px rgba(0, 242, 255, 0.12);
}

.input-field option,
.input-mobile-ultra option {
    background: #0f172a !important;
    color: #f8fafc !important;
}

/* Native date controls otherwise render a black calendar icon on Windows. */
input[type="date"],
input[type="datetime-local"],
input[type="month"],
input[type="time"] {
    color-scheme: dark !important;
    padding-right: 12px !important;
    background-color: rgb(15, 23, 42) !important;
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc;
}

/* Date/time controls render their empty format as browser-owned text rather
   than a normal ::placeholder, so give that empty state the same muted tone. */
input[type="date"].temporal-input-empty,
input[type="datetime-local"].temporal-input-empty,
input[type="month"].temporal-input-empty,
input[type="time"].temporal-input-empty {
    color: #64748b !important;
    -webkit-text-fill-color: #64748b !important;
    font-weight: 400 !important;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(89%) sepia(89%) saturate(1742%) hue-rotate(123deg) brightness(102%) contrast(104%) !important;
    cursor: pointer;
    opacity: 1 !important;
    width: 18px;
    height: 18px;
    margin: 0 0 0 10px;
    padding: 1px;
    flex: 0 0 18px;
}

/* Ensure every system control keeps the MathVerse palette even when browser
   form defaults or utility classes try to paint it white. */
.input-mobile-ultra,
select.input-field,
textarea.input-field,
input.input-field {
    background-color: rgb(15, 23, 42) !important;
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc;
}

select.input-field,
select.input-mobile-ultra {
    color-scheme: dark;
}

/* Keep helper examples visually distinct from values the user has entered.
   WebKit inherits -webkit-text-fill-color from our dark inputs, so it must be
   overridden here as well or placeholders can appear solid white. */
input::placeholder,
textarea::placeholder,
.input-field::placeholder,
.input-mobile-ultra::placeholder {
    color: #64748b !important;
    -webkit-text-fill-color: #64748b !important;
    opacity: 0.58 !important;
    font-weight: 400 !important;
}

/* Required combo-box prompts such as "Select a class" behave like
   placeholders even though HTML renders them as an empty option. */
select.input-field:required:invalid,
select.input-mobile-ultra:required:invalid {
    color: #64748b !important;
    -webkit-text-fill-color: #64748b !important;
    font-weight: 400 !important;
}

/* Cross-platform shell --------------------------------------------------- */
.app-body,
.app-shell-main,
.content-section,
.portal-frame,
form,
fieldset {
    min-width: 0;
}

.app-body {
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
}

.app-shell-main {
    padding-right: max(1rem, env(safe-area-inset-right));
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

.dashboard-sidebar {
    height: 100vh;
    height: 100dvh;
    padding-top: max(1.5rem, env(safe-area-inset-top));
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    overscroll-behavior: contain;
}

.mobile-dashboard-header,
.notification-menu {
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
}

.notification-list {
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
    overscroll-behavior: contain;
}

.overflow-x-auto {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
}

.notification-menu,
.global-toast,
.portal-frame,
.input-field,
.input-mobile-ultra {
    word-break: break-word;
    overflow-wrap: anywhere;
}

.global-toast {
    right: 1rem;
    bottom: 1.5rem;
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1.5rem, calc(env(safe-area-inset-bottom) + 0.75rem));
    width: min(30rem, calc(100vw - 2rem));
    max-width: calc(100vw - 2rem);
}

.toast-close {
    color: currentColor;
    opacity: 0.75;
}

.toast-close:hover,
.toast-close:focus-visible {
    opacity: 1;
}

.browser-alert-button {
    max-width: 100%;
    min-height: 44px;
    white-space: normal;
    overflow-wrap: anywhere;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .portal-frame,
    .dashboard-sidebar,
    .mobile-dashboard-header,
    .notification-menu,
    .modal-overlay {
        background-color: rgb(5, 7, 13) !important;
    }
}

@media (max-width: 767px) {
    input,
    select,
    textarea,
    .input-field,
    .input-mobile-ultra {
        font-size: 16px;
    }

    .app-shell-main {
        padding-top: max(1rem, env(safe-area-inset-top));
    }

    .mobile-dashboard-header {
        margin-left: 0;
        margin-right: 0;
    }

    .notification-menu {
        position: fixed !important;
        top: 5.25rem;
        right: 0.75rem !important;
        left: 0.75rem !important;
        top: max(5.25rem, calc(env(safe-area-inset-top) + 4.5rem));
        right: max(0.75rem, env(safe-area-inset-right)) !important;
        left: max(0.75rem, env(safe-area-inset-left)) !important;
        width: auto !important;
        max-width: none !important;
        max-height: calc(100vh - 6.5rem) !important;
        max-height: calc(100dvh - 6.5rem) !important;
        margin-top: 0 !important;
    }

    .notification-list {
        max-height: calc(100vh - 12rem) !important;
        max-height: calc(100dvh - 12rem) !important;
    }

    .global-toast {
        right: 0.75rem;
        left: 0.75rem;
        bottom: 0.75rem;
        right: max(0.75rem, env(safe-area-inset-right));
        left: max(0.75rem, env(safe-area-inset-left));
        bottom: max(0.75rem, calc(env(safe-area-inset-bottom) + 0.5rem));
        width: auto;
        max-width: none;
    }

    .modal-overlay {
        align-items: flex-start;
        overflow-y: auto;
        padding-top: max(1rem, env(safe-area-inset-top));
        padding-right: max(1rem, env(safe-area-inset-right));
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
        padding-left: max(1rem, env(safe-area-inset-left));
        -webkit-overflow-scrolling: touch;
    }

    .modal-overlay > .portal-frame,
    .modal-overlay > form,
    .modal-overlay > div {
        width: 100%;
        max-height: calc(100vh - 2rem);
        max-height: calc(100dvh - 2rem);
        margin: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 374px) {
    .portal-frame {
        -webkit-clip-path: polygon(0 12px, 12px 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 0 calc(100% - 12px));
        clip-path: polygon(0 12px, 12px 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 0 calc(100% - 12px));
    }

    .mobile-dashboard-header {
        padding: 0.75rem;
    }
}

@media (hover: none), (pointer: coarse) {
    .btn-rect-primary:hover,
    .btn-mobile-ultra:hover {
        transform: none;
    }
}

@media (forced-colors: active) {
    :focus-visible {
        outline-color: Highlight;
    }

    .portal-frame,
    .notification-menu,
    .input-field,
    .input-mobile-ultra,
    button,
    a {
        forced-color-adjust: auto;
    }
}

@media (prefers-contrast: more) {
    .portal-frame,
    .notification-menu,
    .input-field,
    .input-mobile-ultra {
        border-width: 2px;
    }

    .text-slate-500,
    .text-slate-600 {
        color: #cbd5e1 !important;
    }
}
