/**
 * FixSteel Tools — industrial instrument / calculator UI.
 */

body.fsp-tools {
	--fsp-tools-black: #06080b;
	--fsp-tools-charcoal: #0e1218;
	--fsp-tools-graphite: #161c26;
	--fsp-tools-slate: #2a3340;
	--fsp-tools-steel: #64748b;
	--fsp-tools-silver: #94a3b8;
	--fsp-tools-chrome: #c8d0dc;
	--fsp-tools-frost: #e2e8f0;
	--fsp-tools-blue: #4a6fa5;
	--fsp-tools-blue-dim: #2d4a6f;
	--fsp-tools-blue-glow: rgba(74, 111, 165, 0.35);
	--fsp-tools-text: #e8ecf2;
	--fsp-tools-muted: #94a3b8;
	--fsp-tools-ink: #0f172a;
	margin: 0;
	min-height: 100vh;
	overflow-x: clip;
	max-width: 100%;
	font-family: 'Vazirmatn', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 15px;
	line-height: 1.65;
	color: var(--fsp-tools-text);
	background: transparent;
	direction: rtl;
	-webkit-font-smoothing: antialiased;
}

body.fsp-tools--hub {
	background: transparent;
}

body.fsp-tools a:not(.fsp-brand-gateway__btn):not(.fsp-retail-tab) {
	color: inherit;
}

