/* Mobile 3 "Modern" look, pass 1: the shell (title bar, bottom navigation, colors, buttons and inputs).
   Every rule is scoped to html[data-style="modern"], which is set from the Classic / Modern switch on the Settings page,
   so with Classic selected none of this applies.  Light and dark follow the phone (prefers-color-scheme).
   Screens not restyled yet (reports, ServiceTraks, Trip, custom location) keep their classic layout; in dark mode they
   are shown as light panels so they stay readable. */

html[data-style="modern"] {
	color-scheme: light dark;
	--bg:#F3F5F8; --card:#FFFFFF; --tx:#18202B; --tx2:#5A6677; --bd:#E1E6ED;
	--ac:#3A63A5; --acs:#E4ECF8; --aco:#FFFFFF; --nav:#FFFFFF;
	--bar:#3A63A5; --baro:#FFFFFF;   /* title bar and the text / icons on it */
	--go:#1E8E4E; --gos:#E1F4E8; --st:#C93A3A; --sts:#FBE6E6; --id:#8A5A00; --ids:#FBEFD6;   /* ok / overdue / due soon: text and tint */
	--safe:max(env(safe-area-inset-bottom, 0px), 20px);   /* space under the bottom nav: the home-indicator area on newer iPhones, at least 20px */
	--side:max(env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px), 16px);   /* keeps the first and last nav buttons off the rounded screen corners */
}
@media (prefers-color-scheme: dark) {
	html[data-style="modern"] {
		--bg:#0E131A; --card:#171E28; --tx:#E9EDF3; --tx2:#9AA6B6; --bd:#263040;
		--ac:#86A9E0; --acs:#22304A; --aco:#0E131A; --nav:#131A23;
		--bar:#1E2D47; --baro:#E9EDF3;
		--go:#55C987; --gos:#16301F; --st:#F08080; --sts:#3A1E22; --id:#E6B454; --ids:#3A2F17;
	}
}

/* ---- a color per page: the title bar, the active tab and the page's accent follow the active bottom-nav tab.
   Home (and unit history) and the login screen keep the default blue above. */
