/* NeviLex: the bottom navigation on phones. See nav.php. */
.nvxn { display: none; }
@media (max-width: 899px) {
	/* iPhones without a home button keep a strip at the bottom for the home line (34px). The full strip
	   left an empty band under the icons, so the bar only keeps what the home line itself needs. */
	html.nvxn-on { --nvxn-pad: max(2px, calc(env(safe-area-inset-bottom, 0px) - 20px)); --nvxn-h: calc(56px + var(--nvxn-pad)); }
	html.nvxn-on .nvxn { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9000; display: flex; align-items: flex-end; direction: rtl; box-sizing: border-box; height: var(--nvxn-h); padding: 0 4px var(--nvxn-pad); transform: translateY(var(--nvxn-dy, 0px));
		background: #fff; border-top: 1px solid #dfe5ee; box-shadow: 0 -4px 16px rgba(10, 20, 35, .07); transition: transform .22s ease; }
	html.nvxn-on.nvxn-hid .nvxn, html.nvxn-on.nvxn-kb .nvxn { transform: translateY(calc(100% + 160px + var(--nvxn-dy, 0px))); }
	/* iPhone Safari: as its toolbar shrinks or floats, the screen reaches below the bottom the page sees, and the
	   text showed through under the bar. The bar's background carries on down past the bottom to cover that. */
	html.nvxn-on .nvxn::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 140px; background: inherit; pointer-events: none; }
	html.nvxn-on body { padding-bottom: var(--nvxn-h); } /* the end of every page stays reachable */

	.nvxn .nvxn-i { position: relative; flex: 1 1 0; min-width: 0; height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; margin: 0; padding: 0 2px; border: 0; background: transparent; box-shadow: none;
		color: #5b6b7e !important; text-decoration: none !important; font: inherit; font-size: 11px; line-height: 1.6; cursor: pointer; -webkit-tap-highlight-color: transparent; }
	.nvxn .nvxn-i[hidden] { display: none; }
	.nvxn .nvxn-i span { display: block; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding-bottom: 2px; }
	.nvxn .nvxn-i svg { flex: none; }
	.nvxn.is-6 .nvxn-i { font-size: 10.5px; padding: 0 1px; } /* six items: a touch smaller, so the labels fit */
	.nvxn .nvxn-i:active { background: #f1f4f8; }
	.nvxn .nvxn-i.is-on { color: #1f3366 !important; font-weight: 700; }
	.nvxn .nvxn-i.is-on::before { content: ""; position: absolute; top: 0; left: 50%; width: 28px; height: 3px; margin-left: -14px; border-radius: 0 0 3px 3px; background: #1f3366; }

	/* ފިހުރިސްތު: a raised round button in the middle. */
	.nvxn .nvxn-toc { overflow: visible; }
	.nvxn .nvxn-toc i { display: flex; align-items: center; justify-content: center; width: 50px; height: 50px; margin-top: -24px; border-radius: 50%; background: #1f3366; color: #fff; border: 3px solid #fff; box-shadow: 0 4px 12px rgba(31, 51, 102, .35); box-sizing: border-box; }
	.nvxn .nvxn-toc span { color: #1f3366; font-weight: 700; }
	.nvxn .nvxn-toc:active { background: transparent; }
	.nvxn .nvxn-toc:active i { transform: scale(.95); }
	.nvxn .nvxn-i:focus-visible { outline: 2px solid #2F6DB5; outline-offset: -4px; border-radius: 10px; }

	/* Floating buttons (back to top, reading tools, dark mode) sit above the bar while it shows, with a gap.
	   "translate" adds to whatever transform the theme uses to show and hide them, instead of replacing it. */
	html.nvxn-on .go-top, html.nvxn-on .nvxl-tools:not(.is-docked), html.nvxn-on .nvxd-btn.is-float { translate: 0 calc(-1 * var(--nvxn-h) - 10px + var(--nvxn-dy, 0px)); transition-property: all; transition-duration: .22s; }
	html.nvxn-on.nvxn-hid .go-top, html.nvxn-on.nvxn-hid .nvxl-tools:not(.is-docked), html.nvxn-on.nvxn-hid .nvxd-btn.is-float,
	html.nvxn-on.nvxn-kb .go-top, html.nvxn-on.nvxn-kb .nvxl-tools:not(.is-docked), html.nvxn-on.nvxn-kb .nvxd-btn.is-float { translate: none; }

	/* Dark mode */
	html.nvxl-dark.nvxn-on .nvxn { background: #121a25; border-top-color: #2b3a4c; box-shadow: 0 -4px 16px rgba(0, 0, 0, .35); }
	html.nvxl-dark .nvxn .nvxn-i { color: #9fb0c4 !important; }
	html.nvxl-dark .nvxn .nvxn-i.is-on, html.nvxl-dark .nvxn .nvxn-toc span { color: #cfe0f5 !important; }
	html.nvxl-dark .nvxn .nvxn-i.is-on::before { background: #8fb4e6; }
	html.nvxl-dark .nvxn .nvxn-toc i { background: #2F6DB5; border-color: #121a25; }
	html.nvxl-dark .nvxn .nvxn-i:active { background: #1d2a3a; }
}
@media print { .nvxn { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .nvxn, .go-top, .nvxl-tools, .nvxd-btn { transition: none !important; } }

.nvxn-dbg { position: fixed; top: 60px; left: 8px; z-index: 99999; padding: 8px 10px; background: #000; color: #0f0; font: 12px/1.5 monospace; direction: ltr; white-space: pre; border-radius: 6px; }
