/* Phone layout. Everything here applies only while <html> has the "mui" class. */
.mui-tabbar, .mui-filter-btn, .mui-chips, .mui-grab { display: none; }

/* slim header */
html.mui .site-header { padding: 8px 0; padding-top: calc(8px + env(safe-area-inset-top, 0px)); }
html.mui .header-inner { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: nowrap; gap: 8px; min-height: 42px; }
html.mui .brand { gap: 8px; min-width: 0; }
html.mui .brand-badge { font-size: 1.5rem; }
html.mui .brand h1 { font-size: 1.08rem; white-space: nowrap; }
html.mui .tagline { display: none; }
html.mui .site-header nav { width: auto; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
html.mui .site-header nav .nav-link { font-size: .85rem; }
html.mui.mui-tabbed .site-header nav { flex-wrap: nowrap; }
html.mui.mui-tabbed .site-header nav > .nav-link,
html.mui.mui-tabbed .site-header nav > .btn,
html.mui.mui-tabbed .site-header nav > #logoutBtn,
html.mui.mui-tabbed .site-header nav > .theme-toggle,
html.mui.mui-tabbed #userChipArea > a:not(.user-chip) { display: none !important; }
html.mui .user-chip { padding: 3px; background: none; }
html.mui .user-chip > span { display: none; }
html.mui .bell-panel { position: fixed; top: var(--mui-head, 58px); left: 8px; right: 8px; width: auto; max-width: none; max-height: 66vh; overflow-y: auto; }

/* home: the chips replace the large statistics strip and banner */
html.mui.mui-home .stats-bar, html.mui.mui-home .campus-hero { display: none; }
html.mui.mui-home .filters {
  position: sticky; top: var(--mui-head, 58px); z-index: 30; gap: 8px; align-items: center;
  margin: 0 calc(50% - 50vw) 8px; padding: 10px calc(50vw - 50%) 8px;
  background: var(--mut-offwhite); transition: top .26s ease;
}
html.mui.mui-home.mui-header-hidden .filters { top: 0; padding-top: calc(10px + env(safe-area-inset-top, 0px)); box-shadow: 0 6px 14px rgba(0,0,0,.08); }
html.mui .filters input[type="search"] { flex: 1 1 0; min-width: 0; height: 46px; border-radius: 999px; }
html.mui .mui-filter-btn { display: grid; place-items: center; position: relative; width: 46px; height: 46px; flex: none; border-radius: 50%; border: 2px solid var(--border); background: var(--white); color: var(--text); cursor: pointer; }
.mui-filter-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.mui-filter-count { position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; border-radius: 10px; background: var(--mut-orange); color: #fff; font-size: .7rem; font-weight: 800; line-height: 19px; }
.mui-filter-count[hidden] { display: none; }
html.mui .mui-chips { display: flex; gap: 6px; width: 100%; overflow-x: auto; scrollbar-width: none; padding: 1px 0; }
.mui-chips::-webkit-scrollbar { display: none; }
.mui-chip { flex: 1 0 auto; min-height: 38px; padding: 0 11px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 999px; border: 1px solid var(--border); background: var(--white); color: var(--text); font: 700 .82rem var(--font); cursor: pointer; transition: background-color .2s, color .2s; }
.mui-chip.is-active { background: var(--mut-green); border-color: var(--mut-green); color: #fff; }
.mui-chip-count { min-width: 20px; padding: 0 5px; border-radius: 10px; background: rgba(125,140,135,.18); font-size: .72rem; line-height: 20px; }
.mui-chip.is-active .mui-chip-count { background: rgba(255,255,255,.25); }

/* compact item cards: several fit on one screen */
html.mui .items-grid { grid-template-columns: 1fr; gap: 10px; margin-bottom: 24px; }
html.mui .item-card { flex-direction: row; align-items: center; border-radius: 14px; }
html.mui .item-card:hover { transform: none; }
html.mui .item-card:active { box-shadow: 0 0 0 2px var(--mut-green); }
html.mui .item-card .item-photo { width: 94px; min-width: 94px; height: 108px; margin-left: 8px; border-radius: 10px; font-size: 2.1rem; }
html.mui .item-card .item-body { min-width: 0; padding: 10px 12px; gap: 3px; }
html.mui .item-card .item-title { margin: 0; font-size: .98rem; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
html.mui .item-card .item-meta { margin: 0; font-size: .75rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
html.mui .item-card .item-description { margin: 0; font-size: .81rem; -webkit-line-clamp: 1; }
html.mui .item-card .badge { font-size: .63rem; padding: 2px 8px; }
html.mui #mapSection { scroll-margin-top: 130px; }
#campusMap { position: relative; z-index: 0; isolation: isolate; }

/* existing pop-ups open from the bottom */
html.mui .modal-overlay { align-items: flex-end; padding: 0; z-index: 1000; }
html.mui .modal { max-width: 100%; max-height: 92vh; max-height: 92dvh; border-radius: 20px 20px 0 0; padding: 0 18px calc(24px + env(safe-area-inset-bottom, 0px)); overscroll-behavior: contain; }
html.mui .modal > .mui-grab { display: block; position: sticky; top: 0; z-index: 3; height: 30px; margin: 0 -18px; background: var(--white); touch-action: none; cursor: grab; }
html.mui .modal > .mui-grab::before, .mui-sheet-head::before { content: ""; position: absolute; top: 9px; left: 50%; width: 42px; height: 5px; margin-left: -21px; border-radius: 3px; background: var(--border); }
html.mui .modal .modal-close { position: sticky; float: right; top: 30px; z-index: 4; width: 40px; height: 40px; margin: -6px -8px 0 6px; background: var(--white); }

/* slide-up sheets */
.mui-sheet-wrap { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: flex-end; }
.mui-sheet-wrap[hidden] { display: none; }
.mui-backdrop { position: absolute; inset: 0; background: rgba(8, 24, 18, .55); }
.mui-sheet { position: relative; width: 100%; max-height: 86vh; max-height: 86dvh; overflow-y: auto; overscroll-behavior: contain; background: var(--white); color: var(--text); border-radius: 20px 20px 0 0; padding: 0 16px calc(18px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -10px 30px rgba(0,0,0,.25); outline: none; }
.mui-sheet-head { position: sticky; top: 0; z-index: 1; padding: 24px 0 8px; background: var(--white); touch-action: none; cursor: grab; }
.mui-sheet-head h2 { margin: 0; font-size: 1.05rem; }
.mui-item { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 50px; padding: 0 10px; border: 0; border-radius: 12px; background: none; color: var(--text); font: 600 .98rem var(--font); text-align: left; text-decoration: none; cursor: pointer; }
.mui-item:hover { text-decoration: none; }
.mui-item:active, .mui-item:focus-visible { background: rgba(11,110,79,.12); }
.mui-item svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mui-field label { display: block; margin: 10px 0 4px; font-size: .8rem; font-weight: 700; color: var(--muted); }
.mui-field select { width: 100%; min-height: 46px; padding: 8px 12px; border: 2px solid var(--border); border-radius: var(--radius); background: var(--white); color: var(--text); font: 16px var(--font); }
.mui-field .map-toggle-btn { width: 100%; min-height: 46px; margin-top: 10px; justify-content: center; }
.mui-field .map-toggle-btn[hidden] { display: none; }
.mui-actions { display: flex; gap: 10px; margin-top: 16px; }
.mui-actions .btn { flex: 1; min-height: 46px; }

/* bottom menu bar */
html.mui.mui-tabbed body { padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
html.mui.mui-tabbed .mui-tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 800; gap: 0; padding: 0 0 env(safe-area-inset-bottom, 0px); background: var(--white); border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgba(0,0,0,.09); }
.mui-tab { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; min-height: 60px; padding: 0; border: 0; background: none; color: var(--muted); font: 700 .68rem var(--font); text-decoration: none; cursor: pointer; }
.mui-tab:hover { text-decoration: none; }
.mui-tab.is-active { color: var(--mut-green); }
body[data-theme="dark"] .mui-tab.is-active { color: #5fd3a9; }
.mui-tab-icon { display: grid; place-items: center; height: 28px; }
.mui-tab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mui-plus { width: 50px; height: 50px; margin-top: -24px; border-radius: 50%; background: var(--mut-orange); color: #fff; border: 4px solid var(--white); box-sizing: content-box; box-shadow: 0 4px 12px rgba(232,145,45,.45); }
.mui-tab .mui-plus svg { width: 26px; height: 26px; stroke-width: 2.6; }
.mui-ind { position: absolute; top: 6px; width: 48px; height: 28px; margin-left: -24px; border-radius: 999px; background: rgba(46,170,128,.17); pointer-events: none; }
.mui-tab-badge { position: absolute; top: 3px; left: 54%; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: .66rem; line-height: 18px; text-align: center; }

/* floating things, forms and touch sizes */
html.mui.mui-tabbed .fab { display: none !important; }
html.mui .fab { transition: none; }
html.mui.mui-tabbed .chat-panel { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); max-height: calc(100dvh - 90px); }
html.mui.mui-tabbed #toastContainer { bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important; }
html.mui input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), html.mui select, html.mui textarea { font-size: 16px; }
html.mui .btn:not(.btn-small) { min-height: 44px; }
html.mui .btn:hover { transform: none; }
html.mui .install-bar { padding: 8px 12px; }
html.mui .install-text { font-size: .86rem; }
html.mui .profile-grid { margin-top: 16px; gap: 16px; }
html.mui-lock, html.mui-lock body { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  html.mui .filters, .mui-chip { transition: none !important; }
}
html.mui:not(.mui-tabbed) .site-header nav > a[href="tags.html"] { display: none !important; }
html.mui:not(.mui-tabbed) .brand { flex: 0 1 auto; }
html.mui:not(.mui-tabbed) .site-header .bell-wrap { display: none; }
