/*
 * Solar4life CRM – "My Solar4life" customer dashboard (module 90, §ZM).
 * Mobile-first. Brand tokens: deep green, sage, cream, light green; the
 * accent comes from Settings (proposal accent). No external fonts or CDNs.
 */
:root {
	--s4lmy-deep: #173c30;
	--s4lmy-deep-2: #245244;
	--s4lmy-sage: #3f5546;
	--s4lmy-cream: #fafaf0;
	--s4lmy-light: #e8f4e8;
	--s4lmy-accent: #25c19b;
	--s4lmy-ink: #1d2a24;
	--s4lmy-muted: #5c6b63;
	--s4lmy-line: #dfe6dc;
	--s4lmy-card: #ffffff;
	--s4lmy-ok: #1f7a4d;
	--s4lmy-warn: #9a6400;
	--s4lmy-danger: #a3322a;
	--s4lmy-info: #2f6f8f;
	--s4lmy-radius: 14px;
	--s4lmy-gap: 16px;
	--s4lmy-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body.s4lmy-body {
	margin: 0;
	background: var(--s4lmy-cream);
	color: var(--s4lmy-ink);
	font: 16px/1.5 var(--s4lmy-font);
}
a { color: var(--s4lmy-deep-2); }
img { max-width: 100%; height: auto; }

.s4lmy-shell { max-width: 720px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.s4lmy-top {
	position: sticky; top: 0; z-index: 5;
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	padding: 12px var(--s4lmy-gap); padding-top: max(12px, env(safe-area-inset-top));
	background: var(--s4lmy-deep); color: #fff;
}
.s4lmy-brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.s4lmy-logo { max-height: 32px; width: auto; background: #fff; border-radius: 6px; padding: 2px 6px; }
.s4lmy-brandname { font-weight: 700; font-size: 18px; letter-spacing: .2px; }
.s4lmy-top-actions { display: flex; align-items: center; gap: 10px; min-width: 0; }
.s4lmy-top .s4lmy-link { color: #fff; }
.s4lmy-switch select { max-width: 46vw; font: inherit; font-size: 14px; padding: 6px 8px; border-radius: 8px; border: 0; }

.s4lmy-main { flex: 1; padding: var(--s4lmy-gap); padding-bottom: 96px; outline: none; }
.s4lmy-login { padding-bottom: var(--s4lmy-gap); }
.s4lmy-h1 { font-size: 26px; line-height: 1.2; margin: 8px 0 4px; color: var(--s4lmy-deep); }
.s4lmy-h2 { font-size: 18px; margin: 0 0 12px; color: var(--s4lmy-deep); }
.s4lmy-h3 { font-size: 16px; margin: 0 0 4px; }
.s4lmy-muted { color: var(--s4lmy-muted); }
.s4lmy-small { font-size: 14px; }
.s4lmy-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.s4lmy-card {
	background: var(--s4lmy-card); border: 1px solid var(--s4lmy-line); border-radius: var(--s4lmy-radius);
	padding: var(--s4lmy-gap); margin: 0 0 var(--s4lmy-gap); box-shadow: 0 1px 2px rgba(23, 60, 48, .06);
}
.s4lmy-card.is-next { background: var(--s4lmy-light); border-color: #cfe5cf; }
.s4lmy-note { background: var(--s4lmy-light); border-left: 4px solid var(--s4lmy-deep-2); padding: 10px 12px; border-radius: 8px; }
.s4lmy-empty { color: var(--s4lmy-muted); margin: 4px 0; }
.s4lmy-loading { color: var(--s4lmy-muted); }

/* Forms */
.s4lmy-form { display: flex; flex-direction: column; gap: 8px; }
.s4lmy-label { font-weight: 600; font-size: 15px; margin-top: 6px; display: block; }
.s4lmy-input {
	width: 100%; font: inherit; font-size: 17px; padding: 12px 14px; border: 1px solid #b9c7bd; border-radius: 10px;
	background: #fff; color: var(--s4lmy-ink); min-height: 48px;
}
.s4lmy-input:focus, .s4lmy-btn:focus-visible, .s4lmy-link:focus-visible, .s4lmy-nav a:focus-visible, select:focus {
	outline: 3px solid var(--s4lmy-accent); outline-offset: 2px;
}
.s4lmy-code-input { font-size: 28px; letter-spacing: 10px; text-align: center; font-variant-numeric: tabular-nums; }
.s4lmy-check { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; }
.s4lmy-check input { width: 22px; height: 22px; margin-top: 2px; }
.s4lmy-status { min-height: 1.4em; margin: 6px 0 0; font-size: 15px; }
.s4lmy-status.is-error { color: var(--s4lmy-danger); }
.s4lmy-status.is-ok { color: var(--s4lmy-ok); }
.s4lmy-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.s4lmy-row .s4lmy-input { flex: 1; }

.s4lmy-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	min-height: 44px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--s4lmy-deep-2);
	background: #fff; color: var(--s4lmy-deep); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.s4lmy-btn.is-primary { background: var(--s4lmy-deep); color: #fff; border-color: var(--s4lmy-deep); }
.s4lmy-btn.is-danger { border-color: var(--s4lmy-danger); color: var(--s4lmy-danger); }
.s4lmy-btn.is-wide { width: 100%; }
.s4lmy-btn[disabled], .s4lmy-btn.is-busy { opacity: .6; cursor: default; }
.s4lmy-link { background: none; border: 0; padding: 6px 2px; font: inherit; color: var(--s4lmy-deep-2); text-decoration: underline; cursor: pointer; min-height: 32px; }
.s4lmy-file { position: relative; overflow: hidden; }
.s4lmy-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }

/* Tracker */
.s4lmy-progress { height: 10px; background: var(--s4lmy-light); border-radius: 99px; overflow: hidden; margin: 4px 0 16px; }
.s4lmy-progress span { display: block; height: 100%; background: var(--s4lmy-accent); border-radius: 99px; }
.s4lmy-steps { list-style: none; margin: 0; padding: 0; }
.s4lmy-step { display: flex; gap: 12px; position: relative; padding: 0 0 14px; }
.s4lmy-step::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--s4lmy-line); }
.s4lmy-step:last-child::before { display: none; }
.s4lmy-step.is-done::before { background: var(--s4lmy-accent); }
.s4lmy-dot {
	flex: 0 0 28px; height: 28px; border-radius: 50%; border: 2px solid #b9c7bd; background: #fff;
	display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; color: #fff; position: relative; z-index: 1;
}
.s4lmy-step.is-done .s4lmy-dot { background: var(--s4lmy-accent); border-color: var(--s4lmy-accent); }
.s4lmy-step.is-current .s4lmy-dot { border-color: var(--s4lmy-deep); box-shadow: 0 0 0 4px var(--s4lmy-light); }
.s4lmy-step.is-current strong { color: var(--s4lmy-deep); }
.s4lmy-step-text { display: flex; flex-direction: column; padding-top: 3px; }
.s4lmy-step-text small { color: var(--s4lmy-muted); }
.s4lmy-step:not(.is-done):not(.is-current) .s4lmy-step-text { color: var(--s4lmy-muted); }

/* Items, lists */
.s4lmy-item { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--s4lmy-line); }
.s4lmy-item:first-of-type { border-top: 0; padding-top: 0; }
.s4lmy-item-main { flex: 1 1 200px; min-width: 0; }
.s4lmy-item-side { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.s4lmy-item p { margin: 2px 0; }
.s4lmy-price { font-size: 20px; font-weight: 700; color: var(--s4lmy-deep); margin: 4px 0; }
.s4lmy-price small { font-size: 13px; font-weight: 400; color: var(--s4lmy-muted); }
.s4lmy-pill { display: inline-block; font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: var(--s4lmy-light); color: var(--s4lmy-deep); }
.s4lmy-pill.is-ok { background: #dff3e7; color: var(--s4lmy-ok); }
.s4lmy-pill.is-warn { background: #fff1d6; color: var(--s4lmy-warn); }
.s4lmy-pill.is-danger { background: #fbe3e1; color: var(--s4lmy-danger); }
.s4lmy-pill.is-info { background: #e2eef4; color: var(--s4lmy-info); }
.s4lmy-list, .s4lmy-docs, .s4lmy-files { list-style: none; margin: 0 0 8px; padding: 0; }
.s4lmy-list li, .s4lmy-docs li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--s4lmy-line); }
.s4lmy-list li:first-child, .s4lmy-docs li:first-child { border-top: 0; }
.s4lmy-list li > span:first-child, .s4lmy-docs li > span:first-child { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.s4lmy-list small, .s4lmy-docs small { color: var(--s4lmy-muted); font-size: 13px; }
.s4lmy-files li { font-size: 14px; color: var(--s4lmy-muted); overflow-wrap: anywhere; }
.s4lmy-links a { margin-left: 8px; font-size: 14px; }

/* Photo slots */
.s4lmy-slot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--s4lmy-line); }
.s4lmy-slot > div { min-width: 0; }
.s4lmy-slot p { margin: 0; font-size: 14px; }

/* Messages */
.s4lmy-thread { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 55vh; overflow-y: auto; }
.s4lmy-msg { max-width: 85%; padding: 10px 12px; border-radius: 14px; }
.s4lmy-msg p { margin: 0; overflow-wrap: anywhere; }
.s4lmy-msg small { display: block; margin-top: 4px; font-size: 12px; opacity: .8; }
.s4lmy-msg.is-me { align-self: flex-end; background: var(--s4lmy-deep); color: #fff; border-bottom-right-radius: 4px; }
.s4lmy-msg.is-us { align-self: flex-start; background: var(--s4lmy-light); border-bottom-left-radius: 4px; }
.s4lmy-change { width: 100%; margin-top: 8px; }

/* More menu */
.s4lmy-menu { padding: 0; }
.s4lmy-menu a { display: flex; flex-direction: column; padding: 14px var(--s4lmy-gap); border-top: 1px solid var(--s4lmy-line); text-decoration: none; color: var(--s4lmy-ink); }
.s4lmy-menu a:first-child { border-top: 0; }
.s4lmy-menu small { color: var(--s4lmy-muted); }

/* Bottom navigation */
.s4lmy-nav {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
	display: flex; justify-content: space-around; background: #fff; border-top: 1px solid var(--s4lmy-line);
	padding: 6px 4px; padding-bottom: max(6px, env(safe-area-inset-bottom));
}
.s4lmy-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; text-decoration: none; color: var(--s4lmy-muted); padding: 4px 0; min-height: 48px; border-radius: 10px; }
.s4lmy-nav a.is-active { color: var(--s4lmy-deep); font-weight: 700; background: var(--s4lmy-light); }
.s4lmy-ico { font-size: 20px; line-height: 1; }

/* Banner, dialog, ribbon, footer */
.s4lmy-banner { position: sticky; top: 56px; z-index: 4; margin: 8px var(--s4lmy-gap) 0; padding: 10px 14px; border-radius: 10px; background: #dff3e7; color: var(--s4lmy-ok); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.s4lmy-banner.is-error { background: #fbe3e1; color: var(--s4lmy-danger); }
.s4lmy-banner.is-warn { background: #fff1d6; color: var(--s4lmy-warn); }
.s4lmy-dialog { position: fixed; inset: 0; z-index: 10; background: rgba(15, 30, 24, .55); display: flex; align-items: flex-end; justify-content: center; }
.s4lmy-dialog[hidden] { display: none; }
.s4lmy-dialog-box { background: #fff; width: 100%; max-width: 480px; border-radius: 18px 18px 0 0; padding: 20px var(--s4lmy-gap) max(20px, env(safe-area-inset-bottom)); max-height: 90vh; overflow-y: auto; }
.s4lmy-ribbon { background: #fff1d6; color: #5a3b00; padding: 8px var(--s4lmy-gap); font-size: 14px; text-align: center; }
.s4lmy-foot { text-align: center; color: var(--s4lmy-muted); font-size: 14px; padding: 12px var(--s4lmy-gap) 88px; }
body.is-login .s4lmy-foot, body.is-message .s4lmy-foot { padding-bottom: 24px; }
.s4lcrm-code { font: 600 11px/1 ui-monospace, Menlo, Consolas, monospace; background: #fff1d6; color: #5a3b00; border-radius: 4px; padding: 2px 4px; vertical-align: middle; }

@media (min-width: 640px) {
	.s4lmy-dialog { align-items: center; }
	.s4lmy-dialog-box { border-radius: 18px; }
	.s4lmy-h1 { font-size: 30px; }
}
@media (prefers-reduced-motion: no-preference) {
	.s4lmy-progress span { transition: width .4s ease; }
}
