/*
 * buttons-uniform.css — one button height across the portal (11-23-2026).
 *
 * Purpose: on touch screens (phones, tablets) every portal button is 36 px tall
 * with 8 px between neighbours, whatever size class it carries.
 * On a desktop browser this file changes nothing: every button keeps the size it
 * was built with (btn-xs, btn-sm, default, btn-lg, and the two 38 px locks).
 * Robert, 11-24: the one desktop height (22 px on 11-23, then 34 / 38 px tried on
 * 11-24) undid the sizes he had set button by button; desktop goes back to them.
 * Sections 1 and 2 are therefore inside the touch media query: on a touch screen
 * they still give exactly the 11-23 result. Record of the tried sizes:
 * InspectCMSVault/docs/button-sizes/buttons-before-11-24-2026.md
 *
 * Loaded after bootstrap.css, theme.css, the skins and theme-custom.css.
 * To undo: remove the <link> to this file (layouts/main.php and the four auth views).
 * What every button was before: InspectCMSVault/docs/button-sizes/buttons-before-11-23-2026.md
 *
 * !important is used in three places only, each answering an existing rule or
 * inline style that cannot be beaten otherwise: label.btn (layouts/main.php forces
 * `label { font-size:14px !important }`), and the touch padding of the three
 * script-built "Duplicate" buttons that carry inline padding.
 */


@media (pointer: coarse) {
	/* ==========================================================================
	   1. BASE RULE (touch screens only since 11-24; section 3 then sets the touch size)
	   ========================================================================== */

	/* Every button takes Bootstrap's btn-xs metrics: 1 + 18 + 1 + 2 px border = 22 px. Same result for <a>, <button> and <input>. */
	.btn,
	.btn-sm,
	.btn-lg,
	.btn-group-sm > .btn,
	.btn-group-lg > .btn {
		padding: 1px 5px;
		font-size: 12px;
		line-height: 1.5;
		border-radius: 3px;
	}

	/* A <label class="btn"> is forced to 14 px by the site-wide label rule in layouts/main.php; bring it back to 12 px. */
	label.btn {
		font-size: 12px !important;
	}

	/* The order pop-up sets every link and span in its tabs to 14 px (dashboard/inspections.php); buttons there keep the button size. */
	#modalEditOrder .tab-pane a.btn {
		font-size: 12px;
	}
	#modalEditOrder .tab-pane .btn span {
		font-size: inherit;
	}

	/* Two places locked their buttons at 38 px: the payment status pop-up (order_modals/paid_status_modal.php:7-11)
	   and the order form's Review tab (create_form/review_tab.php:227-229). Robert, 11-23: reduce both so the
	   portal is consistent. They follow the standard height; a two-line label still grows its own row.
	   To bring the 38 px back for one of them, delete its selector(s) here. */
	body #modalPaidStatus .btn-group .btn,
	body #modalPaidStatus #assign-users .btn,
	body #modalPaidStatus #zelle-assign-users .btn,
	body #reviewActionButtons .btn {
		height: auto;
	}


	/* ==========================================================================
	   2. EXCLUSIONS (touch screens only since 11-24; buttons that must match a fixed-height neighbour)
	   ========================================================================== */

	/* A button joined to a text box is exactly the height of that box (.form-control is 25 px in this project's bootstrap.css). */
	.input-group-btn > .btn {
		height: 25px;
		padding: 0 12px;
		font-size: 14px;
		line-height: 23px;
		border-radius: 4px;
	}

	/* Small and large input groups (30 px / 46 px) are already fixed by Bootstrap's own, more specific rules; restated so they never depend on rule order. */
	.input-group-sm > .input-group-btn > .btn {
		height: 30px;
		padding: 5px 10px;
		font-size: 12px;
		line-height: 1.5;
		border-radius: 3px;
	}
	.input-group-lg > .input-group-btn > .btn {
		height: 46px;
		padding: 10px 16px;
		font-size: 18px;
		line-height: 1.33;
		border-radius: 6px;
	}

	/* File pickers (Company Settings logo, agency import): the button sits against a 35 px file-name box. Line height (21 px) and corners come from the widget's own CSS. */
	.fileupload .btn {
		padding: 6px 12px;
		font-size: 14px;
	}

	/* Summernote editor toolbar keeps its own small-button size. */
	.note-editor .btn {
		padding: 5px 10px;
		font-size: 12px;
		line-height: 1.5;
		border-radius: 3px;
	}

	/* Other third-party widgets keep Bootstrap's default button. None of them draws a .btn today; this is a guard. */
	.CodeMirror .btn,
	.datepicker .btn,
	.select2-container .btn,
	.select2-drop .btn,
	.bootstrap-timepicker-widget .btn,
	.colorpicker .btn,
	.ui-pnotify .btn {
		padding: 6px 12px;
		font-size: 14px;
		line-height: 1.42857143;
		border-radius: 4px;
	}
}


