/* Pack-Out Spot field app. Built for a phone held in one hand, in sunlight. */

html,
body.pos-field {
	height: 100%;
	margin: 0;
}

body.pos-field {
	background: #2f3232;
	color: #1f2222;
	font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	-webkit-text-size-adjust: 100%;
	overscroll-behavior: none;
}

#pos-field {
	display: flex;
	flex-direction: column;
	height: 100vh;
	height: 100dvh;
	background: #f4f1ea;
}

.pos-field__boot {
	margin: auto;
	color: #5b6060;
}

#pos-field [hidden] {
	display: none !important;
}

/* Top bar */

.pf-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
	background: #2f3232;
	color: #fff;
}

.pf-top h1 {
	margin: 0;
	font-size: 17px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.pf-top__status {
	display: flex;
	align-items: center;
	gap: 10px;
}

.pf-notices:empty {
	display: none;
}

.pf-notices {
	display: grid;
	gap: 8px;
	padding: 10px 14px;
	background: #fff;
	border-bottom: 1px solid #d9d4c8;
}

.pf-notice {
	display: grid;
	gap: 8px;
	justify-items: start;
}

/* The message takes the full width. Only the button beside it keeps its own. */

.pf-notice > .pf-ui {
	justify-self: stretch;
	min-width: 0;
}

/* Main area */

.pf-main {
	position: relative;
	flex: 1;
	min-height: 0;
}

.pf-map {
	position: absolute;
	inset: 0;
}

.pf-panel {
	position: absolute;
	inset: 0;
	z-index: 3;
	overflow-y: auto;
	padding: 16px 14px 32px;
	background: #f4f1ea;
	-webkit-overflow-scrolling: touch;
}

.pf-panel h2,
.pf-sheet h2 {
	margin: 0 0 8px;
	font-size: 20px;
	line-height: 1.25;
}

/* Keep the map's attribution clear of the report button. */
.pf-map .maplibregl-ctrl-bottom-left,
.pf-map .maplibregl-ctrl-bottom-right {
	bottom: 84px;
}

.pf-fab {
	position: absolute;
	right: 14px;
	bottom: 18px;
	left: 14px;
	z-index: 2;
	min-height: 56px;
	font-size: 18px;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

/* Tabs */

.pf-tabs {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	padding-bottom: env(safe-area-inset-bottom);
	background: #2f3232;
}

.pf-button.pf-button--tab {
	min-height: 54px;
	border: 0;
	border-top: 3px solid transparent;
	border-radius: 0;
	background: transparent;
	color: #c9cdcb;
	padding: 0 2px;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	white-space: nowrap;
}

.pf-button.pf-button--tab[aria-current="page"] {
	border-top-color: #bb5e28;
	color: #fff;
}

/* Buttons and fields. Targets are at least 48px tall. */

.pf-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 0 16px;
	border: 2px solid #2f3232;
	border-radius: 6px;
	background: #fff;
	color: #2f3232;
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.pf-button:focus-visible,
.pf-field input:focus-visible,
.pf-field select:focus-visible,
.pf-field textarea:focus-visible {
	outline: 3px solid #25486b;
	outline-offset: 2px;
}

.pf-button:disabled {
	opacity: 0.55;
	cursor: default;
}

.pf-button--primary {
	border-color: #bb5e28;
	background: #bb5e28;
	color: #fff;
}

.pf-top .pf-button--primary {
	min-height: 40px;
	padding: 0 12px;
	font-size: 14px;
}

.pf-button--plain {
	border-color: transparent;
	background: transparent;
	text-decoration: underline;
}

.pf-button--wide {
	width: 100%;
	margin-top: 16px;
	min-height: 56px;
	font-size: 18px;
}

.pf-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 10px;
}

.pf-field,
.pf-where {
	display: block;
	margin: 0 0 16px;
}

.pf-field__label {
	display: block;
	margin-bottom: 6px;
	font-weight: 700;
}

.pf-resources {
	list-style: none;
	margin: 0 0 8px;
	padding: 0;
}

.pf-resources li {
	padding: 10px 0;
	border-bottom: 1px solid #d9d4c8;
}

.pf-resources li:last-child {
	border-bottom: 0;
}

.pf-resources a {
	display: block;
	font-weight: 600;
	overflow-wrap: anywhere;
}

.pf-resources .pf-muted {
	display: block;
	margin: 2px 0 0;
}

.pf-field__help,
.pf-muted {
	color: #5b6060;
	font-size: 14px;
}

.pf-field__help {
	display: block;
	margin-top: 4px;
}

.pf-field input[type="text"],
.pf-field input[type="number"],
.pf-field select,
.pf-field textarea {
	box-sizing: border-box;
	width: 100%;
	min-height: 48px;
	padding: 10px 12px;
	border: 2px solid #8d8576;
	border-radius: 6px;
	background: #fff;
	color: inherit;
	font: inherit;
}

.pf-field input[type="file"] {
	width: 100%;
	min-height: 48px;
	font: inherit;
}

.pf-where__pin {
	margin: 0;
}

.pf-thumbs {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
	gap: 8px;
	margin: -6px 0 16px;
}

.pf-thumb img {
	display: block;
	width: 100%;
	aspect-ratio: 1;
	border-radius: 6px;
	object-fit: cover;
}

.pf-thumb .pf-button {
	width: 100%;
	min-height: 40px;
	padding: 0;
	font-size: 14px;
}

.pf-guidance:empty,
.pf-problem:empty {
	display: none;
}

.pf-guidance,
.pf-problem {
	margin: 0 0 16px;
}

/* Cards */

.pf-card {
	margin: 0 0 12px;
	padding: 14px;
	border: 1px solid #d9d4c8;
	border-radius: 8px;
	background: #fff;
}

.pf-card__head,
.pf-badges {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 0 0 8px;
}

.pf-card h3 {
	margin: 0 0 4px;
	font-size: 17px;
}

.pf-card p {
	margin: 0 0 8px;
	overflow-wrap: anywhere;
}

/* Sheet */

.pf-sheet {
	position: fixed;
	inset: 0;
	z-index: 10;
	display: flex;
	flex-direction: column;
	background: #f4f1ea;
}

.pf-sheet__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
	border-bottom: 1px solid #d9d4c8;
	background: #fff;
}