html[data-style="modern"]:has(#m2.mma) {--bar:#1F7A6D; --ac:#1F7A6D; --acs:#DDF0EC;}
html[data-style="modern"]:has(#m3.mma) {--bar:#A25E0B; --ac:#A25E0B; --acs:#F8EBD6;}
html[data-style="modern"]:has(#m4.mma) {--bar:#2E7D4F; --ac:#2E7D4F; --acs:#DEF0E5;}
html[data-style="modern"]:has(#m5.mma) {--bar:#5A6677; --ac:#4F5B6C; --acs:#E6E9EE;}
@media (prefers-color-scheme: dark) {
	html[data-style="modern"]:has(#m2.mma) {--bar:#14403B; --ac:#6FD0C0; --acs:#173A36;}
	html[data-style="modern"]:has(#m3.mma) {--bar:#4A3210; --ac:#E6B454; --acs:#3A2F17;}
	html[data-style="modern"]:has(#m4.mma) {--bar:#17402B; --ac:#6FD095; --acs:#173A27;}
	html[data-style="modern"]:has(#m5.mma) {--bar:#2A3340; --ac:#A9B6C8; --acs:#263040;}
}
html[data-style="modern"] body {
	background-color:var(--bg);
	font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* ---- title bar */
html[data-style="modern"] #title {
	background:var(--bar);
	filter:none;
	color:var(--baro);
	text-shadow:none;
	font-size:1.5em;
	font-weight:600;
}
html[data-style="modern"] #titlelabel {top:10px;left:52px;width:55%;}

html[data-style="modern"] #hamMenuToggle span {background:var(--baro);}
html[data-style="modern"] #hamMenuToggle input:checked ~ span {background:var(--tx);}

/* round Back / Refresh buttons, icons drawn from an SVG so they follow the theme color */
html[data-style="modern"] #back,
html[data-style="modern"] #refresh {
	top:5px;
	width:36px;
	height:36px;
	border-radius:50%;
	border:0.5px solid rgba(255, 255, 255, 0.35);
	background:rgba(255, 255, 255, 0.16);
	background-image:none;
	opacity:1;
}
html[data-style="modern"] #refresh {right:10px;}
html[data-style="modern"] #back {right:54px;}
html[data-style="modern"] #back::before,
html[data-style="modern"] #refresh::before {
	content:"";
	position:absolute;
	top:0; right:0; bottom:0; left:0;
	margin:auto;
	width:20px;
	height:20px;
	background-color:var(--baro);
	-webkit-mask-repeat:no-repeat; mask-repeat:no-repeat;
	-webkit-mask-position:center; mask-position:center;
	-webkit-mask-size:contain; mask-size:contain;
}
html[data-style="modern"] #back::before {-webkit-mask-image:url("../images/modern/back.svg"); mask-image:url("../images/modern/back.svg");}
html[data-style="modern"] #refresh::before {-webkit-mask-image:url("../images/modern/refresh.svg"); mask-image:url("../images/modern/refresh.svg");}

/* ---- bottom navigation */
html[data-style="modern"] #menubuttons {
	background:var(--nav);
	filter:none;
	border-top:0.5px solid var(--bd);
	box-sizing:border-box;
	font-size:0;   /* no gap between the inline buttons, so five of them fit exactly */
	bottom:0 !important;   /* the classic code lifts it 20px on one iPhone model; the safe-area padding below does that job for every phone */
	height:calc(56px + var(--safe));
	padding-bottom:var(--safe);
	padding-left:var(--side);
	padding-right:var(--side);
}
html[data-style="modern"] #menubuttonspacer {display:none;}
/* the content area ends where the taller nav begins (the classic code sizes it in script) */
html[data-style="modern"] #mainwindow {height:auto !important; bottom:calc(56px + var(--safe));}
html[data-style="modern"] .mm {
	width:calc(20% - 5px);
	max-width:76px;
	height:46px;
	margin:4px 2px 2px 2px;
	padding:0;
	border:0;
	border-radius:12px;
	background-color:transparent;
	color:var(--tx2);
	font-size:10px;
	font-family:inherit;
}
html[data-style="modern"] .mm.mma {background-color:var(--acs);color:var(--ac);border:0;}
html[data-style="modern"] .mm img.mi, html[data-style="modern"] .mm br {display:none;}
html[data-style="modern"] .mm::before {
	content:"";
	display:block;
	width:22px;
	height:22px;
	margin:0 auto 2px auto;
	background-color:currentColor;
	-webkit-mask-repeat:no-repeat; mask-repeat:no-repeat;
	-webkit-mask-position:center; mask-position:center;
	-webkit-mask-size:contain; mask-size:contain;
}
html[data-style="modern"] #m1::before {-webkit-mask-image:url("../images/modern/home.svg"); mask-image:url("../images/modern/home.svg");}
html[data-style="modern"] #m2::before {-webkit-mask-image:url("../images/modern/reports.svg"); mask-image:url("../images/modern/reports.svg");}
html[data-style="modern"] #m3::before {-webkit-mask-image:url("../images/modern/ping.svg"); mask-image:url("../images/modern/ping.svg");}
html[data-style="modern"] #m4::before {-webkit-mask-image:url("../images/modern/map.svg"); mask-image:url("../images/modern/map.svg");}
html[data-style="modern"] #m5::before {-webkit-mask-image:url("../images/modern/settings.svg"); mask-image:url("../images/modern/settings.svg");}

/* ---- pull-down refresh (js/pullrefresh.js) replaces the refresh button, except on the map where dragging down moves the map */
html[data-style="modern"]:not(.keep-refresh) #refresh {display:none !important;}
html[data-style="modern"]:not(.keep-refresh) #back {right:10px;}
html[data-style="modern"] #ptr {   /* the gap above the shifted screen; its height follows the pull */
	position:fixed;
	left:0;
	right:0;
	top:46px;
	height:0;
	overflow:hidden;
	display:none;
	align-items:center;
	justify-content:center;
	pointer-events:none;
	z-index:5;
}
html[data-style="modern"] #ptr .ptr-icon {
	position:relative;
	flex:none;
	width:36px;
	height:36px;
	border-radius:50%;
	background:var(--card);
	border:0.5px solid var(--bd);
	color:var(--tx2);
}
html[data-style="modern"] #ptr .ptr-icon::before {
	content:"";
	position:absolute;
	top:0; right:0; bottom:0; left:0;
	margin:auto;
	width:20px;
	height:20px;
	background-color:currentColor;
	-webkit-mask:url("../images/modern/refresh.svg") center / contain no-repeat;
	mask:url("../images/modern/refresh.svg") center / contain no-repeat;
}
html[data-style="modern"] #ptr.ptr-armed .ptr-icon {color:var(--ac);}
html[data-style="modern"] #ptr.ptr-spin .ptr-icon::before {animation:ptrspin 0.8s linear infinite;}
@keyframes ptrspin {to {transform:rotate(360deg);}}
/* ---- slide-out menu and generic text colors for the screens that follow the theme */
html[data-style="modern"] #hamMenu {background:var(--card);border-color:var(--bd);color:var(--tx);}
html[data-style="modern"] #loginpage,
html[data-style="modern"] #settingspage,
html[data-style="modern"] #pingpage,
html[data-style="modern"] #reportpage {color:var(--tx);}
html[data-style="modern"] .slabel {color:var(--tx);}
html[data-style="modern"] #version {color:var(--ac) !important;}   /* the classic markup sets this color inline */
html[data-style="modern"] #settingspage input[type="radio"] {accent-color:var(--ac);width:18px;height:18px;margin:0 4px 0 0;vertical-align:-4px;}
html[data-style="modern"] #settingspage label {font-size:14px;}
html[data-style="modern"] #settingspage button {
	background-color:var(--card);
	color:var(--tx);
	border:0.5px solid var(--bd);
	border-radius:10px;
	padding:6px 12px;
	font-size:13px;
}
html[data-style="modern"] #pingunit {color:var(--ac);}

/* ---- inputs and buttons */
html[data-style="modern"] input[type="text"],
html[data-style="modern"] input[type="password"],
html[data-style="modern"] select,
html[data-style="modern"] textarea,
html[data-style="modern"] .ls14, html[data-style="modern"] .ls23,
html[data-style="modern"] .msli1, html[data-style="modern"] .sselcti1 {
	background-color:var(--card);
	color:var(--tx);
	border:0.5px solid var(--bd);
	border-radius:10px;
}
html[data-style="modern"] button {font-family:inherit;}
html[data-style="modern"] .lb1,
html[data-style="modern"] .lb2 {
	height:40px;
	width:96px;
	border-radius:12px;
	font-size:14px;
	font-weight:600;
}
html[data-style="modern"] .lb1 {background-color:var(--card);color:var(--tx);border:0.5px solid var(--bd);}
html[data-style="modern"] .lb2 {background-color:var(--ac);color:var(--aco);border:0;}
html[data-style="modern"] .modal-content {background-color:var(--card);color:var(--tx);border-color:var(--bd);border-radius:14px;}
html[data-style="modern"] .close {color:var(--tx2);}

/* ---- fleet / unit grids (rows keep their classic layout for now) */
html[data-style="modern"] .k-grid,
html[data-style="modern"] .k-grid-content,
html[data-style="modern"] .k-grid table,
html[data-style="modern"] .k-grid tr,
html[data-style="modern"] .k-grid td,
html[data-style="modern"] .k-grid tr.k-alt {
	background-color:var(--card);
	color:var(--tx);
	border-color:var(--bd);
}
html[data-style="modern"] .k-grid tr td {border-bottom:1px solid var(--bd);}
html[data-style="modern"] .k-grid .k-state-selected {background:transparent;color:var(--tx);}
html[data-style="modern"] .k-grid td.k-state-selected:hover,
html[data-style="modern"] .k-grid tr.k-state-selected:hover {background-color:var(--acs);color:var(--tx);}

/* ---- fleet summary: compact rows.  The rows keep their markup (rowTemplate in app.htm); only their look changes.
   Left to right: the status icon, the unit name with the time, the address underneath, and a "Map" button.  Tapping the row opens the unit's history; tapping Map opens its current location. */
html[data-style="modern"] #fleetgrid td {height:56px;padding:0;}
html[data-style="modern"] #fleetgrid tr:active td {background:var(--acs);}

html[data-style="modern"] #fleetgrid .gridrow {height:56px;}
html[data-style="modern"] #fleetgrid .status {left:8px;top:16px;width:24px;height:24px;}
html[data-style="modern"] #fleetgrid .unit {
	left:40px;
	top:8px;
	width:calc(100% - 128px);
	font-size:14px;
	font-weight:600;
}
html[data-style="modern"] #fleetgrid .reportdate {
	right:8px;
	top:10px;
	width:auto;
	font-size:11px;
	color:var(--tx2);
}
html[data-style="modern"] #fleetgrid .address {
	left:40px;
	top:31px;
	width:calc(100% - 48px);
	font-size:12px;
	color:var(--tx2);
	white-space:nowrap;
	overflow:hidden;
	text-overflow:ellipsis;
}

