/* ============================================================
   inputBox widget kit — redesigned to match ADE Solutions aesthetic
   Class names preserved so inputBox.js doesn't need changes.
   BUILD MARKER: v9 (plain block layout, no flex)
   ============================================================ */

/* Main box container ----------------------------------------- */
.box {
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	max-width: 640px;
	width: calc(100% - 48px);
	background: var(--bg-elev);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-md);
	font-family: var(--sans);
	font-size: 15px;
	color: var(--ink);
	overflow: hidden;
}
.box[mobile='0'] {
	top: 96px;
}
.box[mobile='1'] {
	top: 64px;
	bottom: 0;
	left: 0;
	right: 0;
	max-width: none;
	width: auto;
	transform: none;
	border-radius: 0;
	border-left: none;
	border-right: none;
	box-shadow: none;
}

/* Modal alerts / confirmations: anchored to the viewport center so
   they're always front-and-center regardless of scroll position. */
.box.mod {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	max-height: 80vh;
}
.box.mod[mobile='1'] {
	top: 64px;
	left: 0;
	transform: none;
	max-height: none;
}

/* Caption (title bar) ---------------------------------------- */
.box .cpn {
	padding: 18px 24px 14px;
	border-bottom: 1px solid var(--line-soft);
	font-family: var(--serif);
	font-size: 18px;
	font-weight: 500;
	letter-spacing: normal;
	text-transform: none;
	color: var(--ink);
	background: transparent;
	text-align: left;
	text-shadow: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.box .cpn::first-letter {
	text-transform: uppercase;
}

/* Instruction / callout block -------------------------------- */
.box .ins div {
	padding: 14px 18px;
	background: var(--bg-warm);
	border: none;
	border-left: 3px solid var(--sage);
	border-radius: 0;
	color: var(--ink);
	line-height: 1.55;
	font-size: 14px;
	text-align: left;
	text-shadow: none;
}
.box .ins[type='box']:not(:empty) {
	padding: 16px 24px 0;
}
.box .ins[type='tbl'] div {
	max-width: 560px;
	margin: auto;
}

/* Content area (natural height, grows with content) ---------- */
.box .con {
	position: relative;
	padding: 16px 24px;
	font-size: 15px;
}

/* Empty state ------------------------------------------------ */
.box .noc {
	line-height: 64px;
	text-align: center;
	color: var(--ink-muted);
}
.box .noc:not(:only-child) {
	display: none;
}

/* Button bar ------------------------------------------------- */
.box .btn {
	padding: 12px 20px 16px;
	background: transparent;
	border-top: 1px solid var(--line-soft);
	border-radius: 0;
	text-align: right;
	white-space: nowrap;
}
.box .btn div {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 96px;
	margin: 0 0 0 10px;
	padding: 10px 20px;
	font-family: var(--sans);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.2;
	color: var(--ink);
	background: var(--bg-elev);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	cursor: pointer;
	text-transform: none;
	text-shadow: none;
	transition: all 0.2s var(--ease);
	white-space: nowrap;
}
.box .btn div:hover {
	background: var(--bg-warm);
	border-color: var(--sage);
	color: var(--ink);
	text-decoration: none;
	text-shadow: none;
	box-shadow: none;
}
/* Primary action (first child in the button bar) */
.box .btn div:first-child {
	color: #fff;
	background: var(--orange);
	border-color: var(--orange);
}
.box .btn div:first-child:hover {
	background: var(--orange-deep);
	border-color: var(--orange-deep);
	color: #fff;
}

/* Input table ------------------------------------------------ */
.box .inp {
	border-collapse: collapse;
	width: 100%;
}
.box .inp tr:not([format='static']) td:first-child:hover {
	text-decoration: none;
	cursor: default;
}
.box .inp tr:nth-of-type(1n+2) td {
	border-top: 1px solid var(--line-soft);
}
.box .inp td {
	padding: 12px 6px;
	vertical-align: middle;
	white-space: nowrap;
	font-size: 15px;
}
.box .inp td:first-child {
	width: 14em;
	text-align: right;
	padding-right: 1.5em;
	overflow: hidden;
	color: var(--ink-soft);
	font-weight: 500;
}
.box .inp td:first-child::first-letter {
	text-transform: uppercase;
}
.box .inp td:last-child {
	text-align: left;
	color: var(--ink);
}
.box .inp textarea,
.box .inp input {
	background: transparent;
	font-family: inherit;
	font-size: inherit;
	color: inherit;
}
.box .inp textarea {
	padding: 0;
}

/* Required / missing field indicators */
.box .inp .inv:after {
	content: " *";
	color: var(--orange-deep);
	font-weight: 600;
}
.box .inp .missing {
	background: rgba(216, 120, 42, 0.12);
	border-radius: var(--radius);
	box-shadow: inset 2px 0 0 var(--orange);
}

/* Inline links inside inputs */
.box .inp .link {
	color: var(--sage-deep);
	cursor: pointer;
	text-decoration: none;
}
.box .inp .link:hover {
	text-decoration: underline;
}

/* Full-panel table view (admin lists, etc.) ------------------ */
.box .tbl {
	display: inline-block;
	position: absolute;
	top: 8px;
	left: 8px;
	right: 8px;
	bottom: 8px;
	border-collapse: collapse;
}
.box .tbl thead {
	display: inline-block;
	width: 100%;
	background: var(--bg-warm);
	color: var(--ink-soft);
	border-radius: var(--radius);
	line-height: 28px;
	text-transform: none;
	font-size: 13px;
	font-weight: 500;
	white-space: nowrap;
	border: 1px solid var(--line-soft);
}
.box .tbl th {
	font-weight: 500;
	cursor: pointer;
}
.box .tbl th:hover {
	color: var(--ink);
}
.box .tbl th.asc:after { content: "\0020\25BC"; }
.box .tbl th.dsc:after { content: "\0020\25B2"; }
.box .tbl tbody {
	position: absolute;
	top: 36px;
	left: 0;
	right: 0;
	bottom: 0;
	overflow: auto;
}
.box .tbl tbody tr:nth-of-type(even) {
	background: var(--bg-warm);
}
.box .tbl tbody tr:nth-of-type(1n+2) {
	border-top: 1px solid var(--line-soft);
}
.box .tbl td {
	vertical-align: top;
}
.box .tbl tr {
	display: inline-block;
	width: 100%;
}
.box .tbl tr[clickable]:hover {
	outline: 2px solid var(--orange);
	outline-offset: -2px;
	cursor: pointer;
}
.box .tbl tr[clicked] {
	outline: 2px dotted var(--orange);
	outline-offset: -2px;
}
.box .tbl th,
.box .tbl td {
	padding: 8px 12px;
	text-align: left;
}
.box .tbl th:not(:last-child) {
	width: 128px;
}
.box .tbl td:not(:last-child) {
	width: 128px;
	overflow: hidden;
}
.box .tbl td:last-child {
	word-break: break-word;
}

/* Modal backdrop --------------------------------------------- */
.veil {
	position: fixed;
	top: 0;
	bottom: 0;
	left: 0;
	right: 0;
	background: rgba(27, 31, 29, 0.42);
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
}

/* Context menu ----------------------------------------------- */
.ctx {
	position: fixed;
	padding: 4px 0;
	font-family: var(--sans);
	font-size: 14px;
	color: var(--ink);
	background: var(--bg-elev);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow-md);
	z-index: 999;
	min-width: 180px;
}
.ctx div {
	padding: 8px 16px;
	cursor: pointer;
	transition: background 0.15s var(--ease);
}
.ctx div:hover {
	background: var(--bg-warm);
	color: var(--ink);
	text-shadow: none;
}

