/* Loom & Fiber calculator workspace: sidebar dashboard shared by all tools. */
.lftcw {
	--w-ink: #26342f;
	--w-soft: #52605a;
	--w-paper: #fffefa;
	--w-panel: #f6f2ea;
	--w-line: #e2dbcf;
	--w-accent: #a93e21;
	--w-accent-soft: rgba(188, 75, 41, .09);
	--w-card: #fff;
	background: var(--w-paper);
}
html[data-theme="dark"] .lftcw {
	--w-ink: #f3eee6;
	--w-soft: #c7beb2;
	--w-paper: #171614;
	--w-panel: #211f1c;
	--w-line: rgba(245, 240, 232, .14);
	--w-accent: #e08a67;
	--w-accent-soft: rgba(224, 138, 103, .12);
	--w-card: #211f1c;
}

.lftcw-shell {
	display: grid;
	grid-template-columns: 264px minmax(0, 1fr);
	gap: clamp(28px, 4vw, 56px);
	width: min(1340px, calc(100% - 48px));
	margin: 0 auto;
	padding-block: clamp(28px, 4vw, 48px) clamp(56px, 7vw, 96px);
}

/* ---------- Sidebar ---------- */
.lftcw-shell > * { min-width: 0; }
.lftcw-sidebar { position: relative; }
.lftcw-nav {
	position: sticky;
	top: 104px;
	max-height: calc(100vh - 124px);
	overflow-y: auto;
	padding: 18px;
	border: 1px solid var(--w-line);
	border-radius: 14px;
	background: var(--w-panel);
	scrollbar-width: thin;
}
.lftcw-nav ul { list-style: none; margin: 0; padding: 0; }
.lftcw-nav a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 10px;
	border-radius: 8px;
	color: var(--w-ink);
	font-size: .9rem;
	line-height: 1.3;
	text-decoration: none;
	transition: background .15s ease, color .15s ease;
}
.lftcw-nav a:hover { background: var(--w-accent-soft); color: var(--w-ink); }
.lftcw-nav a.is-active {
	background: var(--w-card);
	box-shadow: 0 1px 0 var(--w-line), 0 6px 18px rgba(38, 34, 29, .06);
	color: var(--w-accent);
	font-weight: 650;
}
.lftcw-nav__home { margin-bottom: 8px; font-weight: 600; }
.lftcw-nav__icon { width: 22px; text-align: center; color: var(--w-accent); }
.lftcw-nav__group { padding-top: 14px; margin-top: 8px; border-top: 1px solid var(--w-line); }
.lftcw-nav__label {
	margin: 0 0 8px;
	padding-inline: 10px;
	color: var(--w-accent);
	font-size: .7rem;
	font-weight: 800;
	letter-spacing: .14em;
	line-height: 1.4;
	text-transform: uppercase;
}
.lftcw-nav__label small {
	display: block;
	color: var(--w-soft);
	font-size: .74rem;
	font-weight: 400;
	letter-spacing: 0;
	text-transform: none;
}
.lftcw-nav__step,
.lftcw-nav__dot {
	flex: none;
	display: inline-grid;
	place-items: center;
	width: 22px;
	height: 22px;
	border: 1px solid var(--w-line);
	border-radius: 50%;
	background: var(--w-card);
	color: var(--w-soft);
	font-size: .7rem;
	font-weight: 700;
}
.lftcw-nav__dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .55; }
.lftcw-nav a.is-active .lftcw-nav__step,
.lftcw-nav a.is-active .lftcw-nav__dot { border-color: var(--w-accent); background: var(--w-accent); color: #fff; }

.lftcw-nav__project { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--w-line); }
.lftcw-nav__project dl { margin: 0 0 6px; padding-inline: 10px; font-size: .82rem; }
.lftcw-nav__project dl div { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--w-line); }
.lftcw-nav__project dt { color: var(--w-soft); }
.lftcw-nav__project dd { margin: 0; color: var(--w-ink); font-weight: 650; text-align: right; }
.lftcw-link-button {
	margin: 4px 10px 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--w-accent);
	font-size: .8rem;
	text-decoration: underline;
	cursor: pointer;
}
.lftcw-link-button:hover { background: none; color: var(--w-ink); }

/* ---------- Main panel ---------- */
.lftcw-main { min-width: 0; transition: opacity .18s ease; }
.lftcw.is-loading .lftcw-main { opacity: .45; }
.lftcw-head { margin-bottom: 18px; }
.lftcw-crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; color: var(--w-soft); font-size: .82rem; }
.lftcw-crumbs a { color: var(--w-soft); }
.lftcw-head h1 {
	margin: 0;
	color: var(--w-ink);
	font-size: clamp(2rem, 3.6vw, 3.1rem);
	line-height: 1.08;
	outline: none;
}