/* the blue arrow becomes a pin with a "Map" label (the image stays, invisible, so the tap still opens the map) */
html[data-style="modern"] #fleetgrid td:last-child {width:56px !important;border-left:0;}
html[data-style="modern"] #fleetgrid .detail {position:relative;width:56px;height:56px;}
html[data-style="modern"] #fleetgrid .detail img {position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;}
html[data-style="modern"] #fleetgrid .detail::before {
	content:"";
	position:absolute;
	top:8px;
	left:17px;
	width:22px;
	height:22px;
	background-color:var(--ac);
	-webkit-mask:url("../images/modern/pin.svg") center / contain no-repeat;
	mask:url("../images/modern/pin.svg") center / contain no-repeat;
	pointer-events:none;
}
html[data-style="modern"] #fleetgrid .detail::after {
	content:"Map";
	position:absolute;
	left:0;
	right:0;
	top:32px;
	text-align:center;
	font-size:10px;
	font-weight:600;
	color:var(--ac);
	pointer-events:none;
}
/* ---- unit history: compact rows to match the fleet list.  The rows keep their markup (rowDetailTemplate in app.htm), so the
   tap-to-show-the-other-address and double-tap-to-save-a-location behavior are unchanged.
   Left to right: the status icon, the date and time (red when the position is not an actual report) with the address under
   it, and on the right the speed and direction (moving rows only) with the odometer under them. */
