/* ----------------------------------------------------------------
	Coolant Copilot -- product-specific styles
	Loaded after avalon-theme.css (shared brand, layout and components).
-----------------------------------------------------------------*/

/* ---------- SVG illustration primitives (hero + architecture) ---------- */
.svg-label { font-family: var(--cc-mono); font-size: 11px; fill: #A1A1AA; letter-spacing: 0.04em; }
.svg-label-strong { font-family: var(--cc-font); font-size: 13px; font-weight: 700; fill: #FFFFFF; }
.svg-label-sm { font-family: var(--cc-mono); font-size: 9.5px; fill: #8A8A93; letter-spacing: 0.06em; }
.svg-panel { fill: #18181B; stroke: rgba(255,255,255, 0.28); stroke-width: 1.2; }
.svg-panel-2 { fill: #111113; stroke: rgba(255,255,255, 0.2); stroke-width: 1; }
.svg-pipe { fill: none; stroke: #2E2E33; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.svg-flow {
	fill: none;
	stroke: var(--cc-cyan);
	stroke-width: 2.5;
	stroke-linecap: round;
	stroke-dasharray: 6 12;
	opacity: 0;
	transition: opacity 0.4s ease;
}
.svg-flow.is-active { opacity: 1; animation: cc-flow 0.9s linear infinite; }
.svg-flow.is-static { opacity: 0.9; }
.svg-valve { fill: #111113; stroke: #46464E; stroke-width: 1.5; transition: fill 0.3s ease, stroke 0.3s ease; }
.svg-valve.is-open { fill: var(--cc-blue); stroke: var(--cc-cyan); }
.svg-level { transition: height 1.2s ease, y 1.2s ease; }
.svg-cnc .svg-cnc-body { fill: #18181B; stroke: rgba(255,255,255, 0.25); stroke-width: 1.2; transition: stroke 0.3s ease; }
.svg-cnc.is-active .svg-cnc-body { stroke: var(--cc-cyan); }
.svg-stack-seg { opacity: 0.18; transition: opacity 0.3s ease; }
.svg-stack-seg.is-on { opacity: 1; }

@keyframes cc-flow { to { stroke-dashoffset: -36; } }

/* ---------- Architecture diagram ---------- */
.cc-arch {
	margin-top: 64px;
	padding: 24px;
	border-radius: 20px;
	border: 1px solid var(--cc-line-dark);
	background: linear-gradient(180deg, rgba(20,20,20, 0.6), rgba(10,10,10, 0.4));
}
.cc-arch-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cc-arch-head h3 { font-size: 1.125rem; color: var(--cc-white); margin: 0; }
.cc-arch-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cc-arch-scroll svg { display: block; min-width: 760px; width: 100%; height: auto; }
.cc-arch-note { font-size: 0.8125rem; margin: 12px 0 0; color: var(--cc-text-dark-muted); }

/* ---------- How it works ---------- */
.cc-hiw { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; align-items: start; }
@media (max-width: 991.98px) { .cc-hiw { grid-template-columns: 1fr; } }

.cc-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.cc-step-btn {
	width: 100%;
	display: grid;
	grid-template-columns: 44px 1fr;
	gap: 14px;
	text-align: left;
	padding: 16px 18px;
	border-radius: 12px;
	border: 1px solid var(--cc-line-dark);
	background: rgba(255, 255, 255, 0.02);
	color: var(--cc-text-dark-muted);
	cursor: pointer;
	transition: border-color 0.25s ease, background-color 0.25s ease;
	position: relative;
	overflow: hidden;
}
.cc-step-btn:hover { border-color: rgba(255,255,255, 0.4); }
.cc-step-btn[aria-selected="true"] { border-color: var(--cc-accent); background: rgba(195, 39, 44, 0.1); }
.cc-step-num {
	width: 44px;
	height: 44px;
	border-radius: 10px;
	display: grid;
	place-items: center;
	font-family: var(--cc-mono);
	font-weight: 700;
	color: var(--cc-accent-text);
	background: rgba(255,255,255, 0.08);
	border: 1px solid var(--cc-line-dark);
}
.cc-step-btn[aria-selected="true"] .cc-step-num { background: var(--cc-accent); color: var(--cc-white); border-color: var(--cc-accent); }
.cc-step-title { display: block; font-weight: 700; color: var(--cc-white); font-size: 1.0625rem; margin-bottom: 2px; }
.cc-step-text { display: block; font-size: 0.9375rem; line-height: 1.5; }
.cc-step-progress {
	position: absolute;
	left: 0;
	bottom: 0;
	height: 2px;
	width: 0;
	background: var(--cc-accent-text);
}
.cc-steps.is-autoplay .cc-step-btn[aria-selected="true"] .cc-step-progress { animation: cc-progress var(--cc-step-ms, 4200ms) linear forwards; }
@keyframes cc-progress { to { width: 100%; } }

.cc-hiw-panel {
	border-radius: 20px;
	border: 1px solid var(--cc-line-dark);
	background: linear-gradient(180deg, rgba(28,28,30, 0.6), rgba(10,10,10, 0.6));
	padding: 24px;
	position: sticky;
	top: calc(var(--cc-header-h) + 24px);
}
.cc-hiw-panel svg { width: 100%; height: auto; display: block; }
.cc-hiw-status {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 16px;
	padding: 12px 14px;
	border-radius: 10px;
	background: rgba(10,10,10, 0.7);
	border: 1px solid var(--cc-line-dark);
	font-family: var(--cc-mono);
	font-size: 0.8125rem;
	color: #D4D4D8;
	min-height: 48px;
}
.cc-hiw-status .cc-dot { flex-shrink: 0; }

/* step-driven states for the How It Works diagram */
.hiw-sump-fill { transition: y 1.1s ease, height 1.1s ease, cy 1.1s ease; }
[data-step="4"] .hiw-sump-fill { transition-duration: 3.2s; }
.hiw-flow, .hiw-mix-flow { opacity: 0; }
.hiw-valve { fill: #111113; stroke: #46464E; transition: fill 0.3s ease; }
.hiw-scan { opacity: 0; }
.hiw-alert { opacity: 0; transition: opacity 0.3s ease; }
.hiw-check { opacity: 0; transition: opacity 0.3s ease; }
.hiw-queue { opacity: 0.35; transition: opacity 0.3s ease; }

[data-step="1"] .hiw-scan { opacity: 1; animation: cc-scan 2s ease-in-out infinite; }
[data-step="2"] .hiw-alert { opacity: 1; }
[data-step="2"] .hiw-queue { opacity: 1; }
[data-step="3"] .hiw-mix-flow { opacity: 1; animation: cc-flow 0.9s linear infinite; }
[data-step="4"] .hiw-mix-flow,
[data-step="4"] .hiw-flow { opacity: 1; animation: cc-flow 0.9s linear infinite; }
[data-step="4"] .hiw-valve { fill: var(--cc-blue); stroke: var(--cc-cyan); }
[data-step="5"] .hiw-check { opacity: 1; }
@keyframes cc-scan { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---------- Lights-out timeline ---------- */
.cc-night {
	background:
		radial-gradient(800px 500px at 100% 0%, rgba(195, 39, 44, 0.05), transparent 70%),
		var(--cc-bg);
}
.cc-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.cc-timeline::before {
	content: "";
	position: absolute;
	left: 95px; /* time column 72px + 12px gap + half of the 24px dot column - 1px */
	top: 6px;
	bottom: 6px;
	width: 2px;
	background: linear-gradient(180deg, var(--cc-accent), rgba(255,255,255, 0.1));
}
.cc-timeline li { display: grid; grid-template-columns: 72px 24px 1fr; gap: 12px; align-items: start; padding-bottom: 22px; }
.cc-timeline time { white-space: nowrap; font-family: var(--cc-mono); font-size: 0.8125rem; color: var(--cc-accent-text); padding-top: 2px; text-align: right; }
.cc-timeline .cc-tl-dot {
	width: 14px;
	height: 14px;
	margin: 4px auto 0;
	border-radius: 50%;
	background: var(--cc-bg);
	border: 2px solid var(--cc-accent);
	position: relative;
	z-index: 1;
}
.cc-timeline .cc-tl-dot.is-fill { background: var(--cc-blue); }
.cc-timeline .cc-tl-dot.is-warn { border-color: var(--cc-amber); background: var(--cc-amber); }
.cc-timeline strong { color: var(--cc-white); display: block; font-size: 0.9375rem; }
.cc-timeline span { font-size: 0.875rem; line-height: 1.5; }
.cc-family {
	margin-top: 32px;
	padding: 24px;
	border-radius: var(--cc-radius);
	border: 1px solid var(--cc-line-dark);
	background: rgba(255, 255, 255, 0.03);
}
.cc-family-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.cc-family-item {
	padding: 14px;
	border-radius: 10px;
	background: rgba(10,10,10, 0.6);
	border: 1px solid var(--cc-line-dark);
	font-size: 0.875rem;
	line-height: 1.45;
}
.cc-family-item strong { display: block; color: var(--cc-white); margin-bottom: 4px; font-size: 0.9375rem; }
.cc-family-item.is-current { border-color: var(--cc-accent); background: rgba(195, 39, 44, 0.12); }
.cc-family-item a { color: var(--cc-accent-text); }
@media (max-width: 575.98px) { .cc-family-row { grid-template-columns: 1fr; } }

/* ---------- Dashboard mockup ---------- */
.cc-dash-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.cc-dash-tab {
	padding: 9px 16px;
	border-radius: 999px;
	border: 1px solid var(--cc-line-light);
	background: var(--cc-white);
	color: var(--cc-text-light-muted);
	font-weight: 600;
	font-size: 0.875rem;
	cursor: pointer;
	transition: all 0.2s ease;
}
.cc-dash-tab:hover { border-color: var(--cc-accent); color: var(--cc-ink); }
.cc-dash-tab[aria-selected="true"] { background: var(--cc-navy); border-color: var(--cc-navy); color: var(--cc-white); }

.cc-browser {
	border-radius: 14px;
	overflow: hidden;
	background: #0B0B0C;
	border: 1px solid #2A2A2E;
	box-shadow: 0 30px 80px rgba(10,10,10, 0.28);
	color: #D4D4D8;
	font-size: 0.8125rem;
}
.cc-browser-bar {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	background: #161618;
	border-bottom: 1px solid #2A2A2E;
}
.cc-browser-bar .cc-bdot { width: 10px; height: 10px; border-radius: 50%; background: #34343A; }
.cc-browser-url {
	margin-left: 10px;
	flex: 1;
	max-width: 360px;
	padding: 5px 12px;
	border-radius: 6px;
	background: #0B0B0C;
	font-family: var(--cc-mono);
	font-size: 0.6875rem;
	color: #8A8A93;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.cc-browser-body { padding: 18px; }
.cc-dash-top { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cc-dash-title { font-weight: 700; color: var(--cc-white); font-size: 0.9375rem; display: flex; align-items: center; gap: 8px; }
.cc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cc-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 10px;
	border-radius: 999px;
	font-family: var(--cc-mono);
	font-size: 0.6875rem;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.08);
	color: #D4D4D8;
	white-space: nowrap;
}
.cc-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--cc-green); }
.cc-dot.blue { background: var(--cc-blue); }
.cc-dot.amber { background: var(--cc-amber); }
.cc-dot.red { background: var(--cc-red); }
.cc-dot.gray { background: #52525B; }

.cc-dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 14px; }
@media (max-width: 991.98px) { .cc-dash-grid { grid-template-columns: minmax(0, 1fr); } }
.cc-dash-grid > * { min-width: 0; }
.cc-panel { background: #121214; border: 1px solid #27272A; border-radius: 10px; padding: 14px; }
.cc-panel-title {
	font-family: var(--cc-mono);
	font-size: 0.625rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #8A8A93;
	margin-bottom: 10px;
	display: flex;
	justify-content: space-between;
}

.cc-mtable { width: 100%; border-collapse: collapse; }
.cc-mtable th {
	font-family: var(--cc-mono);
	font-size: 0.625rem;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #8A8A93;
	text-align: left;
	padding: 0 8px 8px;
	border-bottom: 1px solid #27272A;
	white-space: nowrap;
}
.cc-mtable td { padding: 10px 8px; border-bottom: 1px solid rgba(39,39,42, 0.6); vertical-align: middle; white-space: nowrap; }
.cc-mtable tr:last-child td { border-bottom: 0; }
.cc-mtable .cc-mname { color: var(--cc-white); font-weight: 600; }
.cc-mtable .cc-mono { font-family: var(--cc-mono); }
.cc-table-scroll { overflow-x: auto; }

.cc-levelbar {
	position: relative;
	width: 120px;
	height: 8px;
	border-radius: 999px;
	background: #0B0B0C;
	border: 1px solid #27272A;
}
.cc-levelbar > span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: linear-gradient(90deg, var(--cc-blue), var(--cc-cyan)); }
.cc-levelbar > i { position: absolute; top: -4px; bottom: -4px; width: 2px; background: #8A8A93; border-radius: 1px; }
.cc-levelbar > i.hi { background: var(--cc-green); }
.cc-levelbar > i.lo { background: var(--cc-amber); }
.cc-levelbar.is-filling > span { animation: cc-fillpulse 1.6s ease-in-out infinite; }
@keyframes cc-fillpulse { 50% { filter: brightness(1.35); } }

.cc-state { display: inline-flex; align-items: center; gap: 6px; font-family: var(--cc-mono); font-size: 0.6875rem; }
.cc-alert {
	display: flex;
	gap: 10px;
	padding: 10px;
	border-radius: 8px;
	background: rgba(245, 165, 36, 0.08);
	border: 1px solid rgba(245, 165, 36, 0.3);
	margin-bottom: 8px;
	line-height: 1.45;
}
.cc-alert i { color: var(--cc-amber); }
.cc-alert.info { background: rgba(59, 159, 232, 0.08); border-color: rgba(59, 159, 232, 0.3); }
.cc-alert.info i { color: var(--cc-blue); }
.cc-alert strong { color: var(--cc-white); display: block; font-size: 0.8125rem; }
.cc-alert small { color: #8A8A93; font-size: 0.6875rem; }
.cc-supply { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.cc-supply-item { background: #0B0B0C; border: 1px solid #27272A; border-radius: 8px; padding: 10px; }
.cc-supply-item b { display: block; color: var(--cc-white); font-size: 0.75rem; margin-bottom: 4px; }
.cc-fake-field {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 8px 10px;
	border-radius: 6px;
	background: #0B0B0C;
	border: 1px solid #27272A;
	margin-bottom: 8px;
	font-size: 0.75rem;
}
.cc-fake-field b { color: var(--cc-white); font-family: var(--cc-mono); font-weight: 500; }
.cc-fake-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cc-fake-btn {
	display: grid;
	place-items: center;
	padding: 8px;
	border-radius: 6px;
	font-weight: 700;
	font-size: 0.75rem;
	background: var(--cc-blue);
	color: var(--cc-white);
}
.cc-fake-btn.stop { background: var(--cc-red); }

.cc-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 767.98px) { .cc-settings-grid { grid-template-columns: 1fr; } }
.cc-setting { padding: 12px; border-radius: 8px; background: #0B0B0C; border: 1px solid #27272A; }
.cc-setting label, .cc-setting .cc-setting-label { display: block; font-size: 0.6875rem; color: #8A8A93; font-family: var(--cc-mono); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 6px; }
.cc-setting .cc-setting-value { font-family: var(--cc-mono); font-size: 1rem; color: var(--cc-white); }
.cc-setting .cc-setting-help { font-size: 0.6875rem; color: #8A8A93; margin-top: 4px; display: block; }
.cc-range { position: relative; height: 6px; border-radius: 999px; background: #27272A; margin-top: 10px; }
.cc-range > span { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: var(--cc-blue); }
.cc-toggle { display: inline-flex; align-items: center; gap: 8px; color: var(--cc-white); font-size: 0.8125rem; }
.cc-toggle::before {
	content: "";
	width: 32px;
	height: 18px;
	border-radius: 999px;
	background: var(--cc-green) radial-gradient(circle at 23px 9px, #fff 6px, transparent 6.5px);
}

.cc-dash-note { font-size: 0.8125rem; color: var(--cc-text-light-muted); margin-top: 14px; }
.cc-dash-pane[hidden] { display: none; }

/* ---------- Shop floor / stack light ---------- */
.cc-stack {
	display: flex;
	gap: 28px;
	align-items: center;
	padding: 28px;
	border-radius: var(--cc-radius);
	border: 1px solid var(--cc-line-dark);
	background: rgba(255, 255, 255, 0.03);
}
.cc-stack-light {
	display: flex;
	flex-direction: column;
	align-items: center;
	flex-shrink: 0;
}
.cc-stack-seg {
	width: 46px;
	height: 34px;
	border-radius: 6px;
	margin-bottom: 3px;
	opacity: 0.18;
	transition: opacity 0.35s ease, box-shadow 0.35s ease;
}
.cc-stack-seg.red { background: var(--cc-red); }
.cc-stack-seg.amber { background: var(--cc-amber); }
.cc-stack-seg.blue { background: var(--cc-blue); }
.cc-stack-seg.green { background: var(--cc-green); }
.cc-stack-seg.is-on { opacity: 1; }
.cc-stack-seg.amber.is-on, .cc-stack-seg.red.is-on { animation: cc-flash 1s steps(1, end) infinite; }
@keyframes cc-flash { 50% { opacity: 0.35; } }
.cc-stack-seg.red.is-on { box-shadow: 0 0 26px rgba(239, 68, 68, 0.6); }
.cc-stack-seg.amber.is-on { box-shadow: 0 0 26px rgba(245, 165, 36, 0.6); }
.cc-stack-seg.blue.is-on { box-shadow: 0 0 26px rgba(59, 159, 232, 0.7); }
.cc-stack-seg.green.is-on { box-shadow: 0 0 26px rgba(34, 197, 94, 0.6); }
.cc-stack-pole { width: 10px; height: 34px; background: #34343A; border-radius: 0 0 3px 3px; }
.cc-stack-base { width: 54px; height: 8px; background: #34343A; border-radius: 3px; }
.cc-stack-legend { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; flex: 1; }
.cc-stack-legend li {
	display: grid;
	grid-template-columns: 14px 1fr;
	gap: 12px;
	align-items: start;
	padding: 8px 10px;
	border-radius: 8px;
	transition: background-color 0.3s ease;
	font-size: 0.9375rem;
	line-height: 1.45;
}
.cc-stack-legend li.is-on { background: rgba(255,255,255, 0.07); }
.cc-stack-legend .cc-dot { margin-top: 6px; width: 12px; height: 12px; }
.cc-stack-legend strong { color: var(--cc-white); }
@media (max-width: 575.98px) { .cc-stack { flex-direction: column; align-items: stretch; } .cc-stack-light { align-self: center; } }

.cc-family a { color: var(--cc-accent-text); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
	.svg-flow.is-active, [data-step] .hiw-flow, [data-step] .hiw-mix-flow { stroke-dasharray: none; }
}
