/*
 * errorcode.info: printed service-manual look. See DESIGN.md.
 * Amber lives only inside .ec-display (the appliance readout motif).
 */
:root {
	--ec-paper: #fafaf8;
	--ec-surface: #ffffff;
	--ec-ink: #1a1a1a;
	--ec-muted: #595751;
	--ec-rule: #dcd9d1;
	--ec-rule-soft: #ebe9e3;
	--ec-amber: #e6a817;
	--ec-panel: #1c1b19;
	--ec-link: #1d4a9e;
	--ec-ok: #1b6b3e;
	--ec-mid: #7a4d00;
	--ec-bad: #9c2f0c;
	--ec-bad-soft: #fbeee8;
	--ec-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--ec-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
	--ec-wide: 1100px;
	--ec-narrow: 700px;
	--ec-s1: 8px;
	--ec-s2: 16px;
	--ec-s3: 28px;
	--ec-s4: 48px;
}

body.ec { background: var(--ec-paper); color: var(--ec-ink); font-family: var(--ec-font); font-size: 17px; line-height: 1.6; }
body.ec a { color: var(--ec-link); text-underline-offset: 2px; }
body.ec a:hover { color: var(--ec-ink); }
.ec h1, .ec h2, .ec h3 { font-family: var(--ec-font); color: var(--ec-ink); letter-spacing: -0.01em; }

/* Interaction basics (R-32, R-39) */
.ec a, .ec button, .ec summary, .ec select, .ec label[for] { cursor: pointer; }
.ec a:focus-visible, .ec button:focus-visible, .ec summary:focus-visible, .ec select:focus-visible, .ec input:focus-visible {
	outline: 2px solid var(--ec-ink);
	outline-offset: 2px;
	border-radius: 2px;
}