body.fsp-tools .fsp-brand-gateway__btn,
body.fsp-tools .fsp-brand-gateway__btn:hover {
	color: var(--fsp-brand-blue, #1e40af);
}

/* ─── Hub shell ────────────────────────────────────────────── */
.fsp-thub {
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 100%;
	overflow-x: clip;
	box-sizing: border-box;
	min-height: calc(100vh - var(--fsp-chrome-fixed-top, 64px) - var(--fsp-ticker-bottom-h, 0px));
	background: transparent;
}

/* ─── Console header (instrument face) ─────────────────────── */
.fsp-thub-console {
	position: relative;
	overflow: hidden;
}

.fsp-thub-console__grid {
	position: absolute;
	inset: 0;
	z-index: 1;
	opacity: 0.2;
	background-image:
		linear-gradient(rgba(148, 163, 184, 0.12) 1px, transparent 1px),
		linear-gradient(90deg, rgba(148, 163, 184, 0.12) 1px, transparent 1px);
	background-size: 24px 24px;
	mask-image: linear-gradient(180deg, #000 0%, transparent 92%);
	pointer-events: none;
}

.fsp-thub-console__inner {
	position: relative;
	max-width: 960px;
	margin: 0 auto;
	padding: 0 20px;
	width: 100%;
	text-align: center;
}

.fsp-thub-console__lcd {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	margin-bottom: 20px;
	padding: 12px 22px 14px;
	border-radius: 12px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.fsp-thub-console__lcd-label {
	letter-spacing: 0.14em;
}

.fsp-thub-console__lcd-val {
	letter-spacing: 0.12em;
}

.fsp-thub-console__kicker {
	margin: 0 0 16px;
	text-transform: uppercase;
}

.fsp-thub-console h1 {
	/* sized in module-hero.css */
}

.fsp-thub-lead {
	max-width: 640px;
	margin: 0 auto 28px;
	font-family: 'Vazirmatn', Tahoma, system-ui, sans-serif;
}

.fsp-thub-console__readouts {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 16px;
	margin: 0;
	max-width: 520px;
	margin-inline: auto;
}

.fsp-thub-console__readouts > div {
	min-width: 120px;
}

/* Hub hero glass — two steps more transparent than default module-hero */
body.fsp-tools--hub .fsp-module-hero .fsp-thub-console__readouts > div,
body.fsp-tools--hub .fsp-module-hero .fsp-thub-console__lcd {
	background: rgba(255, 255, 255, 0.06);
	border-color: rgba(255, 255, 255, 0.11);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.05),
		0 8px 24px rgba(0, 0, 0, 0.18);
}

body.fsp-tools--hub .fsp-module-hero .fsp-thub-console__lcd-val {
	font-size: 1.15rem;
	letter-spacing: 0.02em;
}

/* ─── Module bay ─────────────────────────────────────────────── */
.fsp-thub-bay {
	flex: 1;
	background: transparent;
	border-top: 0;
}

.fsp-thub-bay__inner {
	max-width: 920px;
	margin: 0 auto;
	padding: 36px 20px 44px;
}

.fsp-thub-bay__head {
	margin-bottom: 24px;
	text-align: center;
}

.fsp-thub-bay__index {
	display: block;
	margin-bottom: 6px;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: rgba(15, 23, 42, 0.55);
}

.fsp-thub-bay__head h2 {
	margin: 0;
	font-family: 'Vazirmatn', Tahoma, system-ui, sans-serif;
	font-size: 1.05rem;
	font-weight: 800;
	color: var(--fsp-tools-ink);
}

.fsp-thub-instruments {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

/* ─── Instrument module card ─────────────────────────────────── */
.fsp-thub-instrument {
	position: relative;
	display: grid;
	grid-template-columns: auto minmax(140px, 200px) 1fr auto;
	align-items: center;
	gap: 16px 20px;
	padding: 18px 20px;
	border-radius: 12px;
	text-decoration: none;
	color: var(--fsp-tools-text);
	background: linear-gradient(165deg, var(--fsp-tools-graphite) 0%, var(--fsp-tools-charcoal) 100%);
	border: 1px solid rgba(148, 163, 184, 0.18);
	box-shadow:
		0 12px 32px rgba(0, 0, 0, 0.35),
		inset 0 1px 0 rgba(255, 255, 255, 0.06);
	transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
	overflow: hidden;
}

.fsp-thub-instrument__bezel {
	position: absolute;
	inset: 0;
	border-radius: inherit;
	box-shadow: inset 0 0 0 1px rgba(74, 111, 165, 0.12);
	pointer-events: none;
}

.fsp-thub-instrument:hover {
	transform: translateY(-2px);
	border-color: rgba(74, 111, 165, 0.45);
	box-shadow:
		0 18px 44px rgba(0, 0, 0, 0.42),
		0 0 24px var(--fsp-tools-blue-glow),
		inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.fsp-thub-instrument__code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.1em;
	color: var(--fsp-tools-blue);
	writing-mode: vertical-rl;
	transform: rotate(180deg);
	padding: 4px 0;
}

.fsp-thub-instrument__screen {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 12px 14px;
	border-radius: 6px;
	background: linear-gradient(180deg, #080c12 0%, #040608 100%);
	border: 1px solid rgba(74, 111, 165, 0.4);
	box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.8);
	min-height: 88px;
	justify-content: center;
}

.fsp-thub-instrument__screen-label {
	font-size: 8px;
	font-weight: 700;
	letter-spacing: 0.12em;
	color: var(--fsp-tools-blue);
	opacity: 0.85;
}

.fsp-thub-instrument__formula {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	color: var(--fsp-tools-chrome);
	letter-spacing: 0.04em;
}

.fsp-thub-instrument__units {
	font-size: 10px;
	font-weight: 600;
	color: var(--fsp-tools-steel);
	letter-spacing: 0.06em;
}

.fsp-thub-instrument__body {
	min-width: 0;
	font-family: 'Vazirmatn', Tahoma, system-ui, sans-serif;
}

.fsp-thub-instrument__type {
	display: inline-block;
	margin-bottom: 6px;
	padding: 2px 8px;
	border-radius: 4px;
	font-size: 9px;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--fsp-tools-chrome);
	background: rgba(74, 111, 165, 0.2);
	border: 1px solid rgba(74, 111, 165, 0.3);
}

.fsp-thub-instrument__body h3 {
	margin: 0 0 6px;
	font-size: 1.05rem;
	font-weight: 800;
	color: var(--fsp-tools-frost);
	line-height: 1.3;
}

.fsp-thub-instrument__body p {
	margin: 0;
	font-size: 12px;
	line-height: 1.6;
	color: var(--fsp-tools-muted);
}

.fsp-thub-instrument__run {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	border-radius: 6px;
	font-family: 'Vazirmatn', Tahoma, system-ui, sans-serif;
	font-size: 11px;
	font-weight: 800;
	color: var(--fsp-tools-chrome);
	background: linear-gradient(180deg, var(--fsp-tools-slate) 0%, var(--fsp-tools-graphite) 100%);
	border: 1px solid rgba(148, 163, 184, 0.25);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
	flex-shrink: 0;
	transition: background 0.15s ease;
}

.fsp-thub-instrument__run-led {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--fsp-tools-blue);
	box-shadow: 0 0 8px var(--fsp-tools-blue-glow);
}

.fsp-thub-instrument:hover .fsp-thub-instrument__run {
	background: linear-gradient(180deg, var(--fsp-tools-blue-dim) 0%, var(--fsp-tools-graphite) 100%);
	border-color: rgba(74, 111, 165, 0.5);
}

/* Empty slot (future module) */
.fsp-thub-instrument--slot {
	opacity: 0.45;
	pointer-events: none;
	border-style: dashed;
	background: rgba(14, 18, 24, 0.6);
}

.fsp-thub-instrument__screen--empty {
	align-items: center;
	justify-content: center;
	color: var(--fsp-tools-steel);
	font-size: 11px;
	font-weight: 600;
}

.fsp-thub-empty {
	padding: 40px 24px;
	text-align: center;
	border: 1px dashed rgba(15, 23, 42, 0.35);
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.15);
	color: var(--fsp-tools-ink);
	font-family: 'Vazirmatn', Tahoma, system-ui, sans-serif;
}