html[data-style="modern"] #detailgrid td {height:56px;padding:0;}
html[data-style="modern"] #detailgrid tr:active td {background:var(--acs);}

html[data-style="modern"] #detailgrid .gridrowunit {height:56px;}
html[data-style="modern"] #detailgrid .dstatus {left:8px;top:16px;width:24px;height:24px;}
html[data-style="modern"] #detailgrid .dreportdate {
	left:40px;
	top:8px;
	font-size:14px;
	font-weight:600;
}
html[data-style="modern"] #detailgrid .daddress {
	left:40px;
	top:31px;
	width:calc(100% - 140px);
	font-size:12px;
	color:var(--tx2);
	white-space:nowrap;
	overflow:hidden;
	text-overflow:ellipsis;
}
html[data-style="modern"] #detailgrid .dspeed {right:44px;top:9px;width:34px;height:auto;font-size:13px;font-weight:600;text-align:right;}
html[data-style="modern"] #detailgrid .dcourse {right:12px;top:9px;width:30px;height:auto;font-size:13px;font-weight:600;text-align:left;color:var(--tx2);}
html[data-style="modern"] #detailgrid .dodometer {
	right:12px;
	top:31px;
	width:auto;
	height:auto;
	font-size:11.5px;
	color:var(--tx2);
	text-align:right;
}
/* ---- settings: a grouped list instead of fixed pixel positions.  The markup is shared with Classic, so this only switches the
   absolute positioning off and lays the same elements out as rows inside three cards (Selections, Default Login, Misc).
   The page scrolls, because the stacked layout is taller than the screen. */
html[data-style="modern"] #settingspage {overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch;}
html[data-style="modern"] #settingselect {position:static;padding-bottom:28px;}
html[data-style="modern"] #settingselect .slabel {
	position:static;
	width:auto;
	margin:18px 24px 6px;
	font-size:13px;
	font-weight:600;
	color:var(--tx2);
}
html[data-style="modern"] #settingselect .sselct {
	position:static;
	display:flex;
	align-items:center;
	gap:12px;
	width:auto;
	height:auto;
	min-height:52px;
	margin:0 14px;
	padding:6px 14px;
	box-sizing:border-box;
	background:var(--card);
	border:solid var(--bd);
	border-width:0.5px 0.5px 0 0.5px;
	font-size:15px;
}
html[data-style="modern"] #settingselect .slabel + .sselct {border-radius:14px 14px 0 0;}
html[data-style="modern"] #settingselect .sselct:has(+ .slabel),
html[data-style="modern"] #settingselect .sselct:last-child {border-bottom-width:0.5px;border-radius:0 0 14px 14px;}
html[data-style="modern"] #settingselect .sselctl {position:static;width:110px;height:auto;margin:0;text-align:left;font-size:15px;flex:none;}
html[data-style="modern"] #settingselect .sselcti {position:static;display:flex;align-items:center;flex-wrap:wrap;width:auto;flex:1;min-width:0;padding:0 !important;}
html[data-style="modern"] #settingselect .sselcti input[type="text"],
html[data-style="modern"] #settingselect .sselcti input[type="password"],
html[data-style="modern"] #settingselect .sselcti select {
	width:100% !important;
	height:40px !important;
	padding:0 12px !important;
	box-sizing:border-box;
	font-size:15px !important;
	background-color:var(--bg);
}

/* the image check boxes become toggle switches */
html[data-style="modern"] #allowdefault,
html[data-style="modern"] #autologin {position:relative;display:block;width:50px;height:30px;margin-left:auto;}
html[data-style="modern"] #allowdefault input,
html[data-style="modern"] #autologin input {position:absolute;top:0;left:0;width:100%;height:100%;margin:0;opacity:0;z-index:2;}
html[data-style="modern"] #allowdefault span,
html[data-style="modern"] #autologin span,
html[data-style="modern"] #allowdefault input:checked + span,
html[data-style="modern"] #autologin input:checked + span {
	top:0;
	left:0;
	width:100%;
	height:100%;
	background-image:none;
	background-color:var(--bd);
	border-radius:99px;
	transition:background-color 0.2s;
}
html[data-style="modern"] #allowdefault input:checked + span,
html[data-style="modern"] #autologin input:checked + span {background-color:var(--ac);}
html[data-style="modern"] #allowdefault span::after,
html[data-style="modern"] #autologin span::after {
	content:"";
	position:absolute;
	top:3px;
	left:3px;
	width:24px;
	height:24px;
	border-radius:50%;
	background:#FFFFFF;
	box-shadow:0 1px 2px rgba(0, 0, 0, 0.35);
	transition:transform 0.2s;
}
html[data-style="modern"] #allowdefault input:checked + span::after,
html[data-style="modern"] #autologin input:checked + span::after {transform:translateX(20px);}