/* ==========================================================================
   3. TOUCH RULE
   ========================================================================== */

@media (pointer: coarse) {
	/* Every button, whatever its size class: 7 + 20 + 7 + 2 px border = 36 px, and never narrower than 36 px. */
	.btn,
	.btn-xs,
	.btn-sm,
	.btn-lg,
	.btn-group-xs > .btn,
	.btn-group-sm > .btn,
	.btn-group-lg > .btn {
		min-width: 36px;
		min-height: 36px;
		padding: 7px 12px;
		font-size: 14px;
		line-height: 20px;
	}

	/* Same two local overrides as on desktop, at the touch size. */
	label.btn {
		font-size: 14px !important;
	}
	#modalEditOrder .tab-pane a.btn {
		font-size: 14px;
	}

	/* The three script-built "Duplicate" buttons carry inline 1 px padding (js/order_form.js, js/agent_order_form.js, programs/javascripts/populateform.js). */
	.btn[style*="padding-top:1px"] {
		padding-top: 7px !important;
		padding-bottom: 7px !important;
	}

	/* 8 px between neighbouring buttons. */
	.btn + .btn {
		margin-left: 8px;
	}

	/* Two right-floated neighbours sit in reverse order, so the gap goes on the other side. */
	.btn.pull-right + .btn.pull-right {
		margin-left: 0;
		margin-right: 8px;
	}

	/* Full-width buttons stack: no sideways shift, 8 px between rows. */
	.btn + .btn-block,
	.btn-block + .btn {
		margin-left: 0;
	}
	.btn-block + .btn-block {
		margin-top: 8px;
	}


	/* ==========================================================================
	   4. TOUCH EXCLUSIONS
	   ========================================================================== */

	/* Joined groups stay joined: no gap inside a button group or an input group. Justified groups keep equal widths (their buttons are table cells; min-width does not apply). */
	.btn-group > .btn + .btn,
	.btn-group > .btn + .btn-group,
	.btn-group > .btn-group + .btn,
	.btn-group-justified > .btn + .btn,
	.input-group-btn > .btn + .btn {
		margin-left: -1px;
	}
	.btn-group-vertical > .btn + .btn {
		margin-left: 0;
	}

	/* Buttons joined to a text box follow the box, which is 36 px on touch screens (responsive-fixes.css, F4). */
	.input-group-btn > .btn,
	.input-group-sm > .input-group-btn > .btn {
		min-width: 0;
		min-height: 0;
		height: 36px;
		padding: 0 12px;
		font-size: 14px;
		line-height: 34px;
	}

	/* File picker buttons stay against their 35 px file-name box, with the widget's own overlap. */
	.fileupload .btn {
		min-width: 0;
		min-height: 0;
	}
	.fileupload .btn + .btn {
		margin-left: -5px;
	}

	/* Editor and picker widgets keep their own button sizes (sizes come from section 2). */
	.note-editor .btn,
	.CodeMirror .btn,
	.datepicker .btn,
	.select2-container .btn,
	.select2-drop .btn,
	.bootstrap-timepicker-widget .btn,
	.colorpicker .btn,
	.ui-pnotify .btn {
		min-width: 0;
		min-height: 0;
	}


	/* ==========================================================================
	   5. TOUCH ICON AND CLOSE RULES
	   ========================================================================== */

	/* Icon links in table rows (dashboard Actions and Paid cells, Staff / Agent / Client / Agency / Services lists, Company Settings tables): a 36 px tap box.
	   The negative top and bottom margins let the box use the cell's own padding, so a row grows by about 3 px instead of 15 px. */
	.table td.actions > a:not(.btn),
	.table td.actions1 > a:not(.btn),
	.table td > a.modal-with-form:not(.btn),
	.table td > a.delete-row:not(.btn),
	.table td > a.activate-staff:not(.btn),
	.table td > a.rf-create-report:not(.btn) {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-width: 36px;
		min-height: 36px;
		margin-top: -6px;
		margin-bottom: -6px;
		vertical-align: middle;
	}

	/* The pop-up close "X" (a .btn in the panel header) is already 36 px from section 3. The plain header links (collapse arrow) grow from 24 px to 36 px. */
	.panel-actions a {
		display: inline-block;
		width: 36px;
		height: 36px;
		line-height: 36px;
	}
}

/* Any other icon-only link in a table cell, found by its content. Kept in its own block: a browser without :has() skips only this block. */
@media (pointer: coarse) {
	.table td > a:not(.btn):has(> img:only-child),
	.table td > a:not(.btn):has(> i.fa:only-child) {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-width: 36px;
		min-height: 36px;
		margin-top: -6px;
		margin-bottom: -6px;
		vertical-align: middle;
	}
}

/* A panel header is 27 px tall and its close button is positioned over it; make room for the 36 px button. Own block for the same :has() reason. */
@media (pointer: coarse) {
	.panel-heading:has(.panel-actions) {
		min-height: 40px;
	}
}