/* The tool's own hero is replaced by the page H1: keep only its intro text. */
.lftcw .lftc { width: 100%; margin: 0; }
.lftcw .lftc-tool-header { max-width: 760px; margin: 0 0 26px; text-align: left; }
.lftcw .lftc-tool-header > .lftc-eyebrow,
.lftcw .lftc-tool-header > h2 { display: none; }
.lftcw .lftc-tool-header > p:last-child { margin: 0; font-size: 1.02rem; color: var(--w-soft); }
.lftcw .lftc-form-title { grid-template-columns: 1fr; margin-bottom: 26px; }
.lftcw .lftc-form-title > span { display: none; }
.lftcw .lftc-layout { border-radius: 14px; box-shadow: 0 16px 44px rgba(38, 34, 29, .08); }
.lftcw .lftc-form { padding: clamp(24px, 3.4vw, 40px); }
.lftcw .lftc-disclaimer { max-width: none; text-align: left; }

/* Result actions: copy, share link, print. */
.lftcw .lftc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.lftc-prefill {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin: 0 0 22px;
	padding: 10px 14px;
	border: 1px solid rgba(188, 75, 41, .3);
	border-radius: 10px;
	background: rgba(188, 75, 41, .07);
	color: var(--lf-ink, #26342f);
	font-size: .86rem;
}
.lftc-prefill::before { content: "↺"; color: #a93e21; font-weight: 700; }
.lftc-prefill span { flex: 1; }
.lftc-prefill button {
	padding: 4px 12px;
	border: 1px solid currentColor;
	background: transparent;
	color: #a93e21;
	font-size: .8rem;
}
.lftc-prefill button:hover { background: #a93e21; color: #fff; }

/* Next step in the curtain project. */
.lftcw-next {
	display: grid;
	gap: 4px;
	margin-top: 22px;
	padding: 20px 24px;
	border: 1px solid var(--w-accent);
	border-radius: 14px;
	background: var(--w-accent-soft);
	color: var(--w-ink);
	text-decoration: none;
	transition: transform .15s ease, box-shadow .15s ease;
}
.lftcw-next:hover { color: var(--w-ink); transform: translateY(-2px); box-shadow: 0 12px 28px rgba(38, 34, 29, .08); }
.lftcw-next__step { color: var(--w-accent); font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.lftcw-next strong { font-family: var(--lf-serif, Georgia, serif); font-size: 1.4rem; font-weight: 500; }
.lftcw-next > span:last-child { color: var(--w-soft); font-size: .92rem; }

/* Related calculators. */
.lftcw-related { margin-top: 40px; }
.lftcw-related h2 { margin: 0 0 14px; font-size: 1.5rem; }
.lftcw-related__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.lftcw-related a,
.lfch--dashboard .lfch-card {
	display: grid;
	align-content: start;
	gap: 6px;
	padding: 18px;
	border: 1px solid var(--w-line);
	border-radius: 12px;
	background: var(--w-card);
	color: var(--w-ink);
	text-decoration: none;
	transition: border-color .15s ease, transform .15s ease;
}
.lftcw-related a:hover,
.lfch--dashboard .lfch-card:hover { border-color: var(--w-accent); color: var(--w-ink); transform: translateY(-2px); }
.lftcw-related strong,
.lfch--dashboard .lfch-card strong { font-size: .98rem; line-height: 1.3; }
.lftcw-related span,
.lfch--dashboard .lfch-card span { color: var(--w-soft); font-size: .86rem; line-height: 1.5; }

/* ---------- Hub dashboard ---------- */
.lfch--dashboard { width: 100%; margin: 0; color: var(--w-soft); }
.lfch--dashboard h2 { color: var(--w-ink); font-weight: 500; }
.lfch--dashboard .lfch-lead { max-width: 720px; margin: 0 0 28px; font-size: 1.06rem; }
.lfch--dashboard .lfch-eyebrow { margin: 0 0 6px; color: #e9b49d; font-size: .72rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.lfch-project {
	padding: clamp(22px, 3vw, 34px);
	border-radius: 16px;
	background: radial-gradient(ellipse at 95% 0%, rgba(188, 75, 41, .28), transparent 22rem), #211f1c;
	color: #d9d1c5;
}
.lfch-project h2 { margin: 0 0 20px; color: #fbf7f0 !important; font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
.lfch-project__steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 20px; padding: 0; list-style: none; }
.lfch-project__steps a {
	display: grid;
	align-content: start;
	gap: 6px;
	height: 100%;
	padding: 16px;
	border: 1px solid rgba(255, 255, 255, .12);
	border-radius: 12px;
	background: rgba(255, 255, 255, .04);
	color: #fbf7f0;
	text-decoration: none;
	transition: background .15s ease, border-color .15s ease;
}
.lfch-project__steps a:hover { border-color: #e08a67; background: rgba(255, 255, 255, .08); color: #fff; }
.lfch-project__steps strong { font-size: .95rem; line-height: 1.3; }
.lfch-project__steps span:last-child { color: #c7beb2; font-size: .84rem; line-height: 1.5; }
.lfch-project__n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #bc4b29; color: #fff; font-size: .8rem; font-weight: 700; }
.lfch-project__start {
	display: inline-flex;
	gap: 10px;
	padding: 11px 20px;
	border-radius: 999px;
	background: #fbf7f0;
	color: #211f1c;
	font-size: .9rem;
	font-weight: 650;
	text-decoration: none;
}
.lfch-project__start:hover { background: #e9b49d; color: #211f1c; }
.lfch--dashboard .lfch-collection { margin-top: 40px; }
.lfch--dashboard .lfch-collection h2 { margin: 0 0 14px; font-size: 1.6rem; }
.lfch--dashboard .lfch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.lfch--dashboard .lfch-card small { color: var(--w-accent); font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.lfch--dashboard .lfch-guidance {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin-top: 40px;
	padding: 0;
	border: 0;
	background: none;
}
.lfch--dashboard .lfch-guidance > div { padding: 22px; border: 1px solid var(--w-line); border-radius: 12px; background: var(--w-panel); }
.lfch--dashboard .lfch-guidance h2 { margin: 0 0 10px; font-size: 1.3rem; }
.lfch--dashboard .lfch-guidance ul { margin: 0; padding-left: 18px; }
.lfch--dashboard .lfch-guidance li { margin-bottom: 6px; }
.lfch--dashboard .lfch-guidance strong { color: var(--w-ink); }
.lfch--dashboard .lfch-guidance p { margin: 0; }

/* ---------- Tablet & mobile: sidebar becomes a scrollable chip bar ---------- */
@media (max-width: 1000px) {
	.lftcw-shell { grid-template-columns: minmax(0, 1fr); gap: 20px; width: min(100% - 32px, 1340px); padding-top: 16px; }
	.lftcw-sidebar { position: sticky; top: 0; z-index: 30; margin-inline: -16px; }
	.lftcw-nav {
		position: static;
		display: flex;
		gap: 6px;
		max-height: none;
		overflow-x: auto;
		overflow-y: hidden;
		padding: 10px 16px;
		border-width: 0 0 1px;
		border-radius: 0;
		background: var(--w-paper);
		scroll-snap-type: x proximity;
		-webkit-overflow-scrolling: touch;
	}
	.lftcw-nav ul { display: contents; }
	.lftcw-nav li { display: contents; }
	.lftcw-nav a {
		flex: none;
		padding: 7px 12px 7px 8px;
		border: 1px solid var(--w-line);
		border-radius: 999px;
		background: var(--w-card);
		font-size: .82rem;
		white-space: nowrap;
		scroll-snap-align: start;
	}
	.lftcw-nav__home { margin: 0; }
	.lftcw-nav__group { display: contents; }
	.lftcw-nav__label,
	.lftcw-nav__project { display: none !important; }
	.lftcw-nav__step, .lftcw-nav__dot { width: 20px; height: 20px; }
	.lfch-project__steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
	.lfch-project__steps,
	.lfch--dashboard .lfch-guidance { grid-template-columns: 1fr; }
	.lftcw .lftc-form,
	.lftcw .lftc-results { padding: 24px 18px; }
}

/* ---------- Print: a clean results sheet ---------- */
@media print {
	header, footer, .lf-site-header, .lf-site-footer, .lf-announcement,
	.lftcw-sidebar, .lftcw-crumbs, .lftcw-next, .lftcw-related, .lftc-prefill,
	.lftc-actions, .lftc-copy-status, .lftc-reset, .lftc-tool-header,
	.lftc-length-visual, .lftc-window, [aria-hidden="true"] { display: none !important; }
	.lftcw-shell { display: block; width: 100%; padding: 0; }
	.lftcw .lftc-layout { display: block; border: 0; box-shadow: none; }
	.lftcw .lftc-results { background: none !important; color: #111; padding: 0; margin-top: 16px; }
	.lftcw .lftc-advanced { display: block; }
	.lftcw .lftc-advanced > :not(summary) { display: block !important; }
	.lftcw-head h1 { font-size: 22pt; }
}

/* Hub overrides of the legacy directory styles. */
.lfch--dashboard .lfch-card { min-height: 0; }
.lfch--dashboard .lfch-collection { margin-bottom: 0; }
.lftcw-nav__icon { display: inline-grid; place-items: center; }
.lftcw-nav__icon svg { width: 16px; height: 16px; fill: currentColor; }

/* ---------- Guide content under each calculator ---------- */
.lftcw-guide { margin-top: 48px; padding-top: 40px; border-top: 1px solid var(--w-line); color: var(--w-soft); }
.lftcw-guide > h2,
.lftcw-faq > h2,
.lftcw-reading > h2 { margin: 0 0 18px; color: var(--w-ink); font-size: clamp(1.5rem, 2.4vw, 2rem); }
.lftcw-guide h3 { margin: 0 0 12px; color: var(--w-ink); font-size: 1.15rem; }
.lftcw-guide__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.lftcw-guide__block { margin-bottom: 16px; padding: 22px 24px; border: 1px solid var(--w-line); border-radius: 12px; background: var(--w-card); }
.lftcw-guide__grid .lftcw-guide__block { margin-bottom: 0; }
.lftcw-guide__grid + .lftcw-guide__block { margin-top: 16px; }
.lftcw-guide ol, .lftcw-guide ul { margin: 0; padding-left: 20px; }
.lftcw-guide li { margin-bottom: 8px; line-height: 1.55; }
.lftcw-guide li::marker { color: var(--w-accent); font-weight: 700; }
.lftcw-formula { list-style: none; padding: 0 !important; }
.lftcw-formula code {
	display: block;
	padding: 9px 12px;
	border-radius: 8px;
	background: var(--w-panel);
	color: var(--w-ink);
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: .84rem;
	line-height: 1.5;
	white-space: normal;
}
.lftcw-guide__note { margin: 10px 0 0; font-size: .86rem; }
.lftcw-guide__example { border-left: 4px solid var(--w-accent); background: var(--w-accent-soft); }
.lftcw-guide__example p { margin: 0 0 8px; color: var(--w-ink); }
.lftcw-guide__example p:last-child { margin-bottom: 0; }
.lftcw-faq { margin-top: 36px; }
.lftcw-faq details { border-bottom: 1px solid var(--w-line); }
.lftcw-faq summary {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding: 16px 0;
	color: var(--w-ink);
	font-weight: 600;
	cursor: pointer;
	list-style: none;
}
.lftcw-faq summary::-webkit-details-marker { display: none; }
.lftcw-faq summary::after { content: "+"; color: var(--w-accent); font-size: 1.3rem; line-height: 1; }
.lftcw-faq details[open] summary::after { content: "−"; }
.lftcw-faq details p { margin: 0 0 16px; max-width: 760px; }
.lftcw-reading { margin-top: 36px; }
.lftcw-reading ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.lftcw-reading a {
	display: block;
	padding: 14px 18px;
	border: 1px solid var(--w-line);
	border-radius: 10px;
	background: var(--w-panel);
	color: var(--w-ink);
	text-decoration: none;
}
.lftcw-reading a::after { content: " →"; color: var(--w-accent); }
.lftcw-reading a:hover { border-color: var(--w-accent); color: var(--w-ink); }
@media (max-width: 760px) {
	.lftcw-guide__grid { grid-template-columns: 1fr; }
	.lftcw-guide__block { padding: 18px; }
}
@media print { .lftcw-guide { display: none !important; } }

/* Project panel actions. */
.lftcw-nav__project-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-inline: 10px; margin-top: 8px; }
.lftcw-nav__project-actions .lftcw-link-button { margin: 0; }
.lftcw-mini-button {
	padding: 6px 12px;
	border: 1px solid var(--w-accent);
	border-radius: 999px;
	background: transparent;
	color: var(--w-accent);
	font-size: .78rem;
	font-weight: 650;
}
.lftcw-mini-button:hover { background: var(--w-accent); color: #fff; }
.lftcw-nav__status { margin: 6px 10px 0; color: var(--w-soft); font-size: .76rem; min-height: 1em; }