/* radio choices (Classic / Modern, map provider) become tappable pills */
html[data-style="modern"] #settingspage input[type="radio"] {position:absolute;width:1px;height:1px;margin:0;opacity:0;}
html[data-style="modern"] #settingspage input[type="radio"] + label {
	display:inline-block;
	width:auto !important;
	margin:3px 6px 3px 0;
	padding:7px 14px;
	border:0.5px solid var(--bd);
	border-radius:99px;
	background:var(--bg);
	font-size:14px;
}
html[data-style="modern"] #settingspage input[type="radio"]:checked + label {background:var(--ac);border-color:var(--ac);color:var(--aco);}

/* version row: the number and Reload on one line, the map provider choices underneath */
html[data-style="modern"] #versionrow {flex-wrap:wrap;}
html[data-style="modern"] #versionrow #version {position:static;width:auto;flex:1;margin:0;font-size:15px;}
html[data-style="modern"] #versionrow > div:nth-child(3) {position:static !important;margin:0 !important;}
html[data-style="modern"] #mapoption {flex:0 0 100%;margin-top:6px;padding:10px 0 4px;border-top:0.5px solid var(--bd);}
html[data-style="modern"] #mapoption .sselctmo {position:static;width:auto !important;height:auto;margin:0;text-align:left !important;}
html[data-style="modern"] #mapoption .sselctmo:first-child {font-size:13px;font-weight:600;color:var(--tx2);margin-bottom:6px;}
html[data-style="modern"] #mapoption br {display:none;}
/* ---- reports.  Report list, ServiceTraks (summary, detail, perform service) and Unit Trip.  Only the look changes; the grids,
   tables and the Perform Service form are still built by the same code, so what taps do is unchanged. */
html[data-style="modern"] #reportlistpage {color:var(--tx);}
html[data-style="modern"] input[type="checkbox"] {accent-color:var(--ac);}

/* report list */
html[data-style="modern"] #selectreport {background:transparent;border:0;}
html[data-style="modern"] #selectreport table {border-collapse:separate !important;border-spacing:0 8px;width:calc(100% - 24px) !important;margin:0 12px;}
html[data-style="modern"] #selectreport table,
html[data-style="modern"] #selectreport tbody,
html[data-style="modern"] #selectreport tr {background:transparent;}
html[data-style="modern"] #selectreport td {background:var(--card);border:solid var(--bd);border-width:0.5px 0;height:64px;padding:0 !important;}
html[data-style="modern"] #selectreport td:first-child {border-left-width:0.5px;border-radius:14px 0 0 14px;width:60px !important;text-align:center;}
html[data-style="modern"] #selectreport td:first-child img {width:32px;height:32px;vertical-align:middle;}
html[data-style="modern"] #selectreport td:last-child {
	border-right-width:0.5px;
	border-radius:0 14px 14px 0;
	font-size:16px !important;
	position:relative;
	padding-right:40px !important;
}
html[data-style="modern"] #selectreport td:last-child::after {
	content:"";
	position:absolute;
	top:0; bottom:0; right:12px;
	width:20px;
	margin:auto 0;
	height:20px;
	background-color:var(--tx2);
	-webkit-mask:url("../images/modern/chevron.svg") center / contain no-repeat;
	mask:url("../images/modern/chevron.svg") center / contain no-repeat;
}
html[data-style="modern"] #selectreport tr.k-state-selected td,
html[data-style="modern"] #selectreport tr:active td {background:var(--acs);}

/* ServiceTraks summary: a card per unit.  Each card is a three-column grid, so it is exactly as tall as its content and the
   Description / Interval / Remaining lines of a service sit on the same row.  Each service is one line: a long description is
   cut off with an ellipsis instead of wrapping and pushing the other columns out of line. */
