/* Informa: calm, roomy, phone-first. The company's brand colour (--brand) drives every accent;
   red and amber appear only when something needs attention. */
:root {
  --brand: #1d6b3f; --brand-ink: #ffffff;
  --bg: #f4f5f4; --surface: #ffffff; --sunk: #eef1ef; --ink: #16201a; --muted: #5d6b63; --faint: #8b978f; --line: #e2e7e3;
  --accent: var(--brand);
  --accent-soft: color-mix(in srgb, var(--brand) 11%, var(--surface));
  --accent-strong: color-mix(in srgb, var(--brand) 82%, #000);
  --bad: #c0352b; --bad-soft: #fbe9e7; --warn: #a35d00; --warn-soft: #fcf0dc; --good: #23804a; --good-soft: #e3f3e8;
  --heat: #c45a1c; --cool: #1b7fa6;
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 16px; --shadow: 0 1px 2px rgba(16, 32, 22, .05);
  --tabbar: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1310; --surface: #161d19; --sunk: #121815; --ink: #e7eee9; --muted: #a0aea6; --faint: #74827a; --line: #253029;
    --accent: color-mix(in srgb, var(--brand) 55%, #fff);
    --accent-soft: color-mix(in srgb, var(--brand) 26%, var(--surface));
    --accent-strong: color-mix(in srgb, var(--brand) 40%, #fff);
    --bad: #f07a70; --bad-soft: #3a1d1a; --warn: #f0b457; --warn-soft: #36290f; --good: #6fcf91; --good-soft: #173222;
    --heat: #f09058; --cool: #5cc3e6; --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.45; }
body { padding-top: env(safe-area-inset-top); }
body.locked { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; text-wrap: balance; letter-spacing: -.01em; }
h1 { font-size: 1.7rem; font-weight: 750; }
h2 { font-size: 1.1rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0; }
a { color: var(--accent); }
code { background: var(--sunk); padding: 1px 6px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.muted { color: var(--muted); } .small { font-size: .88rem; } .center { text-align: center; } .pad { padding: 0 2px; }
.wrap { white-space: normal !important; overflow-wrap: anywhere; }
.hidden { display: none !important; }
.bad-text { color: var(--bad); }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.topbar-in { max-width: 760px; margin: 0 auto; padding: 10px 18px; display: flex; align-items: center; gap: 10px; min-height: 58px; }
.org-btn { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 4px 6px 4px 0; cursor: pointer; flex: 1; min-width: 0; text-align: left; color: var(--ink); }
.org-name { font-weight: 750; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-btn svg { color: var(--faint); flex: none; }
.org-initials { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--brand); color: var(--brand-ink); font-weight: 750; font-size: 12px; flex: none; }
.status-pill:empty { display: none; }
.status-pill { font-size: .78rem; font-weight: 650; padding: 4px 10px; border-radius: 99px; background: var(--warn-soft); color: var(--warn); white-space: nowrap; }
.status-pill.quiet { background: var(--sunk); color: var(--muted); }

main { max-width: 760px; margin: 0 auto; padding: 6px 18px calc(var(--tabbar) + 100px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 22px; }
.page-h { display: flex; flex-direction: column; gap: 4px; padding-top: 4px; }
.section { display: flex; flex-direction: column; gap: 10px; }
.section-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 2px; min-height: 32px; }
.section-h h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }

/* ---------- tab bar ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar-in { max-width: 760px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); height: var(--tabbar); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--faint); font-size: .74rem; font-weight: 650; position: relative; }
.tabbar a[aria-current="page"] { color: var(--accent); }
.tabbar .dot { position: absolute; top: 7px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--bad); color: #fff; font-size: .7rem; display: grid; place-items: center; }

/* ---------- cards & lists ---------- */
.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); border: 1px solid var(--line); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.card.tight { padding: 4px 16px; gap: 0; }
.card.tight > .small { padding-top: 12px; }
.card.highlight { background: var(--brand); color: var(--brand-ink); border-color: transparent; gap: 2px; }
.card.welcome { gap: 10px; }
.list { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); border: 1px solid var(--line); overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-top: 1px solid var(--line); min-height: 64px; width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; color: var(--ink); text-decoration: none; }
.list > .item:first-child { border-top: 0; }
.item[data-act], .item.link { cursor: pointer; }
.item[data-act]:hover, .item.link:hover { background: var(--sunk); }
.item .body { flex: 1; min-width: 0; }
.item .title { font-weight: 650; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.item .sub { color: var(--muted); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .end { display: flex; align-items: center; gap: 8px; flex: none; color: var(--faint); }
.item.done .title { color: var(--muted); font-weight: 500; }
.item.more { justify-content: center; color: var(--accent); font-weight: 650; min-height: 52px; cursor: pointer; }
.row-ic { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-strong); display: grid; place-items: center; flex: none; }
.season-ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.season-ic.heat { background: color-mix(in srgb, var(--heat) 14%, var(--surface)); color: var(--heat); }
.season-ic.cool { background: color-mix(in srgb, var(--cool) 14%, var(--surface)); color: var(--cool); }
.marker { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--line); }
.marker.bad { background: var(--bad); } .marker.warn { background: var(--warn); } .marker.ok { background: var(--good); } .marker.heat { background: var(--heat); } .marker.cool { background: var(--cool); }
.empty { padding: 26px 16px; color: var(--muted); text-align: center; }
.empty svg { color: var(--good); }
.empty.small { padding: 18px 16px; font-size: .92rem; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); display: grid; place-items: center; font-weight: 700; flex: none; font-size: .95rem; }
.avatar.lg { width: 56px; height: 56px; font-size: 1.15rem; }
.divider { height: 1px; background: var(--line); margin: 2px 0; }

/* ---------- chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: .76rem; font-weight: 650; padding: 3px 9px; border-radius: 99px; background: var(--sunk); color: var(--muted); white-space: nowrap; }
.chip.bad { background: var(--bad-soft); color: var(--bad); } .chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.ok { background: var(--good-soft); color: var(--good); } .chip.acc { background: var(--accent-soft); color: var(--accent-strong); }
.chip.example { background: var(--warn-soft); color: var(--warn); text-transform: uppercase; letter-spacing: .05em; font-size: .64rem; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 16px; font-weight: 650; cursor: pointer; min-height: 46px; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--accent); padding-left: 8px; padding-right: 8px; min-height: 40px; }
.btn.danger { color: var(--bad); }
.btn.danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.sm { min-height: 38px; padding: 6px 12px; font-size: .9rem; border-radius: 10px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--accent); flex: none; }
.icon-btn:hover { border-color: var(--accent); }
.icon-btn.solid { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.icon-btn.plain { border-color: transparent; background: transparent; color: var(--faint); }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.msg-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.fab { position: fixed; right: max(18px, calc(50% - 362px)); bottom: calc(var(--tabbar) + 18px + env(safe-area-inset-bottom)); z-index: 15; height: 56px; padding: 0 22px 0 18px; border-radius: 28px; border: 0; background: var(--brand); color: var(--brand-ink); font-weight: 700; font-size: 1rem; display: flex; align-items: center; gap: 8px; box-shadow: 0 8px 22px color-mix(in srgb, var(--brand) 35%, transparent); cursor: pointer; }
.back { display: inline-flex; align-items: center; gap: 2px; background: none; border: 0; color: var(--accent); font-weight: 650; cursor: pointer; padding: 6px 0; text-decoration: none; align-self: flex-start; margin-bottom: -10px; }

/* ---------- customer page ---------- */
.hero { display: flex; flex-direction: column; gap: 16px; }
.hero-top { display: flex; align-items: flex-start; gap: 14px; }
.hero-top .body { flex: 1; min-width: 0; }
.contact { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.contact a, .contact span { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 12px 4px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-strong); text-decoration: none; font-size: .8rem; font-weight: 700; }
.contact span { background: var(--sunk); color: var(--faint); opacity: .7; }
.next-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.big-date { font-size: 1.5rem; font-weight: 750; line-height: 1.2; margin: 2px 0 4px; }
.setting { display: flex; align-items: center; gap: 14px; }
.setting .body { flex: 1; min-width: 0; }
.eq { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; }
.eq:hover { border-color: var(--accent); }
.eq-h { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.eq .btn { align-self: flex-start; }
.age { height: 6px; border-radius: 6px; background: var(--sunk); overflow: hidden; }
.age i { display: block; height: 100%; border-radius: 6px; background: var(--good); }
.age i.warn { background: var(--warn); } .age i.bad { background: var(--bad); }
.kv { display: grid; grid-template-columns: 80px 1fr; gap: 6px 12px; font-size: .94rem; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); }
.tile .v { font-size: 1.5rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.tile .l { color: var(--muted); font-size: .85rem; }
.bar-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; align-items: center; font-size: .92rem; }
.bar-row .track { height: 10px; background: var(--sunk); border-radius: 6px; overflow: hidden; }
.bar-row .track i { display: block; height: 100%; background: var(--brand); border-radius: 6px; }
.notice { border-radius: var(--r); padding: 14px 12px 14px 16px; background: var(--accent-soft); color: var(--ink); display: flex; gap: 12px; align-items: flex-start; }
.notice > svg { color: var(--accent); flex: none; margin-top: 1px; }
.notice .body { flex: 1; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; background: var(--sunk); border-radius: 12px; padding: 4px; }
.segmented a { text-align: center; padding: 9px; border-radius: 9px; text-decoration: none; color: var(--muted); font-weight: 650; }
.segmented a[aria-current="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: .86rem; font-weight: 650; color: var(--muted); }
input[type=text], input[type=search], input[type=tel], input[type=email], input[type=number], input[type=date], input[type=password], select, textarea {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 11px 13px; min-height: 48px; font-size: 16px; appearance: none; -webkit-appearance: none; }
select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
input:disabled { color: var(--muted); background: var(--sunk); }
textarea { min-height: 110px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }
.check { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); cursor: pointer; }
.card.tight .check:first-of-type, .check:first-child { border-top: 0; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--brand); flex: none; }
.check .t { font-weight: 650; } .check .d { color: var(--muted); font-size: .88rem; }
.check.consent { background: var(--accent-soft); border: 0; border-radius: 12px; padding: 14px; }
.search { position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search input { padding-left: 44px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; margin-top: -8px; }
.chips.wrap { flex-wrap: wrap; margin: 0 0 4px; }
.chips::-webkit-scrollbar { display: none; }
.chips button { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 8px 14px; font-weight: 650; font-size: .9rem; cursor: pointer; white-space: nowrap; color: var(--muted); }
.chips button[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: block; padding: 9px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-weight: 650; font-size: .92rem; color: var(--muted); }
.seg input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.seg input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.switch { position: relative; width: 52px; height: 32px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; z-index: 1; }
.switch input:disabled { cursor: not-allowed; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--line); transition: background .15s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 3px solid var(--accent); outline-offset: 2px; }
.sticky-save { position: sticky; bottom: calc(var(--tabbar) + 12px + env(safe-area-inset-bottom)); z-index: 5; }
.steps-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; color: var(--muted); }