/* GeneratePress shell */
.ec .site-header { background: var(--ec-surface); border-bottom: 1px solid var(--ec-rule); }
.ec .main-title a, .ec .main-title a:hover { color: var(--ec-ink); font-weight: 800; letter-spacing: -0.02em; }
.ec .main-navigation, .ec .main-navigation ul ul { background: var(--ec-surface); }
.ec .main-navigation .main-nav ul li a, .ec .main-navigation .main-nav ul li[class*="current-menu-"] > a { color: var(--ec-ink); font-weight: 600; }
.ec .main-navigation .main-nav ul li a:hover { color: var(--ec-ink); text-decoration: underline; text-underline-offset: 4px; }
.ec .main-navigation .main-nav ul li.current-menu-item > a { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.ec .site, .ec .site-content, .ec .separate-containers .site-main { background: transparent; }
.ec .site-content { display: block; padding: 0; }
.ec .site-footer, .ec .site-info { background: var(--ec-surface); color: var(--ec-muted); font-size: 14px; }

.ec-wrap { max-width: var(--ec-wide); margin: 0 auto; padding: 0 var(--ec-s2); }
.ec-area { width: 100%; float: none; }
.ec-main { max-width: var(--ec-wide); margin: 0 auto !important; padding: var(--ec-s3) var(--ec-s2) var(--ec-s4) !important; }
.ec-narrow { max-width: calc(var(--ec-narrow) + 2 * var(--ec-s2)); }

/* ---- The display: identity motif ---- */
.ec-display {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-family: var(--ec-mono);
	font-weight: 700;
	color: var(--ec-amber);
	background: var(--ec-panel);
	border-radius: 4px;
	box-shadow: inset 0 0 0 1px #000, inset 0 1px 0 rgba(255, 255, 255, .06);
	letter-spacing: .06em;
	white-space: nowrap;
	line-height: 1;
}
.ec-display--sm { font-size: 17px; min-width: 3.4em; padding: 8px 10px; }
.ec-display--lg { font-size: 34px; min-width: 3.2em; padding: 14px 18px; }

/* ---- Search ---- */
.ec-searchbar { background: var(--ec-surface); border-bottom: 1px solid var(--ec-rule); padding: 10px 0; }
@media (max-width: 768px) { .ec-searchbar { position: sticky; top: 0; z-index: 50; } }

.ec-search { position: relative; }
.ec-search__row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--ec-s1); }
.ec-search__label { flex: 0 0 100%; font-weight: 700; font-size: 15px; }
.ec-search--sm .ec-search__label { flex: 0 0 auto; font-size: 14px; }
.ec-search__filters label { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; }
.ec-search__input { flex: 1; min-width: 0; min-height: 44px; font: inherit; font-size: 16px; padding: 10px 14px; border: 1px solid #86827a; border-radius: 6px; background: var(--ec-surface); color: var(--ec-ink); }
.ec-search__input::placeholder { color: #6b6860; }
.ec-search__input:focus { border-color: var(--ec-ink); }
.ec-search__btn { min-height: 44px; font: inherit; font-weight: 700; padding: 10px 18px; border: 1px solid var(--ec-ink); border-radius: 6px; background: var(--ec-ink); color: #fff; }
.ec-search__btn:hover { background: #000; }
.ec-search__btn:active { transform: translateY(1px); }
.ec-search--lg .ec-search__input { font-size: 20px; padding: 14px 16px; border-width: 1.5px; border-color: var(--ec-ink); }
.ec-search--lg .ec-search__btn { font-size: 18px; padding: 14px 24px; }
.ec-search__filters { display: flex; flex-wrap: wrap; gap: var(--ec-s1); margin-top: 10px; }
.ec-search__filters select { min-height: 44px; font: inherit; font-size: 15px; padding: 6px 10px; border: 1px solid #86827a; border-radius: 6px; background: var(--ec-surface); color: var(--ec-ink); }

.ec-suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 60; margin: 0; padding: 4px; list-style: none; background: var(--ec-surface); border: 1px solid var(--ec-ink); border-radius: 6px; box-shadow: 0 6px 18px rgba(0, 0, 0, .1); }
.ec-suggest a { display: flex; gap: 12px; align-items: center; min-height: 44px; padding: 4px 8px; border-radius: 4px; text-decoration: none; color: var(--ec-ink) !important; }
.ec-suggest .ec-display--sm { font-size: 14px; padding: 6px 8px; }
.ec-suggest a:hover, .ec-suggest a[aria-selected="true"] { background: var(--ec-rule-soft); }
.ec-suggest__msg { padding: 10px 8px; color: var(--ec-muted); font-size: 15px; }

/* ---- Breadcrumbs ---- */
.ec-crumbs ol { display: flex; flex-wrap: wrap; gap: 0 6px; margin: 0 0 var(--ec-s2); padding: 0; list-style: none; font-size: 14px; color: var(--ec-muted); }
.ec-crumbs li + li::before { content: "/"; margin-right: 6px; color: #8d897f; }
.ec-crumbs ol { align-items: center; }
.ec-crumbs a { color: var(--ec-muted) !important; display: inline-flex; align-items: center; min-height: 44px; }
.ec-crumbs a:hover { color: var(--ec-ink) !important; }

/* ---- Headings / page heads ---- */
.ec-pagehead { margin-bottom: var(--ec-s3); }
.ec-pagehead h1, .ec-title { font-size: clamp(1.7rem, 1.35rem + 1.3vw, 2.1rem); line-height: 1.18; margin: 0; font-weight: 800; }
.ec-lead { color: var(--ec-muted); font-size: 18px; max-width: 640px; margin: 10px 0 0; }
.ec-lead p:last-child { margin-bottom: 0; }
.ec-section { margin-top: var(--ec-s4); }
.ec-section > h2, .ec-quick h2, .ec-front-index h2 { font-size: 1.3rem; line-height: 1.3; margin: 0 0 var(--ec-s2); font-weight: 750; }
.ec-more { margin: var(--ec-s1) 0 0; font-weight: 600; }
.ec-more a { display: inline-flex; align-items: center; min-height: 44px; }
.ec-empty { padding: var(--ec-s2) 0; border-top: 1px solid var(--ec-rule); border-bottom: 1px solid var(--ec-rule); margin-top: var(--ec-s3); }
.ec-empty h2 { font-size: 1.15rem; margin: 0 0 6px; }
.ec-empty p { margin: 0; color: var(--ec-muted); }

/* ---- Code page ---- */
.ec-head { display: flex; align-items: center; gap: var(--ec-s2) 20px; flex-wrap: wrap; margin-bottom: var(--ec-s3); }
.ec-head .ec-title { flex: 1 1 280px; }

.ec-facts { margin: 0 0 var(--ec-s3); border-top: 1.5px solid var(--ec-ink); }
.ec-facts > div { display: grid; grid-template-columns: 9.5rem 1fr; gap: 4px 16px; padding: 10px 0; border-bottom: 1px solid var(--ec-rule); }
.ec-facts dt { font-weight: 700; font-size: 15px; padding-top: 1px; }
.ec-facts dd { margin: 0; }
.ec-sev { font-weight: 700; }
.ec-sev--diy { color: var(--ec-ok); }
.ec-sev--maybe_pro { color: var(--ec-mid); }
.ec-sev--call_tech { color: var(--ec-bad); }

.ec-content > *:last-child { margin-bottom: 0; }

.ec-quick { margin-top: var(--ec-s3); padding: 18px 20px 14px; background: var(--ec-surface); border: 1.5px solid var(--ec-ink); border-radius: 6px; }
.ec-quick h2 { margin-bottom: 8px; }
.ec-quick ol { margin: 0 0 0 1.3em; }
.ec-quick li { margin: 0; padding: 7px 0; border-top: 1px solid var(--ec-rule-soft); }
.ec-quick li:first-child { border-top: 0; }
.ec-quick li::marker { font-weight: 700; }

.ec-table-wrap { overflow-x: auto; }
.ec-table { width: 100%; border-collapse: collapse; margin: 0; border: 0; font-size: 15px; }
.ec-table th, .ec-table td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border: 0; border-bottom: 1px solid var(--ec-rule); background: transparent; }
.ec-table thead th { border-top: 1.5px solid var(--ec-ink); border-bottom: 1px solid var(--ec-ink); font-size: 14px; font-weight: 700; color: var(--ec-ink); }
.ec-table td:first-child { font-weight: 650; }

.ec-steps { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--ec-ink); }
.ec-steps > li { display: grid; grid-template-columns: 2.6rem 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--ec-rule); }
.ec-steps__n { font-family: var(--ec-mono); font-weight: 700; font-size: 15px; color: var(--ec-muted); padding-top: 2px; }
.ec-steps h3 { font-size: 1.05rem; margin: 0 0 4px; font-weight: 700; }
.ec-steps p { margin: 0 0 6px; }
.ec-steps p:last-child { margin-bottom: 0; }
.ec-warn { background: var(--ec-bad-soft); color: var(--ec-bad); padding: 8px 12px; border-radius: 4px; font-size: 15px; }

.ec-figure { margin: var(--ec-s3) 0 0; }
.ec-figure img { border-radius: 6px; border: 1px solid var(--ec-rule); height: auto; }
.ec-figure figcaption { font-size: 14px; color: var(--ec-muted); margin-top: 6px; }

.ec-faq details { border-bottom: 1px solid var(--ec-rule); }
.ec-faq details:first-of-type { border-top: 1.5px solid var(--ec-ink); }
.ec-faq summary { padding: 12px 28px 12px 0; font-weight: 650; position: relative; list-style: none; min-height: 44px; }
.ec-faq summary::-webkit-details-marker { display: none; }
.ec-faq summary::after { content: "+"; position: absolute; right: 4px; top: 10px; font-family: var(--ec-mono); font-size: 20px; color: var(--ec-muted); }
.ec-faq details[open] summary::after { content: "\2212"; }
.ec-faq summary:hover { text-decoration: underline; text-underline-offset: 3px; }
.ec-faq details > div { padding: 0 0 12px; }
.ec-faq details > div p:last-child { margin-bottom: 0; }

.ec-note { margin-top: var(--ec-s4); padding-top: var(--ec-s2); border-top: 1px solid var(--ec-rule); font-size: 14px; color: var(--ec-muted); }
.ec-note p { margin: 0 0 4px; }

/* ---- Code cards: a readout + what it means ---- */
.ec-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 24px; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ec-rule); }
.ec-card { border-bottom: 1px solid var(--ec-rule); }
.ec-card__link { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; text-decoration: none; color: var(--ec-ink) !important; }
.ec-card__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ec-card__pair { font-weight: 700; font-size: 15px; }
.ec-card__meaning { font-size: 15px; color: var(--ec-muted); line-height: 1.45; }
.ec-card__link:hover .ec-card__pair, .ec-card__link:hover .ec-card__meaning { text-decoration: underline; text-underline-offset: 2px; }
.ec-card__link:hover .ec-display { box-shadow: inset 0 0 0 1px #000, 0 0 0 2px var(--ec-paper), 0 0 0 3px var(--ec-ink); }

/* ---- Ruled index lists (appliances, brands, hubs) ---- */
.ec-index { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--ec-ink); }
.ec-index li { border-bottom: 1px solid var(--ec-rule); }
.ec-index a { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; padding: 8px 0; text-decoration: none; color: var(--ec-ink) !important; font-weight: 600; }
.ec-index a:hover > span:first-child, .ec-index a:hover { text-decoration: underline; text-underline-offset: 3px; }
.ec-index__n { font-weight: 400; font-size: 14px; color: var(--ec-muted); }
.ec-index--cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); column-gap: 24px; }