html[data-style="modern"] #servicegrid,
html[data-style="modern"] #servicegrid .k-grid-content,
html[data-style="modern"] #servicegrid table,
html[data-style="modern"] #servicegrid tbody,
html[data-style="modern"] #servicegrid tr {background:transparent;}
html[data-style="modern"] #servicegrid tr {height:auto !important;}
html[data-style="modern"] #servicegrid .k-grid-header {display:none;}
html[data-style="modern"] #servicegrid table {border-collapse:separate !important;border-spacing:0 10px;width:calc(100% - 24px) !important;margin:0 12px;}
html[data-style="modern"] #servicegrid td {
	background:var(--card);
	border:0.5px solid var(--bd);
	border-radius:14px;
	overflow:hidden;
	padding:0;
	height:auto;
}
html[data-style="modern"] #servicegrid .strow {
	position:relative;
	display:grid;
	grid-template-columns:50% 25% 25%;
	height:auto;
}
html[data-style="modern"] #servicegrid .strow > * {
	position:static !important;
	width:auto !important;
	height:auto !important;
	margin:0;
	border:0;
	min-width:0;
}
html[data-style="modern"] #servicegrid .stdescbox,
html[data-style="modern"] #servicegrid .stdatebox {display:none;}
html[data-style="modern"] #servicegrid .stdesc {grid-column:1 / -1;grid-row:1;padding:12px 14px 0;font-size:15px;}
html[data-style="modern"] #servicegrid .stdate,
html[data-style="modern"] #servicegrid .sthrs,
html[data-style="modern"] #servicegrid .stmiles {grid-row:2;padding:3px 0 11px;font-size:12px;color:var(--tx2);white-space:nowrap;}
html[data-style="modern"] #servicegrid .stdate {grid-column:1;padding-left:14px;}
html[data-style="modern"] #servicegrid .sthrs {grid-column:2;}
html[data-style="modern"] #servicegrid .stmiles {grid-column:3;}
html[data-style="modern"] #servicegrid .stservbox {grid-column:1 / -1;grid-row:3 / 5;background:var(--bg);border-top:0.5px solid var(--bd);z-index:0;}
html[data-style="modern"] #servicegrid .stservgl {grid-row:3;padding:9px 0 3px;font-size:11px;font-weight:600;color:var(--tx2);text-align:left;z-index:1;}
html[data-style="modern"] #servicegrid .stservdl {grid-column:1;padding-left:14px;}
html[data-style="modern"] #servicegrid .stservil {grid-column:2;}
html[data-style="modern"] #servicegrid .stservrl {grid-column:3;}
html[data-style="modern"] #servicegrid .stservgc {grid-row:4;padding:0 0 11px;font-size:12.5px;line-height:1.45;text-align:left;overflow:hidden;z-index:1;}
html[data-style="modern"] #servicegrid .stservd {grid-column:1;padding-left:14px;padding-right:14px;}
html[data-style="modern"] #servicegrid .stservi {grid-column:2;}
html[data-style="modern"] #servicegrid .stservr {grid-column:3;}
html[data-style="modern"] #servicegrid .stservd > div {padding:0 !important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
html[data-style="modern"] #servicegrid .stservi div,
html[data-style="modern"] #servicegrid .stservr div {white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}

/* due-soon / overdue colors, in the summary cards and in the detail table */
html[data-style="modern"] .sfrow2a {color:var(--tx);border-left:0;}
html[data-style="modern"] .sfrow2r {background-color:var(--sts);color:var(--st);border-left:0;}
html[data-style="modern"] .sfrow2y {background-color:var(--ids);color:var(--id);border-left:0;}
/* in the summary each value is its own line (a chip when overdue or due soon); the chips have no vertical padding so every
   line is the same height as the matching Description and Interval lines */
html[data-style="modern"] #servicegrid div.sfrow2a,
html[data-style="modern"] #servicegrid div.sfrow2r,
html[data-style="modern"] #servicegrid div.sfrow2y {display:block;width:-webkit-fit-content;width:fit-content;max-width:100%;padding:0;margin:0;border-radius:8px;font-size:1em;}
/* a chip reaches 8px past the text on each side, so the text of every line lines up with the column heading */
html[data-style="modern"] #servicegrid div.sfrow2r,
html[data-style="modern"] #servicegrid div.sfrow2y {padding:0 8px;margin-left:-8px;}
/* ServiceTraks detail: the equipment line and the service items as rounded tables */
html[data-style="modern"] #servicedetail {overflow-y:auto;padding-bottom:20px;}
html[data-style="modern"] #servicedetail table.equip,
html[data-style="modern"] #servicedetail table.service {
	border-collapse:separate;
	border-spacing:0;
	width:calc(100% - 24px);
	margin:8px 12px 0;
	background:var(--card);
	border:0.5px solid var(--bd);
	border-radius:14px;
	overflow:hidden;
	color:var(--tx);
}
html[data-style="modern"] #servicedetail th {background:var(--acs);color:var(--tx2);border:0;height:auto;padding:8px 4px;font-size:11px;font-weight:600;}
html[data-style="modern"] #servicedetail td {border:0;border-top:0.5px solid var(--bd);height:auto;padding:8px 6px;font-size:12.5px;}
html[data-style="modern"] #servicedetail table table td {border:0;padding:1px 2px;}
html[data-style="modern"] #serviceitems tr[style*="background"] {background-color:var(--gos) !important;}
html[data-style="modern"] #serviceitems tr:active {background-color:var(--acs);}