/* ---------- branding pickers ---------- */
.logo-pick { display: flex; align-items: center; gap: 14px; }
.logo-pick img, .logo-empty { width: 76px; height: 76px; border-radius: 14px; border: 1px solid var(--line); object-fit: contain; background: #fff; padding: 6px; }
.logo-empty { display: grid; place-items: center; color: var(--faint); background: var(--sunk); }
.logo-pick label.btn { cursor: pointer; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; position: relative; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }
.swatch.custom { background: conic-gradient(#e53935, #fdd835, #43a047, #1e88e5, #8e24aa, #e53935); overflow: hidden; }
.swatch.custom input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.preview { border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.preview-bar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; font-size: .98rem; }
.preview-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.preview-line { height: 10px; width: 80%; border-radius: 6px; background: var(--sunk); }
.preview-line.short { width: 50%; }
.preview-btn { margin-top: 6px; padding: 8px 14px; border-radius: 10px; font-weight: 700; font-size: .88rem; }

/* ---------- wizard ---------- */
.wizard { min-height: 100vh; padding: 24px 18px calc(110px + env(safe-area-inset-bottom)); }
.wizard-in { max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.steps { display: flex; gap: 6px; flex-wrap: wrap; }
.steps span { font-size: .78rem; font-weight: 700; padding: 5px 10px; border-radius: 99px; background: var(--sunk); color: var(--faint); }
.steps span.on { background: var(--brand); color: var(--brand-ink); }
.steps span.done { background: var(--accent-soft); color: var(--accent-strong); }
.wizard-actions { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); display: flex; justify-content: space-between; gap: 10px; z-index: 10; }
.wizard-actions .btn.primary { flex: 1; max-width: 340px; margin-left: auto; }

/* ---------- bottom sheet ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 40; background: rgba(8, 14, 10, .45); display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 22px 22px 0 0; padding: 6px 18px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; overscroll-behavior: contain; }
@media (min-width: 640px) { .sheet-wrap { align-items: center; padding: 20px; } .sheet { border-radius: 22px; } }
.grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 0; }
.sheet-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sheet-actions { display: flex; gap: 10px; position: sticky; bottom: calc(-18px - env(safe-area-inset-bottom)); background: var(--bg); padding: 10px 0 calc(4px + env(safe-area-inset-bottom)); margin-top: 4px; }
.sheet-actions .btn { flex: 1; }
@media (prefers-reduced-motion: no-preference) {
  .sheet { animation: up .22s ease-out; }
  @keyframes up { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
}

/* ---------- sign-in ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 18px; }
.login .card { width: 100%; max-width: 400px; padding: 30px 24px; gap: 18px; }
.login-logo { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.auth-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px; }
.err { color: var(--bad); font-size: .9rem; min-height: 1.2em; margin-top: -6px; }

.toast { position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-weight: 600; max-width: calc(100vw - 36px); box-shadow: 0 8px 24px rgba(0,0,0,.2); }

/* role picker */
.role-pick { display: flex; flex-direction: column; gap: 8px; }
.role-opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; }
.role-opt input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--brand); flex: none; }
.role-opt:has(input:checked) { border-color: var(--brand); background: var(--accent-soft); }
.role-opt .d { color: var(--muted); font-size: .86rem; }
.item .sub .chip { margin-right: 4px; vertical-align: 1px; }
