.container.narrow {
	max-width: 720px;
	margin: 0 auto;
	padding: 20px;
}

/* --- Tighten heading-to-form spacing specifically for this page --- */
.container.narrow h2 {
	margin-top: 0.5rem !important;
	margin-bottom: 0.75rem !important;
	text-align: center;
	font-size: 1.9rem;
	line-height: 1.2;
}

.xlink {
	margin: -1rem 0;
	text-align: center;
}

h3.xlink a {
	color: #6e31df;
}

.container.narrow form {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

.form-row {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	margin-bottom: 1rem;
}

.form-row label {
	display: block;
	margin-bottom: 0.4rem;
	font-weight: 600;
}

.form-row .input,
.form-row input,
.form-row select,
.form-row textarea {
	width: 100%;
}

/* Helper text (muted) sits right below input */
.form-row small.muted {
	order: 2; /* comes before error */
	color: #aaa;
	font-size: 0.85rem;
	margin-top: 0.35rem;
	line-height: 1.4;
}

/* Red error text appears below helper */
.form-row .error {
	order: 3; /* comes after helper */
	color: #ff6b6b;
	font-size: 0.9rem;
	margin-top: 0.35rem;
	line-height: 1.3;
}

/* Ensure consistent bottom spacing */
.form-row.has-error {
	margin-bottom: 1.2rem;
}

.input.w-input,
select.w-input,
textarea.w-input {
	width: 100% !important;
	box-sizing: border-box;
}

.req {
	color: #c00;
}

.error {
	color: #c00;
	font-size: 0.9rem;
	margin-top: 0.25rem;
}

.muted {
	color: #ccc;
	display: block;
	margin-top: 0.3rem;
	font-size: 0.9rem;
	line-height: 1.4;
}

/* === Results Page Layout Fix === */
.header {
	text-align: center !important;
	margin-bottom: 1rem;
}

.filter-buttons {
	display: flex !important;
	flex-wrap: wrap;
	justify-content: center !important;
	align-items: center !important;
	gap: 0.5rem;
}

/* === Filter Buttons (DAC / Speed Filters) === */
.filter-btn {
	background-color: #1a1a1c;
	border: 2px solid #6E31DF;
	color: #eaeaea;
	border-radius: 8px;
	padding: 6px 14px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
}

.filter-btn:hover {
	background-color: #6E31DF;
	color: #fff;
}

.filter-btn.active {
	background-color: #6E31DF;
	color: #fff;
	border-color: #6E31DF;
}

/* === Alternating Row Colors for Results Table === */
#entries-table tbody tr:nth-child(even) {
	background-color: #1a1a1c;
}

#entries-table tbody tr:nth-child(odd) {
	background-color: #111112;
}

#entries-table tbody tr:hover {
	background-color: #242428;
}

#entries-table td,
#entries-table th {
	color: #eaeaea;
	text-align: center;
	vertical-align: middle;
}

#entries-table th {
	font-weight: 600;
	text-transform: capitalize;
}

/* === Force Center Alignment for All Results Table Content === */
#entries-table,
#entries-table thead,
#entries-table tbody,
#entries-table th,
#entries-table td,
#entries-table tr {
	text-align: center !important;
	vertical-align: middle !important;
}

#entries-table td {
	justify-content: center !important;
	align-items: center !important;
}

/* === Capability Badges (Speed & DAC) === */
.cap-badge {
	display: inline-block;
	font-size: 0.8rem;
	font-weight: 600;
	padding: 3px 8px;
	border-radius: 10px;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	color: #fff;
	margin: 2px 3px;
	width: auto;
	min-width: 0;
	box-sizing: border-box;
}

