/* ZEN Workshop OS — frontend. Scoped to .zen-app. Carbon / silver / teal. */
.zen-app {
	--zen-accent: #14B8B0;
	--zen-bg: #0c0e0f;
	--zen-card: #141819;
	--zen-card-2: #1a1f21;
	--zen-line: #262d30;
	--zen-text: #e9edee;
	--zen-muted: #8e999d;
	--zen-silver: #c9d1d4;
	--zen-red: #ef4444;
	--zen-amber: #f59e0b;
	--zen-green: #22c55e;
	--zen-radius: 10px;
	font-family: "Archivo", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--zen-text);
	background: var(--zen-bg);
	padding: clamp(16px, 3vw, 32px);
	border-radius: 14px;
	line-height: 1.5;
	font-size: 15px;
	max-width: 1100px;
	margin: 0 auto;
	box-sizing: border-box;
	container: zen / inline-size;
	width: 100%;
	align-self: stretch;
}
.zen-app *, .zen-app *::before, .zen-app *::after { box-sizing: border-box; }
.zen-app h2, .zen-app h3 { color: var(--zen-text); margin: 0 0 12px; line-height: 1.2; letter-spacing: -.01em; }
.zen-app h2 { font-size: clamp(24px, 3.4vw, 34px); font-weight: 800; }
.zen-app h3 { font-size: 19px; font-weight: 700; }
.zen-app p { margin: 0 0 12px; }
.zen-app a { color: var(--zen-accent); }
.zen-app a.zen-btn, .zen-app a.zen-btn:hover { color: #031312; }
.zen-app a.zen-btn-ghost, .zen-app a.zen-btn-ghost:hover { color: var(--zen-text); }
.zen-app hr { border: 0; border-top: 1px solid var(--zen-line); margin: 20px 0; }
.zen-mono, .zen-kicker, .zen-label, .zen-pill, .zen-steps b, .zen-risk { font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }
.zen-kicker { color: var(--zen-accent); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 6px; }
.zen-label { display: block; color: var(--zen-silver); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; margin: 18px 0 8px; }
.zen-field .zen-label { margin-top: 0; }
.zen-muted { color: var(--zen-muted); }
.zen-small { font-size: 13px; }
.zen-r { text-align: right; }
.zen-hp, .zen-hidden { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.zen-loading { color: var(--zen-muted); padding: 24px 0; font-family: "IBM Plex Mono", monospace; font-size: 13px; }
.zen-head { margin-bottom: 18px; }

.zen-card { background: var(--zen-card); border: 1px solid var(--zen-line); border-radius: var(--zen-radius); padding: clamp(16px, 2.4vw, 26px); margin-bottom: 16px; }
.zen-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.zen-layout > *, .zen-card, .zen-grid-2 > *, .zen-grid-3 > * { min-width: 0; }
.zen-summary { position: sticky; top: 20px; background: var(--zen-card-2); border: 1px solid var(--zen-line); border-radius: var(--zen-radius); padding: 18px; font-size: 14px; }
.zen-summary dl { margin: 0; display: grid; gap: 4px; }
.zen-summary dt { color: var(--zen-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; margin-top: 8px; }
.zen-summary dd { margin: 0; }
.zen-diag-mini { margin-top: 14px; font-size: 13px; color: var(--zen-muted); }

.zen-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.zen-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.zen-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.zen-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* Buttons */
.zen-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--zen-accent); color: #031312; border: 1px solid var(--zen-accent); border-radius: 8px; padding: 11px 18px; font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; transition: filter .15s, transform .05s; min-height: 44px; }
.zen-btn:hover { filter: brightness(1.08); color: #031312; }
.zen-btn:active { transform: translateY(1px); }
.zen-btn:disabled { opacity: .45; cursor: not-allowed; }
.zen-btn-ghost { background: transparent; color: var(--zen-text); border-color: var(--zen-line); }
.zen-btn-ghost:hover { border-color: var(--zen-accent); color: var(--zen-text); }
.zen-btn-danger { color: var(--zen-red); }
.zen-btn-sm { min-height: 34px; padding: 6px 12px; font-size: 13px; margin-bottom: 12px; }
.zen-x { background: none; border: 0; color: var(--zen-muted); font-size: 20px; cursor: pointer; padding: 0 6px; }
.zen-x:hover { color: var(--zen-red); }

/* Inputs */
.zen-field { display: block; margin-bottom: 4px; }
.zen-input { width: 100%; background: #0f1213; border: 1px solid var(--zen-line); color: var(--zen-text); border-radius: 8px; padding: 11px 12px; font: inherit; font-size: 15px; min-height: 44px; }
.zen-input:focus { outline: none; border-color: var(--zen-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--zen-accent) 25%, transparent); }
textarea.zen-input { resize: vertical; min-height: 80px; }
.zen-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--zen-silver); margin-top: 14px; }
.zen-consent input { margin-top: 3px; accent-color: var(--zen-accent); width: 18px; height: 18px; flex: none; }
.zen-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.zen-inline input { accent-color: var(--zen-accent); }

/* Steps */
.zen-steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 18px; overflow-x: auto; }
.zen-steps li { flex: 1; min-width: 110px; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--zen-line); border-radius: 8px; color: var(--zen-muted); font-size: 13px; white-space: nowrap; }
.zen-steps li button { all: unset; display: flex; gap: 8px; align-items: center; cursor: pointer; }
.zen-steps b { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--zen-card-2); font-size: 11px; color: var(--zen-silver); }
.zen-steps .is-active { border-color: var(--zen-accent); color: var(--zen-text); }
.zen-steps .is-active b { background: var(--zen-accent); color: #031312; }
.zen-steps .is-done { color: var(--zen-silver); }
.zen-steps .is-done b { background: color-mix(in srgb, var(--zen-accent) 30%, transparent); color: var(--zen-text); }

/* Options */
.zen-option { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; background: #0f1213; color: var(--zen-text); border: 1px solid var(--zen-line); border-radius: 10px; padding: 14px 14px 14px 44px; cursor: pointer; font: inherit; min-height: 56px; transition: border-color .15s, background .15s; }
.zen-option:hover { border-color: #3a4448; }
.zen-option.is-selected { border-color: var(--zen-accent); background: color-mix(in srgb, var(--zen-accent) 9%, #0f1213); }
.zen-option-lg { padding: 18px 64px 18px 18px; min-height: 90px; }
.zen-option-lg .zen-pill { position: absolute; top: 14px; right: 14px; }
.zen-check { position: absolute; left: 14px; top: 16px; width: 18px; height: 18px; border: 1.5px solid #4a565b; border-radius: 5px; }
.zen-option.is-selected .zen-check { background: var(--zen-accent); border-color: var(--zen-accent); }
.zen-option.is-selected .zen-check::after { content: ""; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px; border: solid #031312; border-width: 0 2px 2px 0; transform: rotate(45deg); }

.zen-toggle, .zen-tabs { display: inline-flex; background: #0f1213; border: 1px solid var(--zen-line); border-radius: 10px; padding: 4px; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.zen-toggle button, .zen-tabs button { background: none; border: 0; color: var(--zen-muted); padding: 9px 18px; border-radius: 7px; font: inherit; font-weight: 600; cursor: pointer; min-height: 40px; }
.zen-toggle .is-selected, .zen-tabs .is-selected { background: var(--zen-accent); color: #031312; }
.zen-tabs .zen-inline { padding: 0 12px; color: var(--zen-silver); }

.zen-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.zen-booking .zen-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.zen-booking .zen-chip { justify-content: center; flex-direction: column; gap: 0; border-radius: 10px; padding: 8px 10px; }
.zen-chip { background: #0f1213; border: 1px solid var(--zen-line); color: var(--zen-text); border-radius: 999px; padding: 9px 15px; font: inherit; font-size: 14px; cursor: pointer; min-height: 40px; display: inline-flex; gap: 6px; align-items: center; }
.zen-chip small { color: var(--zen-amber); font-size: 11px; }
.zen-chip:hover:not(:disabled) { border-color: var(--zen-accent); }
.zen-chip.is-selected { background: var(--zen-accent); color: #031312; border-color: var(--zen-accent); }
.zen-chip.is-selected small { color: #031312; }
.zen-chip:disabled { opacity: .3; text-decoration: line-through; cursor: not-allowed; }

.zen-dates { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.zen-date { flex: none; scroll-snap-align: start; width: 64px; display: flex; flex-direction: column; align-items: center; gap: 0; background: #0f1213; border: 1px solid var(--zen-line); color: var(--zen-text); border-radius: 10px; padding: 8px 4px; cursor: pointer; font: inherit; }
.zen-date strong { font-size: 20px; line-height: 1.2; }
.zen-date small { color: var(--zen-muted); font-size: 11px; text-transform: uppercase; }
.zen-date.is-selected { background: var(--zen-accent); border-color: var(--zen-accent); color: #031312; }
.zen-date.is-selected small { color: #031312; }
.zen-date:disabled { opacity: .3; cursor: not-allowed; }

/* Alerts & pills */
.zen-alert { border-radius: 8px; padding: 12px 14px; margin: 0 0 14px; font-size: 14px; border: 1px solid; }
.zen-alert ul { margin: 6px 0 0 18px; padding: 0; }
.zen-alert-error { background: rgba(239, 68, 68, .1); border-color: rgba(239, 68, 68, .4); color: #fecaca; }
.zen-alert-success { background: rgba(34, 197, 94, .1); border-color: rgba(34, 197, 94, .4); color: #bbf7d0; }
.zen-alert-info { background: color-mix(in srgb, var(--zen-accent) 10%, transparent); border-color: color-mix(in srgb, var(--zen-accent) 45%, transparent); color: var(--zen-text); }
.zen-pill { display: inline-block; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--zen-line); color: var(--zen-silver); white-space: nowrap; }
.zen-pill-accent { border-color: var(--zen-accent); color: var(--zen-accent); }

.zen-risk { display: inline-block; font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 6px; text-transform: uppercase; letter-spacing: .08em; }
.zen-risk-sm { font-size: 10px; padding: 3px 8px; }
.zen-risk-low { background: rgba(34, 197, 94, .15); color: #86efac; }
.zen-risk-medium { background: rgba(245, 158, 11, .15); color: #fcd34d; }
.zen-risk-high { background: rgba(249, 115, 22, .18); color: #fdba74; }
.zen-risk-critical { background: rgba(239, 68, 68, .2); color: #fca5a5; }

/* Diagnosis */
.zen-qblock { border-top: 1px dashed var(--zen-line); margin-top: 18px; padding-top: 4px; }
.zen-q p { margin: 6px 0 8px; color: var(--zen-silver); }
.zen-q { margin-bottom: 12px; }
.zen-more { margin-top: 18px; }
.zen-more summary { cursor: pointer; color: var(--zen-silver); font-weight: 600; padding: 4px 0; }
.zen-more[open] summary { margin-bottom: 12px; }
.zen-result-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin: 6px 0 16px; }
.zen-result-head p { margin: 0; font-size: 16px; }
.zen-finding { background: #0f1213; border: 1px solid var(--zen-line); border-radius: 8px; padding: 14px; margin-bottom: 10px; }
.zen-finding ul { margin: 6px 0 0 18px; padding: 0; }
.zen-finding-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.zen-recommend { border-color: var(--zen-accent); }
.zen-disclaimer { font-size: 12px; color: var(--zen-muted); border-left: 2px solid var(--zen-accent); padding-left: 10px; margin-top: 16px; }

/* Status */
.zen-status-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.zen-progress { list-style: none; padding: 0; margin: 20px 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; counter-reset: s; }
.zen-progress li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; font-size: 12px; color: var(--zen-muted); padding: 0 4px; }
.zen-progress li::before { content: ""; position: absolute; top: 15px; left: -50%; width: 100%; height: 2px; background: var(--zen-line); z-index: 0; }
.zen-progress li:first-child::before { display: none; }
.zen-dot { position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--zen-card-2); border: 2px solid var(--zen-line); font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--zen-muted); }
.zen-progress .is-done { color: var(--zen-silver); }
.zen-progress .is-done::before, .zen-progress .is-active::before { background: var(--zen-accent); }
.zen-progress .is-done .zen-dot { background: var(--zen-accent); border-color: var(--zen-accent); color: #031312; }
.zen-progress .is-active { color: var(--zen-text); font-weight: 700; }
.zen-progress .is-active .zen-dot { border-color: var(--zen-accent); color: var(--zen-accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--zen-accent) 18%, transparent); }
.zen-progress .is-waiting .zen-dot { border-color: var(--zen-amber); color: var(--zen-amber); }
.zen-progress .is-waiting { color: var(--zen-amber); }

.zen-quote { border-color: var(--zen-amber); }
.zen-quote .zen-kicker { color: var(--zen-amber); }
.zen-qitems { display: grid; gap: 8px; margin: 14px 0; }
.zen-qitem { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; background: #0f1213; border: 1px solid var(--zen-line); border-radius: 8px; padding: 12px; cursor: pointer; }
.zen-qitem input { accent-color: var(--zen-accent); width: 18px; height: 18px; }
.zen-qtotal { text-align: right; margin-bottom: 12px; }

.zen-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 8px; }
.zen-table td { padding: 10px 6px; border-bottom: 1px solid var(--zen-line); vertical-align: top; color: var(--zen-text); }
.zen-table tfoot td { border-bottom: 0; font-weight: 700; padding-top: 8px; }
.zen-table .is-rejected td { color: var(--zen-muted); text-decoration: line-through; }

.zen-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 12px; }
.zen-photos a { display: block; position: relative; border-radius: 8px; overflow: hidden; border: 1px solid var(--zen-line); aspect-ratio: 4/3; background: #0f1213; text-decoration: none; }
.zen-photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.zen-photos span { position: absolute; left: 6px; bottom: 6px; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; background: rgba(0, 0, 0, .7); color: #fff; padding: 2px 6px; border-radius: 4px; }

/* Garage */
.zen-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.zen-stats > div { background: #0f1213; border: 1px solid var(--zen-line); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; }
.zen-stats small { color: var(--zen-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.zen-stats strong { font-size: 17px; }
.zen-stats .is-due { border-color: var(--zen-amber); }
.zen-stats .is-due strong { color: var(--zen-amber); }

/* Mechanic */
.zen-date-input { max-width: 220px; margin-bottom: 14px; color-scheme: dark; }
.zen-joblist { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.zen-jobcard { text-align: left; display: flex; flex-direction: column; gap: 4px; background: var(--zen-card); border: 1px solid var(--zen-line); border-left: 4px solid var(--zen-line); border-radius: 10px; padding: 14px; color: var(--zen-text); font: inherit; cursor: pointer; }
.zen-jobcard:hover { border-color: var(--zen-accent); }
.zen-jobcard-top { display: flex; justify-content: space-between; align-items: center; }
.zen-st-pending { border-left-color: var(--zen-amber); }
.zen-st-confirmed { border-left-color: #60a5fa; }
.zen-st-quoted { border-left-color: var(--zen-amber); }
.zen-st-in_progress, .zen-st-approved, .zen-st-checked_in, .zen-st-inspected { border-left-color: var(--zen-accent); }
.zen-st-ready, .zen-st-qc { border-left-color: var(--zen-green); }
.zen-st-completed, .zen-st-cancelled, .zen-st-no_show { opacity: .6; }
.zen-upload { cursor: pointer; }
.zen-part-results { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.zen-additem { border-top: 1px dashed var(--zen-line); margin-top: 14px; padding-top: 14px; }

/* Branches */
.zen-branches { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.zen-branch { background: var(--zen-card); border: 1px solid var(--zen-line); border-radius: var(--zen-radius); padding: 22px; }
.zen-branch-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.zen-hours { list-style: none; padding: 0; margin: 12px 0; font-size: 14px; }
.zen-hours li { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--zen-line); padding: 6px 0; }

@container zen (max-width: 820px) {
	.zen-layout { grid-template-columns: 1fr; }
	.zen-summary { position: static; order: 1; }
	.zen-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.zen-steps li { min-width: 0; padding: 8px; }
	.zen-steps li:not(.is-active) .zen-step-label { display: none; }
}
@container zen (max-width: 540px) {
	.zen-grid-2, .zen-grid-3 { grid-template-columns: 1fr; }
	.zen-progress { grid-template-columns: 1fr; gap: 10px; }
	.zen-progress li { flex-direction: row; text-align: left; }
	.zen-progress li::before { display: none; }
	.zen-actions .zen-btn { width: 100%; }
	.zen-stats { grid-template-columns: 1fr 1fr; }
	.zen-steps li { flex: none; }
}
@media (max-width: 560px) {
	.zen-app { padding: 14px; border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) { .zen-app * { transition: none !important; scroll-behavior: auto !important; } }
.zen-table .zen-mono, .zen-qitem .zen-mono { white-space: nowrap; }