/* ─── Spec footer ──────────────────────────────────────────── */
.fsp-thub-spec {
	background: transparent;
	border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.fsp-thub-spec__inner {
	max-width: 920px;
	margin: 0 auto;
	padding: 16px 20px 24px;
	text-align: center;
}

.fsp-thub-spec p {
	margin: 0;
	font-family: 'Vazirmatn', Tahoma, system-ui, sans-serif;
	font-size: 11px;
	color: var(--fsp-canvas-lead, #475569);
	line-height: 1.6;
}

/* ─── Tool single page ─────────────────────────────────────── */
body.fsp-tools--single {
	background: #eef2f7;
	color: #0f172a;
}

.fsp-tsingle {
	display: flex;
	flex-direction: column;
	min-height: calc(100vh - var(--fsp-chrome-fixed-top, 64px) - var(--fsp-ticker-bottom-h, 0px));
}

/* Stage header — tool-specific schematic, no hub photo */
.fsp-tsingle-stage {
	position: relative;
	overflow: hidden;
	isolation: isolate;
	background:
		radial-gradient(ellipse 70% 55% at 78% 42%, rgba(74, 111, 165, 0.16), transparent 58%),
		linear-gradient(165deg, #0b1018 0%, #161c26 42%, #1e293b 100%);
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.fsp-tsingle-stage__content {
	position: relative;
	z-index: 2;
	max-width: 720px;
	margin: 0 auto;
	padding: 28px 20px 32px;
	text-align: center;
}

.fsp-tsingle-crumb {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 0 0 14px;
	font-family: 'Vazirmatn', Tahoma, system-ui, sans-serif;
	font-size: 12px;
	font-weight: 700;
	color: #64748b;
}

.fsp-tsingle-crumb a {
	color: #94a3b8;
	text-decoration: none;
	transition: color 0.15s ease;
}

.fsp-tsingle-crumb a:hover {
	color: #eef2f7;
}

.fsp-tsingle-crumb span[aria-hidden="true"] {
	opacity: 0.4;
}

.fsp-tsingle-stage__badge {
	display: inline-block;
	margin-bottom: 12px;
	padding: 4px 10px;
	border-radius: 6px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.1em;
	color: #4a6fa5;
	background: rgba(74, 111, 165, 0.15);
	border: 1px solid rgba(74, 111, 165, 0.28);
}

.fsp-tsingle-stage h1 {
	margin: 0 0 12px;
	font-family: 'Vazirmatn', Tahoma, system-ui, sans-serif;
	font-size: clamp(1.5rem, 4vw, 2rem);
	font-weight: 900;
	line-height: 1.15;
	color: #f1f5f9;
	text-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.fsp-tsingle-stage__lead {
	max-width: 540px;
	margin: 0 auto 18px;
	font-family: 'Vazirmatn', Tahoma, system-ui, sans-serif;
	font-size: 15px;
	line-height: 1.7;
	font-weight: 600;
	color: #cbd5e1;
}

.fsp-tsingle-stage__meta {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.fsp-tsingle-stage__meta li {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 100px;
	padding: 10px 14px;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.07);
	border: 1px solid rgba(255, 255, 255, 0.12);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
}

.fsp-tsingle-stage__meta span {
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #94a3b8;
}

.fsp-tsingle-stage__meta strong {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 13px;
	font-weight: 800;
	color: #fff;
}

/* Sheet-weight schematic scene — in document flow, never over text */
.fsp-tsw-scene {
	position: relative;
	z-index: 0;
	height: 132px;
	margin: 0 auto 8px;
	max-width: 720px;
	overflow: hidden;
	pointer-events: none;
	opacity: 0.7;
}

.fsp-tsw-scene__grid {
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(rgba(148, 163, 184, 0.07) 1px, transparent 1px),
		linear-gradient(90deg, rgba(148, 163, 184, 0.07) 1px, transparent 1px);
	background-size: 28px 28px;
	mask-image: linear-gradient(180deg, #000 0%, transparent 88%);
}

.fsp-tsw-scene__glow {
	position: absolute;
	inset: 0;
	background: radial-gradient(circle at 50% 30%, rgba(200, 208, 220, 0.1), transparent 55%);
}

.fsp-tsw-scene__svg {
	display: block;
	width: min(280px, 72vw);
	height: auto;
	margin: 0 auto;
	opacity: 0.75;
}

.fsp-tsingle-stage--sheet-weight .fsp-tsingle-stage__content,
.fsp-tsingle-stage--weight-calculator .fsp-tsingle-stage__content,
.fsp-tsingle-stage--unit-converter .fsp-tsingle-stage__content,
.fsp-tsingle-stage--geometry-calculator .fsp-tsingle-stage__content,
.fsp-tsingle-stage--standards-stahl .fsp-tsingle-stage__content,
.fsp-tsingle-stage--price-calculator .fsp-tsingle-stage__content,
.fsp-tsingle-stage--load-planner .fsp-tsingle-stage__content,
.fsp-tsingle-stage--listofer .fsp-tsingle-stage__content {
	padding-top: 0;
}

@media (min-width: 720px) {
	.fsp-tsingle-stage--sheet-weight,
	.fsp-tsingle-stage--weight-calculator,
	.fsp-tsingle-stage--unit-converter,
	.fsp-tsingle-stage--geometry-calculator,
	.fsp-tsingle-stage--standards-stahl,
	.fsp-tsingle-stage--price-calculator,
	.fsp-tsingle-stage--load-planner,
	.fsp-tsingle-stage--listofer {
		min-height: 0;
	}

	.fsp-tsw-scene {
		height: 148px;
		margin-bottom: 4px;
	}

	.fsp-tsw-scene__svg {
		width: min(300px, 42vw);
	}
}

/* Calculator workspace */
.fsp-tsingle-workspace {
	flex: 1;
	background: linear-gradient(180deg, #eef2f7 0%, #f8fafc 100%);
}

.fsp-tsingle-workspace__inner {
	max-width: 860px;
	margin: 0 auto;
	padding: 28px 20px 48px;
}

.fsp-tsingle > .fsp-brand-trust {
	flex-shrink: 0;
	width: 100%;
	margin-top: 0;
}

.fsp-tsingle > .fsp-brand-gateway {
	flex-shrink: 0;
	width: 100%;
}

/* Legacy single shell (shortcode embed) */
.fsp-tools-page {
	display: flex;
	flex-direction: column;
	min-height: calc(100vh - var(--fsp-chrome-fixed-top, 64px) - var(--fsp-ticker-bottom-h, 0px));
}

.fsp-tools-page > .fsp-tools-shell {
	flex: 1 0 auto;
}

.fsp-tools-page > .fsp-brand-trust {
	flex-shrink: 0;
	width: 100%;
	margin-top: 48px;
}

.fsp-tools-page > .fsp-brand-gateway {
	flex-shrink: 0;
	width: 100%;
}

.fsp-tools-shell {
	max-width: 1100px;
	margin: 0 auto;
	padding: 32px 20px 48px;
	color: inherit;
}

.fsp-tools-shell--narrow {
	max-width: 720px;
}

body.fsp-tools--embed .fsp-tools-shell {
	color: #0f172a;
}

body.fsp-tools--embed .fsp-tools-kicker a:hover {
	color: var(--fsp-tools-blue, #4a6fa5);
}

body.fsp-tools-notice.fsp-tools {
	background: linear-gradient(180deg, var(--fsp-tools-black) 0%, var(--fsp-tools-graphite) 100%);
	color: var(--fsp-tools-text);
}

.fsp-tools-notice .fsp-tools-shell {
	min-height: 50vh;
	display: grid;
	place-items: center;
	color: var(--fsp-tools-muted);
}

@media (max-width: 1024px) {
	.fsp-thub-console {
		width: 100%;
		max-width: 100%;
		box-sizing: border-box;
	}

	.fsp-thub-console__readouts {
		max-width: none;
		width: 100%;
		flex-direction: column;
		align-items: stretch;
		gap: 10px;
	}

	.fsp-thub-console__readouts > div {
		min-width: 0;
		width: 100%;
	}

	.fsp-thub-instrument {
		grid-template-columns: 1fr;
		grid-template-rows: auto;
		text-align: center;
		padding: 16px;
	}

	.fsp-thub-instrument__code {
		writing-mode: horizontal-tb;
		transform: none;
	}

	.fsp-thub-instrument__run {
		justify-content: center;
		width: 100%;
	}

	.fsp-thub-instrument__body {
		text-align: right;
	}

	body.fsp-tools--hub .fsp-thub-console__inner {
		padding-inline: var(--fsp-page-pad-x, 16px);
		box-sizing: border-box;
		width: 100%;
		max-width: 100%;
		min-width: 0;
	}

	.fsp-thub-console__readouts {
		padding-inline: 0;
		margin-inline: 0;
	}

	.fsp-thub-bay__inner,
	.fsp-tsingle-workspace__inner {
		padding: 28px var(--fsp-page-pad-x, 16px) 40px;
	}
}

@media (max-width: 640px) {
	.fsp-thub-instrument {
		padding: 14px;
		gap: 12px;
	}

	.fsp-thub-bay__head h2 {
		font-size: 1rem;
	}

	.fsp-tsingle-stage__meta {
		flex-direction: column;
		align-items: stretch;
	}
}