.cap-badge.badge-speed[data-speed="1"]   { background-color: #007bff; }  /* bright blue */
.cap-badge.badge-speed[data-speed="2.5"] { background-color: #31b2df; }  /* light blue */
.cap-badge.badge-speed[data-speed="5"]   { background-color: #3ddc84; }  /* green */
.cap-badge.badge-speed[data-speed="10"]  { background-color: #ffffff; color: #000; } /* white/black */
.cap-badge.badge-dac                     { background-color: #970000; }  /* deep red */

/* === Restore Vote Button Styling for Public Results === */
#entries-table .score-btn {
	display: inline-block;
	margin: 0 6px;
	text-decoration: none;
	font-weight: 700;
	font-size: 1.1rem;
	color: #eaeaea;
	border: 1px solid #6E31DF;
	border-radius: 4px;
	width: 26px;
	height: 26px;
	line-height: 24px;
	text-align: center;
	transition: all 0.2s ease;
}

#entries-table .score-btn.plus {
	background-color: #6E31DF;
	float: right;
}

#entries-table .score-btn.minus {
	background-color: #333;
	float: left;
}

#entries-table .score-btn:hover {
	transform: scale(1.05);
	color: #fff;
}

#entries-table .score-value {
	font-weight: 600;
	font-size: 1.1rem;
	color: #fff;
}

/* --- Segmented Toggle (Refined Alta Labs Style) --- */
.segmented-toggle {
	display: flex;
	justify-content: space-between;
	align-items: stretch;
	border: 1px solid #999;
	border-radius: 10px;
	overflow: hidden;
	width: 100%;
	margin-top: 0.75rem;
	height: 56px;
	background-color: #000;
	box-sizing: border-box;
}

.segmented-toggle input[type="radio"] {
	display: none;
}

.segmented-toggle label {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	font-weight: 500;
	color: #fff;
	background-color: #000;
	transition: all 0.25s ease;
	border-right: 1px solid #999;
	line-height: 1;
	padding: 0;
	margin: 0;
	box-sizing: border-box;
	height: 100%;
	user-select: none;
}

.segmented-toggle label:first-of-type {
	border-top-left-radius: 10px;
	border-bottom-left-radius: 10px;
}

.segmented-toggle label:last-of-type {
	border-top-right-radius: 10px;
	border-bottom-right-radius: 10px;
	border-right: none;
}

.segmented-toggle input[type="radio"]:checked + label {
	background-color: #6e31df;
	color: #fff;
	font-weight: 600;
	box-shadow: inset 0 0 0 1px #5b29b8;
}

/* Preserve rounded corners on selection */
.segmented-toggle input[type="radio"]:checked + label:first-of-type {
	border-top-left-radius: 10px;
	border-bottom-left-radius: 10px;
}

.segmented-toggle input[type="radio"]:checked + label:last-of-type {
	border-top-right-radius: 10px;
	border-bottom-right-radius: 10px;
}

.segmented-toggle label:hover {
	background-color: #1a1a1a;
}

/* --- Submit Button --- */
.submit-row {
	display: flex !important;
	justify-content: center !important;
	align-items: center !important;
	text-align: center !important;
	margin-top: 2rem;
}

#submitBtn.button.w-button {
	background-color: #6e31df;
	color: #fff;
	font-weight: 600;
	padding: 12px 28px;
	border: none;
	border-radius: 6px;
	transition: background-color 0.2s, transform 0.1s;
}

#submitBtn.button.w-button:hover:not([disabled]) {
	background-color: #5b29b8;
	transform: translateY(-1px);
}

#submitBtn[disabled] {
	opacity: 0.5;
	cursor: not-allowed;
}

