/* The phone version: the desktop app's look (light grey canvas, white cards,
   SolaX orange for actions, the Technoenergostroy red for the total), sized
   for thumbs: 44 px tap targets, 16 px text in boxes (no iOS zoom). */
:root {
  --bg: #F5F5F7; --card: #FFFFFF; --field: #F2F2F5; --border: #E5E5EA; --divider: #EDEDF0;
  --text: #1D1D1F; --text2: #6E6E73; --muted: #8E8E93;
  --accent: #F08321; --accent-hover: #E2740F; --accent-soft: #FFF3E6; --red: #B91B27;
  --pos: #1E8E5A; --pos-soft: #E7F6EE; --neg: #D93F3F; --neg-soft: #FDEDED; --warn: #B26B00; --warn-soft: #FFF5DF;
  --radius: 14px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding-bottom: calc(76px + var(--safe-bottom));
}
body.no-tabs { padding-bottom: 24px; }
a { color: var(--accent-hover); text-decoration: none; }
h1 { font-size: 28px; line-height: 1.15; margin: 4px 0 4px; letter-spacing: -0.02em; }
h2 { font-size: 19px; margin: 0 0 10px; letter-spacing: -0.01em; }
h3 { font-size: 13px; margin: 18px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 13px; }
.sub { color: var(--text2); font-size: 15px; }
.wrap { max-width: 640px; margin: 0 auto; padding: 0 16px; }

/* top bar */
.top { position: sticky; top: 0; z-index: 10; background: rgba(245,245,247,.88);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  padding: calc(10px + env(safe-area-inset-top, 0px)) 0 8px; border-bottom: 1px solid transparent; }
.top .wrap { display: flex; align-items: center; gap: 10px; min-height: 36px; }
.top .back { font-size: 17px; display: flex; align-items: center; gap: 2px; color: var(--accent-hover); }
.top .brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; color: var(--red); }
.top .brand img { height: 20px; width: auto; max-width: 60vw; }
.top .spacer { flex: 1; }
.page-head { padding: 8px 0 14px; }

/* cards & lists */
.card { background: var(--card); border-radius: var(--radius); padding: 16px; margin: 0 0 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04); }
.card.tight { padding: 4px 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-top: 1px solid var(--divider); }
.list > li:first-child { border-top: 0; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: var(--text); min-height: 56px; }
.row .main { flex: 1; min-width: 0; }
.row .title, .row .meta { display: block; }
.row .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .right { text-align: right; font-size: 15px; white-space: nowrap; }
.chev { color: #C7C7CC; font-size: 22px; line-height: 1; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px;
  background: var(--field); color: var(--text2); }