.pf-sheet__head h2 {
	margin: 0;
}

.pf-sheet__body {
	flex: 1;
	overflow-y: auto;
	padding: 16px 14px calc(32px + env(safe-area-inset-bottom));
	-webkit-overflow-scrolling: touch;
}

.pf-toast {
	position: fixed;
	right: 14px;
	bottom: calc(76px + env(safe-area-inset-bottom));
	left: 14px;
	z-index: 20;
	padding: 12px 14px;
	border-radius: 6px;
	background: #2f3232;
	color: #fff;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

/* Vectra UI components sit inline; notices take the full width. */

.pf-ui--notice,
.pf-ui--empty-state {
	display: block;
}

/* Until a component mounts, and when Vectra UI is unavailable, the text stands in for it. */

.pf-ui--badge > .vectra-ui__fallback {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 999px;
	background: #e3e0d8;
	color: #2f3232;
	font-size: 13px;
	font-weight: 600;
}

.pf-top .pf-ui--badge > .vectra-ui__fallback {
	background: #4a4f4f;
	color: #fff;
}

.pf-ui--notice > .vectra-ui__fallback,
.pf-ui--empty-state > .vectra-ui__fallback {
	display: block;
	padding: 10px 12px;
	border-left: 4px solid #25486b;
	background: #eef2f6;
}

.pf-ui--warning > .vectra-ui__fallback {
	border-left-color: #bb5e28;
	background: #fbf1e9;
}

.pf-ui--error > .vectra-ui__fallback {
	border-left-color: #a12a1b;
	background: #fbecea;
}

@media (min-width: 720px) {
	.pf-fab {
		right: 18px;
		left: auto;
		min-width: 240px;
	}

	.pf-panel,
	.pf-sheet__body {
		padding-right: max(14px, calc((100% - 680px) / 2));
		padding-left: max(14px, calc((100% - 680px) / 2));
	}
}

@media (prefers-reduced-motion: no-preference) {
	.pf-toast {
		animation: pf-rise 0.2s ease-out;
	}
}

@keyframes pf-rise {
	from {
		transform: translateY(8px);
		opacity: 0;
	}
}

/* Missions */

.pf-block {
	margin: 18px 0 0;
}

.pf-block h3 {
	margin: 0 0 8px;
	font-size: 17px;
}

.pf-card h4 {
	margin: 0 0 6px;
	font-size: 16px;
}

.pf-check {
	display: flex;
	gap: 12px;
	align-items: center;
	min-height: 48px;
	padding: 4px 0;
	border-bottom: 1px solid #e3e0d8;
}

.pf-check input {
	flex: none;
	width: 26px;
	height: 26px;
	margin: 0;
	accent-color: #415840;
}

.pf-check input:checked + span {
	color: #5b6060;
	text-decoration: line-through;
}

.pf-conflict {
	margin: 8px 0;
}

/* Work records */

.pf-pair {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	align-items: end;
}

.pf-pair .pf-field {
	min-width: 0;
}