/* --- Dropdown (Select) Styling --- */
select.w-input {
	width: 100%;
	box-sizing: border-box;
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	background-color: #fff;
	border: 1px solid #ccc;
	border-radius: 10px;
	padding: 10px 12px;
	font-size: 1rem;
	font-family: inherit;
	color: #333;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

select.w-input:focus {
	outline: none;
	border-color: #6e31df;
	box-shadow: 0 0 0 2px rgba(110, 49, 223, 0.25);
}

select.w-input:hover {
	border-color: #999;
}

/* Add a subtle dropdown arrow */
select.w-input {
	background-image: url("data:image/svg+xml;utf8,<svg fill='%236E31DF' height='20' viewBox='0 0 24 24' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 16px 16px;
	padding-right: 36px;
}

.container {
	grid-row-gap: 2rem !important;
}

/* --- Smaller two-option segmented toggle --- */
#link-type-row .segmented-toggle {
	display: flex;
	justify-content: space-between;
	align-items: stretch;
	border: 1px solid #999;
	border-radius: 10px;
	overflow: hidden;
	width: 100%;
	height: 48px;
	background-color: #000;
	margin-top: 0.5rem;
}

#link-type-row .segmented-toggle input[type="radio"] {
	display: none;
}

#link-type-row .segmented-toggle label {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	background-color: #000;
	border-right: 1px solid #999;
	user-select: none;
	transition: all 0.25s ease;
}

#link-type-row .segmented-toggle label:last-of-type {
	border-right: none;
}

#link-type-row .segmented-toggle input[type="radio"]:checked + label {
	background-color: #6e31df;
	color: #fff;
	font-weight: 600;
	box-shadow: inset 0 0 0 1px #5b29b8;
}

/* --- "How it Works" Link --- */
.info-link {
	color: #6e31df;
	text-decoration: underline;
	font-weight: 500;
	cursor: pointer;
	transition: color 0.2s ease;
}

.info-link:hover {
	color: #5b29b8;
}

/* --- Modal Styling --- */
.modal-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.65);
	backdrop-filter: blur(2px);
	z-index: 1000;
	justify-content: center;
	align-items: center;
	padding: 1rem;
}

.modal-content {
	background: #fff;
	border-radius: 10px;
	max-width: 520px;
	padding: 1.75rem;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
	color: #333;
	position: relative;
	text-align: left;
	line-height: 1.5;
}

.modal-content h3 {
	margin-top: 0;
	color: #6e31df;
	font-size: 1.4rem;
}

.modal-content p {
	margin-bottom: 1rem;
}

.modal-close {
	position: absolute;
	top: 0.5rem;
	right: 0.75rem;
	background: none;
	border: none;
	font-size: 1.75rem;
	color: #666;
	cursor: pointer;
	line-height: 1;
}

.modal-close:hover {
	color: #000;
}