/* ============================================================
   Mobile form overrides (2026-04-22)
   Fires only when server detected mobile UA (mobile='1').
   Parent container (#clt/#lgi/#pmt) sets full viewport width
   via a media query in the page; this file handles form-row
   layout only.
   ============================================================ */

/* Tighter content padding on mobile */
.box[mobile='1'] .con {
	padding: 12px 14px;
}
.box[mobile='1'] .ins[type='box']:not(:empty) {
	padding: 12px 14px 0;
}

/* Button bar: flex layout so buttons share available width equally
   and never overflow the viewport. */
.box[mobile='1'] .btn {
	display: flex;
	gap: 8px;
	padding: 10px 14px 14px;
	white-space: normal;
}
.box[mobile='1'] .btn div {
	flex: 1 1 0;
	min-width: 0;
	margin: 0;
	padding: 12px 6px;
	font-size: 14px;
}

/* Form row layout: let cells wrap, shrink the caption column,
   and make inputs fit + be visible */
.box[mobile='1'] .inp td {
	white-space: normal;
	padding: 10px 4px;
}
.box[mobile='1'] .inp td:first-child {
	width: 9em;
	padding-right: 0.75em;
	font-size: 14px;
}
.box[mobile='1'] .inp td:last-child > * {
	max-width: 100%;
	box-sizing: border-box;
}

/* Text inputs / selects / textareas: visible border + white fill so
   they don't disappear against the pale form background on mobile */
.box[mobile='1'] .inp td:last-child input[type='text'],
.box[mobile='1'] .inp td:last-child input[type='email'],
.box[mobile='1'] .inp td:last-child input[type='password'],
.box[mobile='1'] .inp td:last-child input[type='tel'],
.box[mobile='1'] .inp td:last-child input[type='number'],
.box[mobile='1'] .inp td:last-child input:not([type]),
.box[mobile='1'] .inp td:last-child select,
.box[mobile='1'] .inp td:last-child textarea {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	padding: 8px 10px;
	background: var(--bg);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	font-size: 16px; /* 16px prevents iOS zoom-on-focus */
}
