/* MPLS Ramah v1.0.1 — stable viewport and mobile form refinements */

html {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overscroll-behavior: none;
    scrollbar-gutter: stable;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    overscroll-behavior: none;
    touch-action: pan-y pinch-zoom;
}

@supports (overflow: clip) {
    html,
    body {
        overflow-x: clip;
    }
}

/* Prevent long content, media, and grid children from widening the viewport. */
.app-topbar,
.app-page-shell,
.panel,
.table-wrap,
.schedule-grid,
.schedule-day-card,
.schedule-activity-card,
.schedule-content-card,
.schedule-form-grid,
.form-grid,
.field,
.button-row,
.topbar-actions,
.app-brand {
    min-width: 0;
    max-width: 100%;
}

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

img,
video,
canvas {
    height: auto;
}

h1,
h2,
h3,
h4,
p,
small,
strong,
a,
button,
label,
td,
th {
    overflow-wrap: anywhere;
}

/* Opening the mobile More sheet must not move the page underneath it. */
body.sheet-open-mobile {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    overflow: hidden;
}

/* Hover feedback changes color only; no element movement or layout wobble. */
.button:hover,
.nav-button:hover,
.choice-card:hover,
.activity-card:hover,
.day-card:hover,
.schedule-day-tab:hover,
.schedule-day-card:hover,
.quick-action:hover,
.continue-card:hover {
    transform: none !important;
}

/* Kegiatan page no longer has the academic-year badge. */
.schedule-hero.schedule-hero-simple {
    grid-template-columns: minmax(0, 1fr);
    min-height: auto;
}

.schedule-hero.schedule-hero-simple .schedule-hero-copy {
    max-width: 860px;
}

@media (max-width: 820px) {
    /* Brand stays firmly aligned to the left. */
    .app-topbar {
        display: flex !important;
        justify-content: flex-start !important;
        align-items: center !important;
    }

    .app-brand {
        position: static !important;
        left: auto !important;
        right: auto !important;
        margin: 0 auto 0 0 !important;
        transform: none !important;
        justify-self: start !important;
        text-align: left !important;
        flex: 0 1 auto !important;
    }

    .topbar-actions {
        margin-left: auto !important;
        flex: 0 0 auto !important;
    }

    /* Theme remains available inside Lainnya, but is removed from the phone top bar. */
    .topbar-actions .theme-toggle,
    .topbar-actions .topbar-theme-toggle {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    /* 16px prevents Safari/iPhone from zooming when a field receives focus. */
    input,
    select,
    textarea,
    [contenteditable="true"] {
        font-size: 16px !important;
    }

    input:focus,
    select:focus,
    textarea:focus {
        transform: none !important;
    }

    .schedule-hero.schedule-hero-simple {
        padding: 22px;
    }
}

@media (max-width: 600px) {
    .app-brand .brand-mark {
        margin-left: 0 !important;
    }

    .app-topbar {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
}
