/* E46 Garage
   Instrument cluster: E46 "Kombi" — matte black dials, white markings by day,
   orange-red at night, orange-red needles, chrome rings.
   Pages: BMW print/web house style c. 1999–2003 — white, Helvetica,
   plain headings ending in a full stop, technical-data tables. */

.e46 {
	--ink: #262626;
	--text: #3c3c3c;
	--grey: #767676;
	--rule: #cfcfcf;
	--rule-lt: #e3e3e3;
	--panel: #efefef;
	--link: #0b4f9c;
	--needle: #ff4612;
	--night: #ff5419;
	--lcd: #ff6a1f;
	--font: "Helvetica Neue", Helvetica, Arial, "Nimbus Sans", sans-serif;
	--w: 980px;

	font: 14px/1.55 var(--font);
	color: var(--text);
	-webkit-font-smoothing: antialiased;
}
.e46 *, .e46 *::before, .e46 *::after { box-sizing: border-box; }
.e46 a { color: var(--link); text-decoration: none; }
.e46 a:hover { text-decoration: underline; }
.e46 img { max-width: 100%; height: auto; }
.e46 [hidden] { display: none !important; }
.e46 small { font-size: 12px; color: var(--grey); }

/* ---------- Shell ---------- */

body.e46-app.e46-app { margin: 0; padding: 0; background: #fff; }
.e46-shell { min-height: 100vh; display: flex; flex-direction: column; }
.e46-main { flex: 1; }

.e46-top { border-bottom: 1px solid var(--rule); background: #fff; }
.e46-top__inner, .e46-foot__inner, .e46-page {
	width: min(var(--w), 100% - 40px);
	margin-inline: auto;
}
.e46-top__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 56px; flex-wrap: wrap; }
.e46-brand { font-size: 15px; font-weight: 700; color: var(--ink) !important; letter-spacing: -.01em; }
.e46-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.e46-nav li + li::before { content: "|"; color: var(--rule); padding: 0 10px; }
.e46-nav a { color: var(--grey); font-size: 13px; }
.e46-nav a:hover { color: var(--ink); text-decoration: none; }
.e46-nav a[aria-current="page"] { color: var(--ink); font-weight: 700; }

.e46-foot { margin-top: 64px; border-top: 1px solid var(--rule); background: var(--panel); }
.e46-foot__inner { display: flex; justify-content: space-between; padding: 14px 0; font-size: 12px; color: var(--grey); }

/* ---------- Type ---------- */

.e46-title { margin: 0 0 8px; font-size: 30px; font-weight: 400; line-height: 1.2; color: var(--ink); letter-spacing: -.01em; }
.e46-h { margin: 0 0 12px; font-size: 19px; font-weight: 400; line-height: 1.3; color: var(--ink); }
.e46-lede { margin: 0; max-width: 640px; font-size: 15px; color: var(--grey); }
.e46-intro { padding: 36px 0 28px; }
.e46-page section { margin-top: 44px; }
.e46-more { margin: 12px 0 0; font-size: 13px; }
.e46-more a::before { content: "› "; }
.e46-date { display: block; font-size: 12px; color: var(--grey); }
.e46-crumb { margin: 28px 0 10px; font-size: 12px; color: var(--grey); }

.e46-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.e46-cols > section { margin-top: 44px; }
@media (max-width: 760px) { .e46-cols { grid-template-columns: 1fr; gap: 0; } }

/* ---------- Cover photo ---------- */

.e46-cover { margin: 0; background: #fff; }
.e46-cover__img { display: block; width: 100%; max-height: 72vh; min-height: 260px; object-fit: cover; }
.e46-cover figcaption { width: min(var(--w), 100% - 40px); margin: 0 auto; padding: 6px 0; font-size: 11px; text-align: right; color: #8a8a8a; background: #fff; }
.e46-cover figcaption a { color: inherit; }
.e46-app .e46-cover { width: 100%; }

/* =========================================================
   Instrument cluster
   ========================================================= */

.e46-kombi {
	margin-top: 8px;
	padding: 28px 24px 20px;
	background: linear-gradient(#1a1a1a, #0b0b0b 40%, #000);
	border-radius: 4px;
}
.e46-kombi__binnacle {
	display: grid; grid-template-columns: 1fr 150px 1fr; align-items: center; gap: 18px;
	max-width: 860px; margin: 0 auto;
}
.e46-gauge { margin: 0; text-align: center; }
.e46-dial { display: block; width: 100%; height: auto; }
.e46-gauge figcaption { margin-top: 10px; font-size: 12px; color: #8d8d8d; }

.e46-face { fill: #0a0a0a; }
.e46-mk { stroke: #f2f2f2; stroke-width: 1.4; }
.e46-mk--maj { stroke-width: 3; }
.e46-nm { fill: #f2f2f2; font: 400 21px var(--font); text-anchor: middle; }
.e46-un { fill: #bdbdbd; font: 400 10px var(--font); text-anchor: middle; letter-spacing: .3px; }
.e46-un--sub { font-size: 8px; letter-spacing: .6px; }
.e46-sm { fill: #f2f2f2; font: 400 11px var(--font); text-anchor: middle; }
.e46-gl { color: #f2f2f2; }
.e46-red { fill: none; stroke: #e5281b; stroke-width: 6; }
.e46-red--sub { stroke-width: 4; }
.e46-needle { transition: transform 1s cubic-bezier(.35, .1, .2, 1); }
.e46-needle path { fill: var(--needle); }
.e46-cap { fill: #111; stroke: #2b2b2b; stroke-width: 1; }
.e46-cap-hl { fill: none; stroke: rgba(255, 255, 255, .06); stroke-width: 2; }
.e46-lcdwin { fill: #120601; stroke: #2a2a2a; stroke-width: 1; }
.e46-lcdtxt { fill: var(--lcd); font: 400 18px "VT323", ui-monospace, monospace; text-anchor: end; letter-spacing: .5px; }

/* Lights on: markings switch to orange-red, like the real thing at night. */
.e46-kombi.is-night .e46-mk { stroke: var(--night); }
.e46-kombi.is-night .e46-nm, .e46-kombi.is-night .e46-sm { fill: var(--night); }
.e46-kombi.is-night .e46-un { fill: #c2421a; }
.e46-kombi.is-night .e46-gl { color: var(--night); }
.e46-kombi.is-night .e46-red { stroke: #ff2a12; }

.e46-kombi__mid { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.e46-cc { display: grid; grid-template-columns: repeat(4, 22px); gap: 8px; padding: 8px 10px; background: #070707; border: 1px solid #222; border-radius: 2px; }
.e46-cc span { width: 22px; height: 22px; color: #1f1f1f; }
.e46-cc .e46-ico { display: block; width: 100%; height: 100%; }
.e46-cc span.on.a { color: #f5a623; }
.e46-cc span.on.r { color: #e5281b; }
.e46-kombi.is-test .e46-cc span { color: #f5a623; }
.e46-obc {
	width: 100%; min-height: 26px; padding: 3px 6px;
	background: #120601; border: 1px solid #2a2a2a; border-radius: 2px;
	font: 17px/1.1 "VT323", ui-monospace, monospace; color: var(--lcd); text-align: center;
	overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
	transition: opacity .15s;
}
.e46-obc.is-blank { opacity: 0; }

.e46-si { display: inline-flex; gap: 5px; padding: 5px 7px; background: #070707; border: 1px solid #222; border-radius: 2px; }
.e46-si i { width: 9px; height: 9px; border-radius: 50%; background: #1d1d1d; }
.e46-si i.g.on, .e46-kombi.is-test .e46-si i.g { background: #2fd15a; }
.e46-si i.y.on, .e46-kombi.is-test .e46-si i.y { background: #ffc414; }
.e46-si i.r.on, .e46-kombi.is-test .e46-si i.r { background: #ff2a12; }

.e46-lights { width: 34px; height: 26px; padding: 3px; border: 1px solid #333; border-radius: 2px; background: #151515; color: #777; cursor: pointer; }
.e46-lights svg { width: 100%; height: 100%; }
.e46-lights[aria-pressed="true"] { color: #2fd15a; border-color: #2c4a33; }

@media (max-width: 760px) {
	.e46-kombi { padding: 18px 10px 14px; }
	.e46-kombi__binnacle { grid-template-columns: 1fr 1fr; gap: 10px; }
	.e46-kombi__mid { grid-column: 1 / -1; grid-row: 2; flex-direction: row; flex-wrap: wrap; justify-content: center; }
	.e46-obc { width: auto; flex: 1 1 100%; order: 1; }
	.e46-gauge figcaption { font-size: 11px; }
}

/* =========================================================
   Tables — brochure "technical data" style
   ========================================================= */

.e46-tech { width: 100%; border-collapse: collapse; border-top: 1px solid var(--ink); }
.e46-tech th, .e46-tech td { padding: 7px 0; border-bottom: 1px solid var(--rule-lt); text-align: left; vertical-align: top; font-weight: 400; }
.e46-tech th { width: 42%; color: var(--grey); padding-right: 12px; }
.e46-tech td { color: var(--ink); }

.e46-table { width: 100%; border-collapse: collapse; border-top: 1px solid var(--ink); }
.e46-table th { padding: 7px 10px 7px 0; font-size: 12px; font-weight: 400; color: var(--grey); text-align: left; border-bottom: 1px solid var(--rule); }
.e46-table td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--rule-lt); vertical-align: top; }
.e46-table tbody tr:nth-child(even) td { background: #fafafa; }
.e46-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-right: 14px; }
.e46-table tfoot td { border-bottom: 1px solid var(--ink); font-weight: 700; color: var(--ink); }
.e46-table--sys .bar { width: 45%; }
.e46-table--sys .bar span { display: block; height: 6px; margin-top: 7px; background: #9aa3ad; }

.e46-table--parts { table-layout: fixed; }
.e46-table--parts th:nth-child(1) { width: 52%; }
.e46-table--parts th:nth-child(2) { width: 22%; }
.e46-table--parts th:nth-child(3) { width: 12%; }
.e46-table--parts th:nth-child(4) { width: 14%; }
.e46-table--parts tr[data-status="rejected"] td { color: #a5a5a5; }

.e46-st { white-space: nowrap; font-size: 13px; }
.e46-st::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; vertical-align: 0; background: #bdbdbd; }
.e46-st--ordered::before { background: var(--ink); }
.e46-st--arrived::before { background: var(--link); }
.e46-st--installed::before { background: #2e8b4e; }
.e46-st--to_order::before { background: #f5a623; }
.e46-st--considering::before { background: #fff; box-shadow: inset 0 0 0 1px var(--ink); }
.e46-st--included::before { background: #9aa3ad; }
.e46-st--rejected::before { background: transparent; box-shadow: inset 0 0 0 1px #c4c4c4; }
.e46-st--reference::before { background: transparent; box-shadow: inset 0 0 0 1px var(--link); }

.e46-filter { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: end; padding: 14px 16px; background: var(--panel); border-top: 1px solid var(--rule); }
.e46-filter label { display: grid; gap: 3px; font-size: 12px; color: var(--grey); }
.e46-filter input, .e46-filter select { font: 14px var(--font); padding: 5px 7px; border: 1px solid #b5b5b5; border-radius: 0; background: #fff; color: var(--ink); min-width: 190px; }
.e46-partgroup { margin-top: 40px; }

@media (max-width: 720px) {
	.e46-table--parts { table-layout: auto; }
	.e46-table--parts thead { display: none; }
	.e46-table--parts tr { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--rule-lt); }
	.e46-table--parts td { border: 0; padding: 1px 0; background: none !important; }
	.e46-table--parts td:nth-child(2) { grid-column: 1; font-size: 12px; color: var(--grey); }
	.e46-table--parts td:empty { display: none; }
	.e46-table--parts td:nth-child(3) { grid-column: 2; grid-row: 1; padding-right: 0; }
	.e46-table--parts td:nth-child(4) { grid-column: 2; grid-row: 2; text-align: right; }
	.e46-table--service thead { display: none; }
	.e46-table--service tr { display: grid; grid-template-columns: auto auto 1fr; gap: 2px 12px; padding: 8px 0; border-bottom: 1px solid var(--rule-lt); }
	.e46-table--service td { border: 0; padding: 0; background: none !important; text-align: left; }
	.e46-table--service td:nth-child(4) { grid-column: 1 / -1; }
	.e46-table--service td:nth-child(5) { display: none; }
}

/* ---------- Job cards ---------- */

.e46-jobs { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; align-items: start; }
.e46-job { border: 1px solid var(--rule); background: #fff; }
.e46-job__head { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; background: var(--panel); border-bottom: 1px solid var(--rule); font-size: 13px; }
.e46-job__head h3 { margin: 0; font-size: 13px; font-weight: 700; color: var(--ink); }
.e46-job__head > span { color: var(--grey); white-space: nowrap; }
.e46-job.is-complete .e46-job__head { background: #e5f0e8; }
.e46-job__list { list-style: none; margin: 0; padding: 0 12px; }
.e46-job__list li + li { border-top: 1px solid var(--rule-lt); }
.e46-check { display: flex; gap: 9px; align-items: flex-start; padding: 7px 0; cursor: pointer; }
.e46-check input { margin: 3px 0 0; accent-color: var(--ink); width: 14px; height: 14px; flex: none; }
.e46-check input:disabled { cursor: default; }
.e46-check.is-done span { color: #9a9a9a; text-decoration: line-through; }
.e46-check.is-saving { opacity: .5; }
.e46-progress { max-width: 640px; height: 4px; margin-top: 14px; background: var(--rule-lt); }
.e46-progress span { display: block; height: 100%; background: var(--ink); transition: width .3s; }

/* ---------- Build log ---------- */

.e46-log { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.e46-log > li { display: flex; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--rule-lt); }
.e46-log__media { flex: 0 0 200px; }
.e46-log__img { display: block; width: 200px; height: 134px; object-fit: cover; }
.e46-log__title { font-size: 16px; color: var(--ink) !important; }
.e46-log p { margin: 4px 0 0; }
.e46-log--compact > li { padding: 9px 0; }
.e46-log--compact .e46-log__title { font-size: 14px; }
@media (max-width: 560px) { .e46-log > li { flex-direction: column; } .e46-log__media, .e46-log__img { width: 100%; height: auto; flex-basis: auto; } }

/* ---------- Single entry ---------- */

.e46-entry { max-width: 720px; }
.e46-entry__photo { margin: 20px 0 24px; }
.e46-entry__photo img { display: block; width: 100%; }
.e46-entry__photo figcaption { margin-top: 5px; font-size: 11px; color: #8a8a8a; }
.e46-prose { font-size: 15px; line-height: 1.65; color: var(--text); }
.e46-prose h2 { margin: 32px 0 8px; font-size: 19px; font-weight: 400; color: var(--ink); }
.e46-prose h3 { font-size: 15px; font-weight: 700; color: var(--ink); }
.e46-prose ul, .e46-prose ol { padding-left: 18px; }
.e46-prose li { margin: 3px 0; }
.e46-pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 40px; padding-top: 12px; border-top: 1px solid var(--rule); font-size: 13px; }

/* ---------- Service lights on white pages ---------- */
.e46-intro .e46-si { margin-top: 14px; }

@media (prefers-reduced-motion: reduce) {
	.e46-needle, .e46-progress span { transition: none !important; }
}

/* ---------- Photo strip ---------- */
.e46-page .e46-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.e46-strip figure { margin: 0; }
.e46-strip img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.e46-strip figcaption { margin-top: 4px; font-size: 11px; color: #8a8a8a; line-height: 1.35; }
@media (max-width: 760px) { .e46-page .e46-strip { grid-template-columns: 1fr 1fr; } .e46-strip figure:nth-child(3) { display: none; } }