/* ---- Home ---- */
.ec-hero { padding: var(--ec-s2) 0 var(--ec-s3); max-width: 720px; }
.ec-hero h1 { font-size: clamp(2rem, 1.4rem + 2.2vw, 2.8rem); line-height: 1.1; font-weight: 850; margin: 0; letter-spacing: -0.025em; }
.ec-hero .ec-search { margin: var(--ec-s3) 0 var(--ec-s2); }
.ec-chips-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.ec-chips-label { font-size: 15px; color: var(--ec-muted); }
.ec-chips { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0; padding: 0; list-style: none; }
.ec-chips a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; text-decoration: none; color: var(--ec-ink) !important; font-size: 15px; }
.ec-chips .ec-display--sm { font-size: 15px; min-width: 0; padding: 7px 9px; }
.ec-chips a:hover span:not(.ec-display) { text-decoration: underline; text-underline-offset: 2px; }

.ec-front-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: var(--ec-s4); align-items: start; margin-top: var(--ec-s3); }
.ec-front-grid .ec-section { margin-top: 0; }
.ec-front-popular .ec-cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.ec-front-index section + section { margin-top: var(--ec-s3); }
@media (max-width: 900px) { .ec-front-grid { grid-template-columns: 1fr; } }

/* ---- Ads: reserved space so the page does not jump (R-40) ---- */
.ec-ad { margin: var(--ec-s3) 0; min-height: 280px; text-align: center; }

