/* ==========================================================================
   60 — MODULE SELECTOR  (Lane F, 0814)

   Owns page-selector.php only. Tokens, buttons, .spectable, .divider,
   .eyebrow, .phero and .tablewrap all come from main.css and are not
   redefined here.

   The visual idea: the four conditions are a specification block on drafting
   paper — numbered fields, hairline rules, square corners — and every result
   carries its own evidence line, so the page reads as a filtered index rather
   than a shop.
   ========================================================================== */

/* A block-level `display` in this file outranks the user-agent rule for the
   [hidden] attribute, which the script uses to close the empty regions. State
   it back explicitly, or the side-by-side button survives a zero-result
   filter. */
.selgrid[hidden],
.selcmp[hidden],
.selrelax[hidden],
.selundec[hidden] { display: none; }

/* ---- No-script notice ---------------------------------------------------
   Present by default and removed once selector.js flags the document, so a
   visitor without scripting is told what happened instead of meeting a form
   that does nothing. */
.selnojs {
	border: 1px solid var(--line-2);
	border-left: 3px solid var(--ir);
	background: var(--paper-2);
	padding: 16px 18px;
	font-size: .92rem;
	color: var(--ink-70);
	max-width: 70ch;
}
.selnojs a { color: var(--ir); text-decoration: underline; text-underline-offset: 3px; }
.js-selector .selnojs { display: none; }

/* The form is inert without scripting, so it is not shown until the script
   that drives it is running. */
.selform { display: none; }
.js-selector .selform { display: block; }

/* ---- Condition block ---------------------------------------------------- */
.selform__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
	gap: 1px;
	margin-top: 26px;
	border: 1px solid var(--line);
	background: var(--line);
	box-shadow: var(--sh-1);
}

.selfield {
	display: flex;
	flex-direction: column;
	gap: 9px;
	padding: 20px;
	background: var(--paper);
	min-width: 0;
}
.selfield__l {
	font-family: var(--ff-display);
	font-weight: 700;
	font-size: 1rem;
	line-height: 1.28;
	letter-spacing: -.005em;
	display: flex;
	gap: .6em;
	align-items: baseline;
}
.selfield__n {
	font-size: .68rem;
	letter-spacing: .14em;
	color: var(--ir);
	flex: 0 0 auto;
}
.selfield__c {
	font-family: var(--ff-mono);
	font-size: .84rem;
	color: var(--ink);
	background: #fff;
	border: 1px solid var(--line-2);
	border-radius: var(--radius);
	padding: 10px 12px;
	width: 100%;
	max-width: 100%;
	appearance: none;
	background-image:
		linear-gradient(45deg, transparent 50%, var(--ink-45) 50%),
		linear-gradient(135deg, var(--ink-45) 50%, transparent 50%);
	background-position: right 15px center, right 10px center;
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
	transition: border-color var(--t-fast);
}
.selfield__c:hover { border-color: var(--ink); }
.selfield__h {
	font-size: .78rem;
	line-height: 1.5;
	color: var(--ink-45);
}

.selform__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
	margin-top: 20px;
}
.selfield--inline {
	flex-direction: row;
	align-items: center;
	flex-wrap: wrap;
	padding: 0;
	background: none;
	gap: 12px;
}
.selfield--inline .selfield__l { font-size: .82rem; font-weight: 500; font-family: var(--ff-body); color: var(--ink-70); }
.selfield--inline .selfield__c { width: auto; min-width: 15rem; max-width: 100%; }

/* ---- Result status ------------------------------------------------------ */
.selresults { background: var(--tint); border-block: 1px solid var(--line); }
.selstatus {
	font-size: .82rem;
	letter-spacing: .02em;
	color: var(--ink-70);
	margin-top: 14px;
	padding-left: 13px;
	border-left: 2px solid var(--ir);
}

/* ---- Result cards ------------------------------------------------------- */
/* Hairline separators come from each card's own 1px ring, the way .cards does
   it in main.css — filling the grid gaps with a background colour instead
   would paint every empty cell of the last row as a solid grey block. */
.selgrid {
	list-style: none;
	margin: 26px 0 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
	gap: 1px;
	border: 1px solid var(--line);
	box-shadow: var(--sh-1);
}
.selgrid:empty { display: none; }

.selcard {
	box-shadow: 0 0 0 1px var(--line);
	background: var(--paper);
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 14px;
	min-width: 0;
	transition: background var(--t-fast);
}
.selcard:hover { background: #fff; }
.selcard--gap { background: var(--paper-2); }

.selcard__head { display: flex; flex-direction: column; gap: 4px; }
.selcard__name {
	font-family: var(--ff-display);
	font-weight: 800;
	text-transform: uppercase;
	font-size: 1.12rem;
	letter-spacing: -.01em;
	color: var(--ink);
	overflow-wrap: anywhere;
}
.selcard__name:hover { color: var(--ir); }
.selcard__ser { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-45); }

/* Evidence list — the reason this module is on the list, stated as the
   published figure against the asked-for one. */