/* --- Modal visible state --- */
.modal-overlay.active {
	display: flex;
	animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: scale(0.98);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

/* --- Smooth fade & downward slide for conditional fields --- */
.fade-toggle {
	opacity: 0;
	max-height: 0;
	overflow: hidden;
	transform: translateY(-8px);
	transition:
		opacity 0.35s ease,
		transform 0.35s ease,
		max-height 0.4s ease;
	will-change: opacity, transform, max-height;
}

.fade-toggle.visible {
	opacity: 1;
	max-height: 320px;
	transform: translateY(0);
}

/* --- Baseline vertical rhythm for form rows --- */
.form-row {
	margin-bottom: 1.25rem;
}

/* --- Tighten relationship between inputs and muted helper text --- */
.form-row small.muted {
	margin-top: -1.35rem !important;
	margin-bottom: 0.25rem;
	display: block;
	line-height: 1.4;
	color: #bbb;
}

/* === Awesomplete Dropdown Alignment & Caret Fix === */
.awesomplete {
	position: relative;
	width: 100% !important;
	display: block !important;
}

.awesomplete > ul {
	position: relative;
	overflow: visible !important;
	margin-top: 0.25em !important;
	top: 100% !important;
	border-radius: 0 0 0.5em 0.5em;
	background-color: #111;
	border: 1px solid #333;
	box-shadow: 0 4px 8px rgba(0,0,0,0.4);
	z-index: 9999;
}

.awesomplete > input {
	width: 100% !important;
	box-sizing: border-box;
}

/* --- Dropdown visual theme --- */
.awesomplete > ul {
	background: rgba(0, 0, 0, 0.9) !important;
	color: #fff !important;
	border: 1px solid #333;
	border-radius: 0.5rem;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
	margin-top: 0.25rem;
}

.awesomplete > ul > li {
	padding: 0.5rem 0.75rem;
	cursor: pointer;
	transition: background 0.15s ease;
	font-size: 1.2rem;
	margin: 0.25rem 0;
}

.awesomplete > .visually-hidden {
	display: none;
}

.awesomplete > ul > li[aria-selected="true"],
.awesomplete > ul > li:hover {
	background: #6E31DF !important;
	color: #fff !important;
	border-radius: 6px;
}

.awesomplete mark {
	background: none !important;
	color: #A88BFF;
	font-weight: 1000;
	text-decoration: none;
}

.awesomplete > ul > li[aria-selected="true"] mark {
	color: #fff;
}

/* === 💜 Reliable Awesomplete caret pinned to dropdown <ul> === */
ul[id^="awesomplete_list_"] {
	position: absolute !important;
	margin-top: 0.5rem !important;
	overflow: visible !important;
	z-index: 99999 !important;
}

/* add caret directly on dropdown itself */
ul[id^="awesomplete_list_"]::before {
	content: "";
	position: absolute;
	top: -8px; /* just above dropdown border */
	left: 1.25rem; /* aligns roughly with input padding */
	width: 0;
	height: 0;
	border-left: 8px solid transparent;
	border-right: 8px solid transparent;
	border-bottom: 8px solid #6E31DF; /* downward-pointing triangle */
	z-index: 100000;
	pointer-events: none;
}

/* optional: keep dropdown visually clear */
ul[id^="awesomplete_list_"] {
	background: rgba(0, 0, 0, 0.9) !important;
	border: 1px solid #333 !important;
	border-radius: 0.5rem !important;
	box-shadow: 0 2px 8px rgba(0,0,0,0.3);
	color: #fff;
	min-width: 400px !important;   /* fixed minimum width */
	width: 400px !important;       /* force it to 400px wide */
	left: 0 !important;            /* align left edge with input */
	box-sizing: border-box;
}

/* 🧹 Remove default bullet dots from Awesomplete dropdown */
ul[id^="awesomplete_list_"],
ul[id^="awesomplete_list_"] > li {
	list-style: none !important;
	padding-left: 0 !important;
	margin-left: 0 !important;
}

/* ✨ Normalize Awesomplete <li> spacing for clean vertical rhythm */
ul[id^="awesomplete_list_"] > li {
	list-style: none !important;
	margin: 0 !important;           /* remove browser default gaps */
	padding: 0.5rem 0.75rem !important;  /* consistent top/bottom, side padding */
	line-height: 1.4 !important;     /* smooth readable spacing */
	cursor: pointer;
	transition: background 0.15s ease;
}

/* Optional: tweak highlight radius and hover feel */
ul[id^="awesomplete_list_"] > li[aria-selected="true"],
ul[id^="awesomplete_list_"] > li:hover {
	background: #6E31DF !important;
	color: #fff !important;
	border-radius: 6px;
}

/* === DataTables Pagination (Dark Mode Fix) === */
div.dt-container .dt-paging .dt-paging-button {
	color: rgba(255, 255, 255, 0.9);
	background: transparent;
	border: none;
	font-weight: 500;
	transition: color 0.2s ease, background-color 0.2s ease;
}

div.dt-container .dt-paging .dt-paging-button:hover {
	color: #6E31DF;
	background-color: rgba(255, 255, 255, 0.1);
	border-radius: 4px;
}

div.dt-container .dt-paging .dt-paging-button.current {
	color: #fff;
	background-color: #6E31DF;
	border-radius: 4px;
}

div.dt-container .dt-paging .dt-paging-button.disabled,
div.dt-container .dt-paging .dt-paging-button.disabled:hover,
div.dt-container .dt-paging .dt-paging-button.disabled:active {
	color: rgba(255, 255, 255, 0.5) !important;
	background: transparent !important;
	cursor: default !important;
	opacity: 0.6 !important;
}

/* === DataTables Length Dropdown (Dark Mode) === */
div.dataTables_length select.dt-input,
div.dataTables_length select.form-select,
select[name$="_length"].dt-input {
	background-color: #222 !important;
	color: #fff !important;
	border: 1px solid #444 !important;
	border-radius: 6px !important;
	padding: 4px 8px !important;
}

div.dataTables_length select.dt-input:focus,
div.dataTables_length select.form-select:focus {
	background-color: #2c2c2c !important;
	border-color: #6E31DF !important;
	outline: none !important;
}

div.dataTables_length select.dt-input option,
div.dataTables_length select.form-select option {
	background-color: #222 !important;
	color: #fff !important;
}

/* === Supported Devices (scoped fixes) === */
#supported-devices-row small.muted {
	margin-top: 0.35rem !important;   /* override global -1.35rem */
	margin-bottom: 0.75rem;            /* add breathing room before grid */
	color: #aaa;
	display: block;
	line-height: 1.4;
}