/* ---- Footer links ---- */
.ec-footer { background: var(--ec-surface); border-top: 1px solid var(--ec-rule); padding: var(--ec-s3) 0 var(--ec-s1); }
.ec-footer__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--ec-s2) var(--ec-s3); }
.ec-footer h2 { font-size: 15px; font-weight: 700; margin: 0 0 4px; }
.ec-footer ul { list-style: none; margin: 0; padding: 0; }
.ec-footer a { display: inline-flex; align-items: center; min-height: 40px; color: var(--ec-ink) !important; font-size: 15px; }

.ec .nav-links { margin-top: var(--ec-s3); }
.ec .nav-links .page-numbers { display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }

@media (max-width: 600px) {
	body.ec { font-size: 16px; }
	.ec-main { padding-top: var(--ec-s2) !important; }
	.ec-display--lg { font-size: 26px; padding: 12px 14px; }
	.ec-search--lg .ec-search__input { font-size: 17px; padding: 12px; }
	.ec-search--lg .ec-search__btn { padding: 12px 16px; font-size: 16px; }
	.ec-facts > div { grid-template-columns: 1fr; gap: 0; }
	.ec-steps > li { grid-template-columns: 2rem 1fr; gap: 8px; }
	/* causes table: stacked rows */
	.ec-table thead { display: none; }
	.ec-table, .ec-table tbody, .ec-table tr, .ec-table td { display: block; width: 100%; }
	.ec-table tbody { border-top: 1.5px solid var(--ec-ink); }
	.ec-table tr { padding: 10px 0; border-bottom: 1px solid var(--ec-rule); }
	.ec-table td { border: 0; padding: 2px 0; }
	.ec-table td::before { content: attr(data-label) ": "; font-weight: 700; font-size: 14px; }
	.ec-table td:first-child::before { content: none; }
}

@media (prefers-reduced-motion: reduce) {
	.ec * { transition: none !important; }
}