.selwhy { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.selwhy__i {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding-left: 15px;
	position: relative;
	min-width: 0;
}
.selwhy__i::before {
	content: "";
	position: absolute;
	left: 0;
	top: .58em;
	width: 8px;
	height: 1px;
	background: var(--ir);
}
.selwhy__i--gap::before { background: var(--steel); }
.selwhy__t {
	font-family: var(--ff-mono);
	font-size: .78rem;
	line-height: 1.45;
	color: var(--ink);
	font-variant-numeric: tabular-nums;
	overflow-wrap: anywhere;
}
.selwhy__i--gap .selwhy__t { color: var(--ink-45); }
.selwhy__sub { font-size: .74rem; line-height: 1.45; color: var(--ink-45); overflow-wrap: anywhere; }

.selfacts {
	margin: 0;
	display: grid;
	grid-template-columns: minmax(0, auto) minmax(0, 1fr);
	gap: 4px 14px;
	font-size: .73rem;
	border-top: 1px solid var(--line);
	padding-top: 12px;
}
.selfacts dt { color: var(--ink-45); letter-spacing: .04em; text-transform: uppercase; }
.selfacts dd { margin: 0; color: var(--ink-70); overflow-wrap: anywhere; }

.selcard__foot {
	margin-top: auto;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	border-top: 1px solid var(--line);
	padding-top: 12px;
}
.selcard__go {
	font-size: .74rem;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--ir);
	border-bottom: 1px solid transparent;
}
.selcard__go:hover { border-bottom-color: var(--ir); }
.selcard__price { font-size: .72rem; color: var(--ink-45); font-variant-numeric: tabular-nums; }

/* ---- Side-by-side hand-off ---------------------------------------------- */
.selcmp {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
	margin-top: 22px;
}
.selcmp__note { font-size: .82rem; color: var(--ink-45); }

/* ---- Which condition is binding ----------------------------------------- */
.selrelax {
	margin-top: 30px;
	border: 1px solid var(--line-2);
	background: var(--paper);
	padding: 20px;
	box-shadow: var(--sh-1);
}
.selrelax__h {
	font-family: var(--ff-display);
	font-size: 1rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: .01em;
}
.selrelax__note { font-size: .82rem; color: var(--ink-45); margin-top: 6px; }
.selrelax__list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.selrelax__btn {
	font-family: var(--ff-mono);
	font-size: .76rem;
	line-height: 1.4;
	text-align: left;
	color: var(--ink);
	background: var(--paper-2);
	border: 1px solid var(--line-2);
	border-radius: var(--radius);
	padding: 9px 13px;
	cursor: pointer;
	transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
	max-width: 100%;
	overflow-wrap: anywhere;
}
.selrelax__btn:hover { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---- Undecidable group -------------------------------------------------- */
.selundec { margin-top: 34px; border-top: 1px solid var(--line-2); padding-top: 24px; }
.selundec__h {
	font-family: var(--ff-display);
	font-size: 1.02rem;
	font-weight: 800;
	text-transform: uppercase;
}
.selundec__note { font-size: .88rem; color: var(--ink-70); margin-top: 8px; max-width: 72ch; }

/* ---- Full parsed table -------------------------------------------------- */
.seltable { min-width: 940px; }
.seltable th[scope="col"] {
	font-family: var(--ff-mono);
	font-size: .72rem;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--ink-45);
	border-bottom: 1px solid var(--line-2);
	padding: 12px 14px;
	vertical-align: bottom;
	width: auto;
}
.seltable th[scope="row"] { width: 13%; padding: 14px; }
.seltable th[scope="row"] a {
	font-family: var(--ff-display);
	font-weight: 700;
	font-size: .9rem;
	text-transform: uppercase;
	color: var(--ink);
}
.seltable th[scope="row"] a:hover { color: var(--ir); }
.seltable td { padding: 14px; font-size: .78rem; line-height: 1.5; vertical-align: top; }
.seltable td.is-gap { color: var(--steel); }
.seltable__claims { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.seltable__claims li { overflow-wrap: anywhere; }
.seltable__field {
	display: block;
	margin-top: 7px;
	font-size: .68rem;
	letter-spacing: .04em;
	color: var(--ink-45);
	text-transform: uppercase;
}

.selnote {
	margin-top: 22px;
	font-size: .88rem;
	line-height: 1.62;
	color: var(--ink-70);
	max-width: 78ch;
	border-left: 2px solid var(--line-2);
	padding-left: 15px;
}

/* ---- Narrow viewports ---------------------------------------------------
   The condition block collapses to one column and the wide source table keeps
   its own horizontal scroll inside .tablewrap, so the page body never scrolls
   sideways at 360px. */
@media (max-width: 760px) {
	.selform__grid { grid-template-columns: minmax(0, 1fr); }
	.selgrid { grid-template-columns: minmax(0, 1fr); }
	.selform__foot { align-items: stretch; }
	.selfield--inline { flex-direction: column; align-items: flex-start; }
	.selfield--inline .selfield__c { width: 100%; min-width: 0; }
	.selcard__foot { align-items: flex-start; flex-direction: column; }
}

/* ---- Reduced motion ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.selcard,
	.selfield__c,
	.selrelax__btn { transition: none; }
}