/* Perform Service: the same boxes, themed */
html[data-style="modern"] #serviceperform {color:var(--tx);}
html[data-style="modern"] #serviceperform #spdetailbox,
html[data-style="modern"] #serviceperform #spnextbox,
html[data-style="modern"] #serviceperform #nextschchoice {background:var(--card);border:0.5px solid var(--bd);border-radius:14px;}
html[data-style="modern"] #serviceperform #spnextsched,
html[data-style="modern"] #serviceperform #spnextinterval {background:transparent;border-color:var(--bd);}
html[data-style="modern"] #serviceperform #nextschchoice div {border-color:var(--bd) !important;}
html[data-style="modern"] #serviceperform #nextservice,
html[data-style="modern"] #serviceperform #nextSchedule {color:var(--tx2);font-size:13px;}
html[data-style="modern"] #serviceperform #spnextnote {border-radius:14px 14px 0 0;font-size:13px;}
html[data-style="modern"] .spgreen {background-color:var(--gos);color:var(--go);}
html[data-style="modern"] .spred {background-color:var(--sts);color:var(--st);}
html[data-style="modern"] .spdis {color:var(--tx2);opacity:0.6;}
html[data-style="modern"] #serviceperform textarea {background-color:var(--bg);color:var(--tx);border:0.5px solid var(--bd);border-radius:10px;}

/* Unit Trip */
html[data-style="modern"] #utripgrid,
html[data-style="modern"] #utripgrid .k-grid-content,
html[data-style="modern"] #utripgrid table,
html[data-style="modern"] #utripgrid tbody,
html[data-style="modern"] #utripgrid tr {background:transparent;}
html[data-style="modern"] #utripgrid .k-grid-header {background:transparent;border-width:0;}
html[data-style="modern"] #utripgrid td {background:var(--card);padding:0;}
html[data-style="modern"] #utripgrid .utdesc {color:var(--ac);font-size:16px;font-weight:600;padding-top:6px;}
html[data-style="modern"] #utripgrid .uthead {color:var(--tx2);font-size:11px;font-weight:600;}
html[data-style="modern"] #utripgrid .utsdate, html[data-style="modern"] #utripgrid .utstime,
html[data-style="modern"] #utripgrid .utsloc, html[data-style="modern"] #utripgrid .utsodo {font-weight:600;}
html[data-style="modern"] #utripgrid .utedate, html[data-style="modern"] #utripgrid .utetime,
html[data-style="modern"] #utripgrid .uteloc, html[data-style="modern"] #utripgrid .uteodo {color:var(--tx2);}
html[data-style="modern"] #utripgrid .uttripminlabel,
html[data-style="modern"] #utripgrid .uttripmin,
html[data-style="modern"] #utripgrid .utstopminlabel,
html[data-style="modern"] #utripgrid .utstopmin,
html[data-style="modern"] #utripgrid .uttripmileslabel,
html[data-style="modern"] #utripgrid .uttripmiles {border-color:var(--bd);font-size:12px;}
html[data-style="modern"] #utripgrid .uttotalrow {background:var(--gos);color:var(--tx);}
html[data-style="modern"] #utripgrid .uttotlabel {color:var(--go);}
/* ---- new custom location (reached by double-tapping a row in the unit history): a card of fields, a card of category choices
   (only one can be picked, which is what CustomLocCheck does) and the Cancel / Save buttons.  The page scrolls. */
html[data-style="modern"] #custompage {
	background:transparent;
	color:var(--tx);
	overflow-x:hidden;
	overflow-y:auto;
	-webkit-overflow-scrolling:touch;
	padding-bottom:24px;
	box-sizing:border-box;
}
/* the fields card (the first box on the page) */
html[data-style="modern"] #custompage > div:first-child {
	position:static !important;
	display:grid;
	grid-template-columns:100px 1fr;
	gap:0 10px;
	align-items:center;
	width:auto !important;
	height:auto !important;
	margin:12px !important;
	padding:8px 14px;
	box-sizing:border-box;
	background:var(--card) !important;
	border:0.5px solid var(--bd) !important;
	border-radius:14px !important;
}
html[data-style="modern"] #custompage .cll {position:static;width:auto;text-align:left;font-size:15px;}
html[data-style="modern"] #custompage .clin {
	position:static;
	width:auto;
	height:40px;
	margin:5px 0;
	padding:0 12px;
	box-sizing:border-box;
	font-size:15px;
	background-color:var(--bg);
	color:var(--tx);
	border:0.5px solid var(--bd);
	border-radius:10px;
}
html[data-style="modern"] #clname, html[data-style="modern"] #claddress, html[data-style="modern"] #clcity,
html[data-style="modern"] #clstate, html[data-style="modern"] #clzip, html[data-style="modern"] #cllat,
html[data-style="modern"] #cllong {width:auto !important;text-align:left !important;}