/* 2) Left-aligned 2×2 grid, with the 5th centered beneath */
#supported-devices-row .devices-grid {
	display: grid;
	grid-template-columns: auto auto;  /* two columns */
	column-gap: 2rem;
	row-gap: 0.75rem;
	justify-content: start;            /* align the grid to the left */
	align-items: center;
	max-width: 420px;                  /* keeps rows tight on large screens */
	margin-left: auto;                 /* align the grid to the right */
	margin-right: auto;
}

/* Center the last checkbox beneath both columns */
#supported-devices-row .devices-grid .span-two {
	grid-column: 1 / -1;              /* span both columns */
	justify-self: center;             /* centered under the two columns */
}

/* Checkbox row label styling */
#supported-devices-row .devices-grid label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-family: Satoshi variable, sans-serif;
	font-size: 1rem;
	line-height: 1.25rem;
	font-weight: 500;
	color: #eaeaea;
	cursor: default;                   /* not a pointer */
	white-space: nowrap;
}

/* Checkbox size + brand accent */
#supported-devices-row .devices-grid input[type="checkbox"] {
	accent-color: #6E31DF;
	width: 18px;
	height: 18px;
	margin: 0;
}

#supported-devices-row > label {
	/* rely on your existing `.form-row label` defaults,
	   but add high-specificity color to match exactly */
	color: var(--text_primary, #fff);
}

/* Mobile: stack nicely */
@media (max-width: 600px) {
	#supported-devices-row .devices-grid {
		grid-template-columns: 1fr;   /* one column on small screens */
		max-width: 100%;
	}
	#supported-devices-row .devices-grid .span-two {
		justify-self: start;          /* align left on mobile */
	}
}

/* === Supported Devices — Scaled-up visuals for better balance === */
#supported-devices-row .devices-grid label {
	font-size: 1.2rem;         /* up from 1rem */
	line-height: 1.4rem;       /* keep a bit more breathing room */
	font-weight: 600;          /* slightly bolder to match the larger scale */
	gap: 0.6rem;               /* space between checkbox and text */
}

#supported-devices-row .devices-grid input[type="checkbox"] {
	width: 22px;               /* up from 18px */
	height: 22px;
	accent-color: #6E31DF;
	transform: translateY(-1px); /* keep it visually centered with the text */
}

/* Keep good spacing for the overall grid */
#supported-devices-row .devices-grid {
	row-gap: 1rem;             /* a little more room between rows */
	column-gap: 2.5rem;
}

/* === Flash message for SFP/DAC report success === */
.flash.report-success {
  background: linear-gradient(90deg, #6E31DF 0%, #683eff 100%);
  color: #fff;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 4px 15px rgba(136, 62, 255, 0.6);
  margin: 1rem auto;
  max-width: 700px;
  animation: slideUpFade 0.5s ease-out;
}

/* Subtle animation (optional) */
@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