.badge.draft { background: var(--warn-soft); color: var(--warn); }
.badge.pdf { background: var(--pos-soft); color: var(--pos); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* buttons */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 50px;
  border: 0; border-radius: 12px; font-family: inherit; font-weight: 600; font-size: 17px; line-height: 1.2; cursor: pointer;
  background: var(--card); color: var(--text); box-shadow: inset 0 0 0 1px #D8D8DE; padding: 12px 16px; }
.btn.primary { background: var(--accent); color: #fff; box-shadow: none; }
.btn.primary:active { background: var(--accent-hover); }
.btn.link { background: transparent; box-shadow: none; color: var(--accent-hover); min-height: 44px; }
.btn.danger { color: var(--neg); }
.btn.small { min-height: 40px; font-size: 15px; width: auto; padding: 8px 14px; }
.btn:disabled { opacity: .55; }
.stack > * + * { margin-top: 10px; }
.btn-row { display: flex; gap: 10px; }
.btn-row > * { flex: 1; }
.btn-row > .btn.primary { flex: 2; }
.big-actions .btn { min-height: 64px; font-size: 18px; justify-content: flex-start; padding-left: 18px; }
.big-actions .btn .ico { width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center; color: var(--accent); flex: none; }
.big-actions .btn.primary .ico { background: rgba(255,255,255,.22); color: #fff; }

/* forms */
label.field { display: block; margin: 0 0 14px; }
label.field > span { display: block; font-size: 14px; color: var(--text2); margin: 0 0 6px; }
input[type=text], input[type=password], input[type=search], input[type=date], input[type=email], input[type=tel],
input[type=number], select, textarea {
  width: 100%; font-family: inherit; font-size: 16px; line-height: 1.3; color: var(--text); background: var(--field);
  border: 1px solid transparent; border-radius: 10px; padding: 12px 12px; min-height: 46px; -webkit-appearance: none;
  appearance: none; }
select { background-image: linear-gradient(45deg, transparent 50%, #8E8E93 50%), linear-gradient(135deg, #8E8E93 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat;
  padding-right: 34px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); background: #fff; }
textarea { min-height: 96px; resize: vertical; }
.search { position: relative; margin: 0 0 14px; }
.search input { padding-left: 38px; background-color: #E9E9EE; }
.search svg { position: absolute; left: 12px; top: 14px; color: var(--muted); }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; font-size: 15px; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.radio-list { list-style: none; margin: 0; padding: 0; max-height: 50vh; overflow: auto; }
.radio-list label { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-top: 1px solid var(--divider); }
.radio-list li:first-child label { border-top: 0; }
.radio-list input { width: 20px; height: 20px; accent-color: var(--accent); }
.error-box { background: var(--neg-soft); color: #8E1F1F; border-radius: 12px; padding: 12px 14px; margin: 0 0 14px; font-size: 15px; }
.ok-box { background: var(--pos-soft); color: #13603D; border-radius: 12px; padding: 12px 14px; margin: 0 0 14px; font-size: 15px; }
.info-box { background: #EDF4FD; color: #1F4E7E; border-radius: 12px; padding: 12px 14px; margin: 0 0 14px; font-size: 15px; }

/* steps */
.steps { display: flex; gap: 6px; margin: 0 0 14px; }
.steps a { flex: 1; min-width: 0; text-align: center; font-size: 11.5px; color: var(--muted); padding: 6px 2px 0;
  border-top: 3px solid #DCDCE1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steps a.done { color: var(--text2); border-color: #F5B47A; }
.steps a.cur { color: var(--text); font-weight: 600; border-color: var(--accent); }
.step-title { display: flex; align-items: center; gap: 10px; margin: 2px 0 12px; }
.step-title .num { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.step-title h1 { font-size: 24px; margin: 0; }
.bottom-bar { position: sticky; bottom: calc(76px + var(--safe-bottom)); z-index: 5; padding: 10px 0 6px;
  background: linear-gradient(rgba(245,245,247,0), var(--bg) 30%); }
body.no-tabs .bottom-bar { bottom: 0; padding-bottom: calc(10px + var(--safe-bottom)); }

/* offer lines */
.line { padding: 14px 16px; border-top: 1px solid var(--divider); }
.line:first-child { border-top: 0; }
.line .name { font-weight: 600; }
.line .desc { color: var(--muted); font-size: 14px; margin: 2px 0 8px; }
.line .controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qty { display: flex; align-items: center; background: var(--field); border-radius: 10px; }
.qty button { width: 44px; height: 44px; border: 0; background: transparent; font-size: 22px; color: var(--accent-hover); }
.qty input { width: 64px; min-height: 44px; text-align: center; background: transparent; padding: 0; }
.line .total { margin-left: auto; font-weight: 600; }
.line select { width: auto; min-height: 44px; font-size: 15px; }
.line .price input { width: 120px; text-align: right; }
.line .remove { border: 0; background: transparent; color: var(--neg); font-size: 15px; min-height: 44px; padding: 0 4px; }
.totals { font-size: 16px; }
.totals .t { display: flex; justify-content: space-between; padding: 6px 0; }
.totals .grand { background: var(--red); color: #fff; border-radius: 10px; padding: 12px 14px; margin-top: 8px;
  font-weight: 700; font-size: 18px; }
.warn { color: var(--warn); font-size: 14px; }

/* product picker */
details.cat { border-top: 1px solid var(--divider); }
details.cat:first-child { border-top: 0; }
details.cat > summary { list-style: none; padding: 14px 16px; font-weight: 600; display: flex; justify-content: space-between; }
details.cat > summary::-webkit-details-marker { display: none; }
details.cat > summary::after { content: "›"; color: #C7C7CC; font-size: 22px; line-height: 1; transition: transform .2s; }
details.cat[open] > summary::after { transform: rotate(90deg); }
.pick { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--divider); }
.pick .main { flex: 1; min-width: 0; }
.pick .title { font-weight: 600; font-size: 15px; }
.pick .meta { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pick .price { font-size: 14px; white-space: nowrap; }
.pick button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--accent-soft); color: var(--accent-hover);
  font-size: 24px; flex: none; position: relative; }
.pick button .count { position: absolute; top: -4px; right: -4px; background: var(--accent); color: #fff; font-size: 11px;
  border-radius: 9px; min-width: 18px; height: 18px; line-height: 18px; padding: 0 4px; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photos label { display: block; border: 2px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; position: relative; }
.photos img { width: 100%; height: 76px; object-fit: contain; display: block; padding: 6px; }
.photos span { display: block; font-size: 11px; color: var(--text2); text-align: center; padding: 0 4px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photos input { position: absolute; opacity: 0; }
.photos input:checked + img { outline: 3px solid var(--accent); outline-offset: -3px; }
.photos label:has(input:checked) { border-color: var(--accent); }

/* bottom tab bar */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around;
  background: rgba(251,251,253,.92); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--border); padding: 6px 0 calc(6px + var(--safe-bottom)); }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); padding: 4px 0; }
.tabs a.on { color: var(--accent); }
.tabs svg { width: 26px; height: 26px; }

.toast { position: fixed; left: 16px; right: 16px; bottom: calc(90px + var(--safe-bottom)); z-index: 30; background: rgba(29,29,31,.92);
  color: #fff; border-radius: 12px; padding: 12px 14px; font-size: 15px; text-align: center; transition: opacity .4s; }
.login { max-width: 400px; margin: 0 auto; padding: 48px 20px; }
.login img { width: 100%; max-width: 300px; height: auto; margin: 0 0 22px; }
.lang-switch { display: flex; gap: 8px; justify-content: center; margin: 18px 0 0; font-size: 15px; }
.seg { display: flex; background: #E6E6EB; border-radius: 10px; padding: 3px; }
.seg label { flex: 1; text-align: center; padding: 9px 4px; border-radius: 8px; font-size: 15px; color: var(--text2); }
.seg input { display: none; }
.seg5 label { font-size: 13px; padding: 9px 2px; }
.seg label:has(input:checked) { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* ROI analysis */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 14px; }
.kpi { background: #fff; border-radius: 14px; padding: 12px 14px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.kpi.big { grid-column: 1 / -1; }
.kpi .v { display: block; font-size: 20px; font-weight: 700; letter-spacing: -.2px; }
.kpi.big .v { font-size: 30px; }
.kpi .l { display: block; font-size: 13px; color: var(--text2); margin-top: 2px; }
.pos { color: #1E8E4E; } .neg { color: #C62828; } .warn-t { color: #B26A00; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: right; font-weight: 600; color: var(--text2); padding: 8px 12px; font-size: 12.5px; }
.tbl td { text-align: right; padding: 8px 12px; border-top: 1px solid #EEE; font-variant-numeric: tabular-nums; }
.tbl td:first-child, .tbl th:first-child { text-align: left; }
.tbl tr.tot td { font-weight: 700; }
.chart img { display: block; width: 100%; height: auto; border-radius: 12px; }
.field.err input { border-color: #C62828; background: #FFF5F5; }
.err-text { color: #C62828; font-size: 13px; }
details.adv { padding: 0 16px; }
details.adv > summary { list-style: none; display: flex; align-items: center; padding: 14px 0; cursor: pointer; }
details.adv > summary::-webkit-details-marker { display: none; }
details.adv > summary b { flex: 1; }
details.adv[open] > summary .chev { transform: rotate(90deg); }
details.adv[open] { padding-bottom: 6px; }
.tabs a { min-width: 0; }