/* the category card: a label and a round selector per row */
html[data-style="modern"] #clcats {
	display:grid;
	grid-template-columns:1fr auto;
	margin:0 12px;
	background:var(--card);
	border:0.5px solid var(--bd);
	border-radius:14px;
	overflow:hidden;
}
html[data-style="modern"] #clcats > div:first-child {display:none;}   /* the empty box that draws the frame in Classic */
html[data-style="modern"] #clcats .clcbxl {position:static;display:flex;align-items:center;width:auto;text-align:left;padding:0 16px;font-size:15px;}
html[data-style="modern"] #clcats div[id="custloccbx"] {position:relative !important;top:0 !important;left:0 !important;width:52px;height:100%;min-height:50px;}
html[data-style="modern"] #cllabel2, html[data-style="modern"] #cllabel4, html[data-style="modern"] #cllabel5,
html[data-style="modern"] #cllabel2 + div, html[data-style="modern"] #cllabel4 + div, html[data-style="modern"] #cllabel5 + div {border-top:0.5px solid var(--bd);}
html[data-style="modern"] #clcats div[id="custloccbx"] input[type="checkbox"] {position:absolute;top:0;left:0;width:100%;height:100%;margin:0;opacity:0;z-index:2;}
html[data-style="modern"] #clcats div[id="custloccbx"] span,
html[data-style="modern"] #clcats div[id="custloccbx"] input:checked + span {
	top:50%;
	left:14px;
	width:24px;
	height:24px;
	margin-top:-12px;
	box-sizing:border-box;
	border:2px solid var(--tx2);
	border-radius:50%;
	background-image:none !important;
	background-color:transparent;
}
html[data-style="modern"] #clcats div[id="custloccbx"] input:checked + span {
	border-color:var(--ac);
	background-color:var(--ac);
	box-shadow:inset 0 0 0 3px var(--card);
}

/* Cancel and Save, one on each side */
html[data-style="modern"] #clbtns {display:flex;justify-content:space-between;margin:16px 12px 0;}
html[data-style="modern"] #clbtns .clcan,
html[data-style="modern"] #clbtns .clsave {position:static;}
/* ---- map screen */
html[data-style="modern"] #bmap {border:0;}

/* the V (satellite) and T (traffic) buttons: round buttons with an icon, lit up while on (the "on" class is set by MapButton in mapping.js) */
html[data-style="modern"] #birdseye,
html[data-style="modern"] #traffic {
	left:10px;
	width:40px;
	height:40px;
	border:0.5px solid var(--bd);
	border-radius:50%;
	background:var(--card);
	background-image:none;
	box-shadow:0 1px 4px rgba(0, 0, 0, 0.28);
	color:var(--tx2);
	font-size:0;
	line-height:0;
	text-shadow:none;
}
html[data-style="modern"] #birdseye {top:10px;}
html[data-style="modern"] #traffic {top:58px;}
html[data-style="modern"] #birdseye::before,
html[data-style="modern"] #traffic::before {
	content:"";
	position:absolute;
	top:0; right:0; bottom:0; left:0;
	margin:auto;
	width:22px;
	height:22px;
	background-color:currentColor;
	-webkit-mask-repeat:no-repeat; mask-repeat:no-repeat;
	-webkit-mask-position:center; mask-position:center;
	-webkit-mask-size:contain; mask-size:contain;
}
html[data-style="modern"] #birdseye::before {-webkit-mask-image:url("../images/modern/layers.svg"); mask-image:url("../images/modern/layers.svg");}
html[data-style="modern"] #traffic::before {-webkit-mask-image:url("../images/modern/traffic.svg"); mask-image:url("../images/modern/traffic.svg");}
html[data-style="modern"] #birdseye.on,
html[data-style="modern"] #traffic.on {background:var(--ac);border-color:var(--ac);color:var(--aco);}

/* Mapbox / MapLibre zoom controls */
html[data-style="modern"] .maplibregl-ctrl-group,
html[data-style="modern"] .mapboxgl-ctrl-group {
	background:var(--card);
	border:0.5px solid var(--bd);
	border-radius:14px;
	box-shadow:0 1px 4px rgba(0, 0, 0, 0.28);
	overflow:hidden;
}
html[data-style="modern"] .maplibregl-ctrl-group button,
html[data-style="modern"] .mapboxgl-ctrl-group button {width:38px;height:38px;}
html[data-style="modern"] .maplibregl-ctrl-group button + button,
html[data-style="modern"] .mapboxgl-ctrl-group button + button {border-top:0.5px solid var(--bd);}
@media (prefers-color-scheme: dark) {
	html[data-style="modern"] .maplibregl-ctrl-icon,
	html[data-style="modern"] .mapboxgl-ctrl-icon {filter:invert(0.9);}
}

/* the popup that opens when a marker is tapped (Mapbox / MapLibre): a card that grows to fit its text */
html[data-style="modern"] .maplibregl-popup-content,
html[data-style="modern"] .mapboxgl-popup-content {
	background-color:var(--card);
	color:var(--tx);
	border:0.5px solid var(--bd);
	border-radius:14px !important;
	box-shadow:0 4px 14px rgba(0, 0, 0, 0.3);
	min-height:0 !important;
	max-height:none !important;
	padding:12px 14px !important;
	width:auto;
}
html[data-style="modern"] .oinfotitle {font-size:14px;font-weight:600;}
html[data-style="modern"] .oinfotext {font-size:12.5px;line-height:1.4;padding:4px 0 0 0;color:var(--tx2);}
