/* FunnelHer — black, white, bright pink, pale blush */
:root {
  --black: #000; --white: #fff;
  --pink: #E6007E; --pink-dark: #B8005F; --pink-tint: #FFE3F1;
  --blush: #FDF2F6; --blush-2: #FAE6EE; --line: #EED8E1; --line-soft: #F5E8EE;
  --muted: #6A5E63; --muted-2: #8E8186;
  --ok: #17663D; --ok-bg: #E6F4EC; --warn: #8A4F00; --warn-bg: #FFF2DE;
  --serif: 'Bodoni Moda', Didot, 'Bodoni 72', Georgia, serif;
  --sans: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r: 8px; --r-lg: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 18px rgba(230,0,126,.05);
  --top: 64px; --side: 248px;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
}
*, *::before, *::after { box-sizing: inherit; }
html, body { margin: 0; background: var(--white); color: var(--black); }
body { font-family: var(--sans); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body.no-scroll { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--black); color: #fff; padding: 8px 12px; z-index: 100; border-radius: 6px; }
.skip:focus { left: 8px; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- logo ---------- */
.logo { font-family: var(--serif); font-size: 34px; font-weight: 500; letter-spacing: -.01em; line-height: 1; color: var(--black); }
.logo em { font-style: italic; color: var(--pink); font-weight: 500; }
.logo-sm { font-size: 24px; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.sidebar { background: var(--blush); border-right: 1px solid var(--line); padding: 26px 16px 20px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow-y: auto; }
.brand { display: block; text-decoration: none; padding: 0 10px 26px; }
.brand .logo { display: block; }
.tagline { display: block; margin-top: 8px; font-size: 11.5px; letter-spacing: .18em; font-weight: 600; }
#nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r); text-decoration: none; font-size: 15px; font-weight: 500; }
.nav-item:hover { background: var(--blush-2); }
.nav-item.on { background: var(--pink); color: #fff; }
.side-foot { margin-top: auto; padding: 18px 10px 0; font-size: 12.5px; color: var(--muted); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: var(--top); display: flex; align-items: center; gap: 12px; padding: 0 28px; border-bottom: 1px solid var(--line-soft); background: #fff; position: sticky; top: 0; z-index: 20; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.save-state { font-size: 12.5px; color: var(--muted-2); white-space: nowrap; }
.save-state.busy { color: var(--pink); }
.save-state.warn { color: var(--warn); }
.project-switch { height: 38px; min-width: 200px; max-width: 280px; padding: 0 34px 0 12px; border: 1px solid var(--line); border-radius: var(--r); background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; appearance: none; }
.view { flex: 1; outline: none; min-width: 0; }
.only-mobile { display: none !important; }
.scrim { display: none; }
.boot { position: fixed; inset: 0; background: #fff; display: grid; place-items: center; z-index: 200; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: var(--r); border: 1px solid #D9C3CC; background: #fff; font-weight: 600; font-size: 14.5px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { border-color: var(--black); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-pink { background: var(--pink); border-color: var(--pink); color: #fff; }
.btn-pink:hover { background: var(--pink-dark); border-color: var(--pink-dark); }
.btn-black { background: var(--black); border-color: var(--black); color: #fff; }
.btn-black:hover { background: #2a2a2a; }
.btn-sm { height: 34px; padding: 0 13px; font-size: 13.5px; }
.btn-block { width: 100%; }
.btn.danger, .icon-btn.danger { color: #A3003F; }
.btn.danger:hover { border-color: #A3003F; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r); border: 0; background: transparent; cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--blush); }
.icon-btn.bordered { border: 1px solid var(--line); background: #fff; }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn.ghost { color: var(--muted); }
.linkish { background: none; border: 0; padding: 0; color: var(--black); font-weight: 600; text-decoration: underline; text-decoration-color: var(--pink); text-underline-offset: 3px; cursor: pointer; font-size: inherit; text-align: left; }
.linkish:hover { color: var(--pink); }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }

/* ---------- forms ---------- */
.fld { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.fld > span { font-size: 13px; font-weight: 600; }
.fld small { color: var(--muted-2); font-size: 12px; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 9px 11px; font-size: 14.5px; min-height: 40px; }
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px var(--pink-tint); }
input:disabled { background: var(--blush); color: var(--muted); }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--pink); }
input[type=color] { width: 46px; padding: 3px; height: 40px; flex: none; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 14px; cursor: pointer; }
.pad-top { padding-top: 28px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 16px; }
.span-2 { grid-column: span 2; }
.inline-field { display: flex; gap: 8px; }
.unit-input { position: relative; }
.unit-input input { padding-right: 36px; }
.unit-input em { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--muted); font-size: 13px; }
.color-row { display: flex; gap: 8px; }
.seg { display: flex; flex-direction: column; gap: 6px; }
.seg label { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; cursor: pointer; font-size: 14px; }
.seg label:has(input:checked) { border-color: var(--pink); background: var(--blush); }
.hint { font-size: 13px; color: var(--muted); }
.muted { color: var(--muted); }
.lede { font-size: 16px; color: var(--muted); margin-top: 6px; max-width: 62ch; }
.lede-sm { font-size: 15px; margin-bottom: 14px; }
.disclaimer { font-size: 12.5px; color: var(--muted); margin-top: 12px; font-style: italic; }
.disclaimer.strong { font-style: normal; border-top: 1px solid var(--line-soft); padding-top: 12px; }
.warn-line { display: flex; align-items: center; gap: 8px; color: var(--warn); background: var(--warn-bg); padding: 8px 12px; border-radius: 6px; font-size: 13.5px; margin-bottom: 14px; }
.warn-box { background: var(--warn-bg); border-radius: var(--r); padding: 14px 16px; font-size: 14px; margin-top: 14px; }
.warn-box ul { margin: 6px 0 0; padding-left: 18px; }
.warn-box p { margin-top: 4px; }
.ok-line { display: flex; gap: 8px; align-items: center; color: var(--ok); font-weight: 600; font-size: 14px; }
.row-gap { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row-end { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.row-between { display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }

/* ---------- pages ---------- */
.page { padding: 34px 36px 60px; max-width: 1360px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head h1, .empty-big h1 { font-family: var(--serif); font-weight: 500; font-size: 40px; line-height: 1.1; letter-spacing: -.01em; }
.head-actions { display: flex; gap: 10px; }
.page-body { padding: 22px 36px 60px; }
.h2 { font-family: var(--serif); font-weight: 500; font-size: 23px; line-height: 1.2; }
.h3 { font-size: 15px; font-weight: 700; margin: 20px 0 6px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; margin-bottom: 18px; min-width: 0; }
.tile > h3 { font-size: 15px; font-weight: 700; margin-bottom: 10px; }
.tile-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.tile-head h3 { font-size: 15px; font-weight: 700; }
.tile-sub { font-size: 13.5px; color: var(--muted); margin-top: 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.empty-big { text-align: left; padding: 60px 0; max-width: 520px; }
.empty-big h2 { font-family: var(--serif); font-weight: 500; font-size: 28px; }
.empty-big p { margin: 10px 0 20px; color: var(--muted); }
.empty-small { padding: 26px; background: var(--blush); border-radius: var(--r); color: var(--muted); font-size: 14px; }
.count { font-family: var(--serif); font-size: 44px; line-height: 1; margin: 2px 0 12px; }
.plist, .dates, .ladder-mini, .health-compact { list-style: none; margin: 0; padding: 0; }
.plist li, .dates li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line-soft); font-size: 14px; }
.plist li span { color: var(--muted-2); font-size: 13px; white-space: nowrap; }
.dates time { font-weight: 700; white-space: nowrap; min-width: 92px; }
.dates li { justify-content: flex-start; }
.meta-line { font-size: 12.5px; color: var(--muted-2); margin-top: 6px; }
.kv { display: flex; justify-content: space-between; font-size: 14px; padding-top: 8px; }

/* status chips (rectangular) */
.status { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 4px; font-size: 12px; font-weight: 600; white-space: nowrap; font-family: var(--sans); }
.status.complete { background: var(--ok-bg); color: var(--ok); }
.status.attention { background: var(--warn-bg); color: var(--warn); }
.status.none { background: var(--blush-2); color: var(--muted); }
.status.p-active { background: var(--pink); color: #fff; }
.status.p-planning { background: var(--blush-2); color: var(--black); }
.status.p-archived { background: #eee; color: #555; }

/* ---------- project header ---------- */
.proj-head { padding: 16px 36px 0; border-bottom: 1px solid var(--line-soft); }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); text-decoration: none; margin-bottom: 10px; }
.back:hover { color: var(--pink); }
.proj-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.proj-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.proj-title h1 { font-family: var(--serif); font-weight: 500; font-size: 32px; line-height: 1.15; }
.proj-actions { display: flex; gap: 10px; }
.proj-desc { margin-top: 6px; color: var(--muted); font-size: 14.5px; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.proj-desc .linkish { color: var(--muted); font-weight: 500; }
.launch { font-weight: 600; color: var(--black); }
.tabs { display: flex; gap: 4px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 10px 14px 12px; text-decoration: none; font-size: 14.5px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--black); }
.tabs a.on { color: var(--black); font-weight: 700; border-bottom-color: var(--pink); }

/* ---------- dashboard ---------- */
.dash { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.dash .tile { margin: 0; }
.span-2 { grid-column: span 2; }
.dash-current { background: var(--blush); border-color: var(--line); }
.mini-link { display: block; background: #fff; border-radius: var(--r); border: 1px solid var(--line); }
.mini { display: block; width: 100%; height: auto; }
.mini line { stroke: var(--pink); stroke-width: 1.4; }
.mini line.condition { stroke-dasharray: 3 3; }
.mini rect { fill: var(--blush); stroke: #D9B9C6; stroke-width: .8; }
.mini rect.offer { fill: var(--pink-tint); stroke: var(--pink); }
.mini text { font-size: 12px; fill: var(--muted-2); font-family: var(--sans); }
.health-compact li { display: flex; gap: 10px; align-items: center; padding: 6px 0; font-size: 14px; }
.health-compact .status { min-width: 112px; justify-content: center; }
.ladder-mini { counter-reset: lad; }
.ladder-mini li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.ladder-mini li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scen-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.scen-mini div { border: 1px solid var(--line); border-radius: var(--r); padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.scen-mini div.on { border-color: var(--pink); background: var(--blush); }
.scen-mini span { font-size: 12px; color: var(--muted); font-weight: 600; }
.scen-mini b { font-size: 17px; }
.scen-mini em { font-style: normal; font-size: 12px; color: var(--muted-2); }
.rev-list { margin: 0 0 12px; padding-left: 18px; font-size: 14px; }
.rev-list li { margin-bottom: 6px; }
.rev-list li::marker { color: var(--pink); }

/* ---------- funnels & templates ---------- */
.seg-tabs { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); padding: 3px; margin-bottom: 20px; background: #fff; }
.seg-tabs button { border: 0; background: none; padding: 8px 16px; border-radius: 6px; font-weight: 600; font-size: 14px; cursor: pointer; color: var(--muted); }
.seg-tabs button.on { background: var(--black); color: #fff; }
.proj-grid, .tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.proj-card, .tpl-card { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.proj-card.current { border-color: var(--pink); }
.proj-preview, .tpl-preview { display: block; width: 100%; border: 0; padding: 10px; background: var(--blush); cursor: pointer; border-bottom: 1px solid var(--line); }
.proj-info, .tpl-info { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.proj-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.proj-info h3, .tpl-info h3 { font-family: var(--serif); font-weight: 500; font-size: 20px; line-height: 1.2; }
.proj-info .hint { margin-top: 4px; }
.tpl-info p:not(.meta-line) { font-size: 14px; color: var(--muted); margin-top: 6px; flex: 1; }
.tpl-info .btn { margin-top: 14px; align-self: flex-start; }
.proj-btns { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.proj-btns .btn { margin-right: auto; }

/* ---------- offer ladder ---------- */
.stairs { display: flex; align-items: flex-end; gap: 6px; padding: 10px 0 18px; overflow-x: auto; }
.stair { flex: 1 0 86px; background: var(--blush); border: 1px solid var(--line); border-top: 3px solid var(--pink); border-radius: 6px 6px 0 0; padding: 8px; display: flex; flex-direction: column; justify-content: flex-start; min-width: 86px; }
.stair b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stair span { font-size: 12px; color: var(--muted); line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ladder-list { list-style: none; padding: 0; margin: 0; }
.lrow { border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 8px; background: #fff; }
.lrow.open { border-color: var(--pink); }
.lrow.dragging { opacity: .4; }
.lrow.drop { border-color: var(--pink); box-shadow: 0 -3px 0 var(--pink); }
.lrow-main { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.grip { cursor: grab; color: var(--muted-2); display: grid; }
.lnum { width: 26px; height: 26px; border-radius: 50%; background: var(--blush-2); display: grid; place-items: center; font-size: 12.5px; font-weight: 700; flex: none; }
.lname { flex: 1; min-width: 0; background: none; border: 0; text-align: left; cursor: pointer; padding: 0; display: flex; flex-direction: column; }
.lname b { font-size: 14.5px; }
.lname span { font-size: 12.5px; color: var(--muted); }
.lprice { font-weight: 700; white-space: nowrap; }
.lbtns { display: flex; }
.lrow-edit { padding: 6px 16px 14px; border-top: 1px solid var(--line-soft); }
.calc { position: sticky; top: calc(var(--top) + 16px); }
.calc-big { background: var(--blush); border-radius: var(--r); padding: 16px; margin: 14px 0; }
.calc-big span, .calc-row span { font-size: 13px; font-weight: 600; display: block; }
.calc-big b { font-family: var(--serif); font-size: 38px; font-weight: 500; display: block; line-height: 1.15; margin: 4px 0; }
.calc-big em, .calc-row em { font-style: normal; font-size: 12.5px; color: var(--muted); display: block; }
.calc-row { padding: 12px 0; border-top: 1px solid var(--line-soft); }
.calc-row b { font-size: 22px; display: block; margin: 2px 0; }

/* ---------- email ---------- */
.email-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 18px; align-items: start; }
.seq-list ul { list-style: none; padding: 0; margin: 0; }
.seq-item { width: 100%; text-align: left; border: 1px solid transparent; background: none; border-radius: var(--r); padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; margin-bottom: 4px; }
.seq-item:hover { background: var(--blush); }
.seq-item.on { background: var(--blush); border-color: var(--pink); }
.seq-item b { font-size: 14.5px; }
.seq-item span { font-size: 12.5px; color: var(--muted); }
.table-wrap { overflow-x: auto; margin-bottom: 12px; }
.etable, .htable { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 760px; }
.etable th, .htable th { text-align: left; font-size: 12.5px; font-weight: 700; padding: 8px 6px; background: var(--blush); }
.etable td, .htable td { padding: 5px 4px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.htable td { padding: 9px 6px; }
.etable input { min-height: 36px; padding: 6px 8px; font-size: 13.5px; border-color: transparent; background: transparent; }
.etable input:hover { border-color: var(--line); }
.etable input:focus { background: #fff; }
.etable input.day { width: 64px; font-weight: 700; }

/* ---------- traffic / automation ---------- */
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--blush); border-radius: var(--r-lg); padding: 14px 16px; }
.stat span { font-size: 12.5px; font-weight: 600; color: var(--muted); display: block; }
.stat b { font-family: var(--serif); font-weight: 500; font-size: 28px; }
.traffic-card h3 { display: flex; gap: 10px; align-items: center; font-size: 17px; }
.rules { display: flex; flex-direction: column; gap: 10px; }
.rule { border: 1px solid var(--line); border-radius: var(--r); padding: 12px; background: #fff; }
.rule-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rule-line select, .rule-line input { flex: 1 1 150px; width: auto; }
.rw { font-size: 13px; font-weight: 700; color: var(--pink); }
.rule-note { margin-top: 8px; font-size: 13px; min-height: 34px; padding: 6px 10px; border-style: dashed; }
.branch-list { list-style: none; padding: 0; margin: 0; }
.branch-list li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line-soft); font-size: 14px; }
.branch-list li span:first-child { font-weight: 600; }
.branch-list .linkish { margin-left: auto; font-size: 13px; }
.cond-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border: 1px dashed var(--pink); border-radius: 4px; font-size: 12px; font-weight: 600; background: #fff; white-space: nowrap; }
.cond-chip.plain { border-style: solid; border-color: var(--line); color: var(--muted); }

/* ---------- goals ---------- */
.goals-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.results { position: sticky; top: calc(var(--top) + 16px); }
.res-hero { background: var(--blush); border-radius: var(--r); padding: 18px; margin: 14px 0; }
.res-hero span { font-size: 13px; font-weight: 600; }
.res-hero b { display: block; font-family: var(--serif); font-weight: 500; font-size: 48px; line-height: 1.1; }
.res-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.res-grid div { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; }
.res-grid span { font-size: 12.5px; color: var(--muted); display: block; font-weight: 600; }
.res-grid b { font-size: 20px; }
.bars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: end; }
.bar { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; }
.bar-track { width: 100%; max-width: 90px; height: 140px; display: flex; align-items: flex-end; background: var(--blush); border-radius: 6px 6px 0 0; }
.bar-fill { width: 100%; background: #F4A6CC; border-radius: 6px 6px 0 0; transition: height .25s; }
.bar.on .bar-fill { background: var(--pink); }
.bar span { color: var(--muted); }

/* ---------- notes ---------- */
.notes-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.note-add { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 14px; }
.note-list, .park-list { list-style: none; padding: 0; margin: 0; }
.note-list li, .park-list li { border-top: 1px solid var(--line-soft); padding: 10px 0; display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; font-size: 14px; }
.note-list li div { display: flex; align-items: center; gap: 6px; flex: none; }
.note-list time { font-size: 12px; color: var(--muted-2); }
.park-list li { flex-direction: column; }
.parking { background: var(--blush); }
.parking input { background: #fff; }
.attach-row { display: flex; gap: 8px; margin-bottom: 8px; }
.attached span { color: var(--muted); }

/* ---------- integrations & settings ---------- */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; margin-bottom: 18px; }
.app-grid .tile { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.app-mark { font-family: var(--serif); font-size: 26px; font-weight: 500; }
.app-mark em { color: var(--pink); }
.app-card p:not(.meta-line) { font-size: 14px; color: var(--muted); flex: 1; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.settings-grid .tile { margin: 0; }
.settings-grid .tile-sub { margin-bottom: 16px; }
.key-state { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: var(--r); font-size: 14px; margin-bottom: 14px; }
.key-state.on { background: var(--ok-bg); color: var(--ok); }
.key-state.off { background: var(--blush); color: var(--muted); }
.logo-row { display: flex; gap: 10px; align-items: center; }
.logo-prev { height: 52px; max-width: 150px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; padding: 4px; }
.logo-prev.ph { width: 52px; display: grid; place-items: center; color: var(--muted-2); }
.brand-preview { margin-top: 6px; }

/* ---------- map ---------- */
body.on-map .main { height: 100vh; height: 100dvh; }
body.on-map .view { display: flex; flex-direction: column; min-height: 0; }
.map-shell { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.map-shell.is-full { position: fixed; inset: 0; z-index: 60; background: #fff; padding-top: env(safe-area-inset-top, 0px); }
.map-toolbar { display: flex; align-items: center; gap: 10px; padding: 10px 36px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); margin-left: 8px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.lg { display: inline-block; width: 26px; border-top: 2px solid var(--pink); }
.lg.dashed { border-top-style: dashed; }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.zoom { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r); height: 36px; }
.zoom span { min-width: 46px; text-align: center; font-size: 13px; color: var(--muted); }
.map-area { display: grid; grid-template-columns: minmax(0, 1fr) auto; flex: 1; min-height: 440px; }
.panel:not(.open) { display: none; }
.panel.open { width: 340px; }

.viewport { position: relative; overflow: hidden; background-color: #fff; background-image: radial-gradient(#F2DCE5 1px, transparent 1.2px); background-size: 22px 22px; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.viewport.panning { cursor: grabbing; }
.world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.links { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.link { fill: none; stroke: var(--pink); stroke-width: 2; }
.link.condition { stroke-dasharray: 7 5; }
.link.sel { stroke: var(--black); stroke-width: 2.5; }
.link.temp { stroke-dasharray: 4 4; stroke-width: 2; }
.link-hit { fill: none; stroke: transparent; stroke-width: 16; pointer-events: stroke; cursor: pointer; }
.link-label { pointer-events: all; cursor: pointer; }
.link-label rect { fill: #fff; stroke: var(--pink); stroke-width: 1; }
.link-label circle { fill: var(--black); }
.link-label.pos circle { fill: var(--ok); }
.link-label text { font: 600 11.5px var(--sans); fill: var(--black); }
.link-label.sel rect { stroke: var(--black); stroke-width: 2; }
.card { position: absolute; width: 176px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); cursor: pointer; }
.card:hover { border-color: #DDB3C4; }
.card.selected { border-color: var(--pink); box-shadow: 0 0 0 2px var(--pink), var(--shadow); }
.card.dragging { cursor: grabbing; box-shadow: 0 10px 28px rgba(0,0,0,.12); z-index: 5; }
.card-head { background: var(--blush); border-bottom: 1px solid var(--line); border-radius: 10px 10px 0 0; text-align: center; font-size: 13px; font-weight: 700; padding: 7px 10px; }
.card.cat-logic .card-head { background: var(--black); color: #fff; border-bottom-color: var(--black); }
.card.type-custom .card-head { background: #fff; }
.card-body { padding: 10px 10px 12px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.card-thumb { width: 110px; height: 70px; object-fit: cover; border-radius: 6px; margin-bottom: 6px; pointer-events: none; }
.card-icon { width: 52px; height: 52px; border-radius: 8px; background: var(--blush); display: grid; place-items: center; margin: 2px 0 8px; }
.card-name { font-weight: 700; font-size: 14px; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card-price { font-weight: 700; font-size: 14px; }
.card-meta { font-size: 12px; color: var(--muted); line-height: 1.4; }
.port { position: absolute; right: -9px; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%; background: #fff; border: 2px solid var(--pink); cursor: crosshair; padding: 0; touch-action: none; }
.port:hover, .card.selected .port { background: var(--pink); }
.map-empty { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 30px; max-width: 420px; width: calc(100% - 40px); cursor: default; }
.map-empty h2 { font-family: var(--serif); font-weight: 500; font-size: 26px; }
.map-empty p { color: var(--muted); margin: 8px 0 18px; }
.map-hint { position: absolute; left: 14px; bottom: 10px; font-size: 12px; color: var(--muted-2); background: rgba(255,255,255,.9); padding: 4px 8px; border-radius: 4px; pointer-events: none; }
.panel { border-left: 1px solid var(--line); background: #fff; overflow-y: auto; padding: 18px 20px 24px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
.panel-head h2 { font-size: 17px; font-weight: 700; }
.panel-kicker { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--pink); font-weight: 700; margin-bottom: 2px; }
.thumb-row { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.thumb { width: 84px; height: 84px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); flex: none; }
.thumb.ph { display: grid; place-items: center; background: var(--blush); color: var(--muted-2); }
.thumb-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.thumb-actions .hint { font-size: 12px; }
.conn-list { list-style: none; padding: 0; margin: 0 0 8px; }
.conn-list li { display: flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: var(--r); padding: 4px 4px 4px 8px; margin-bottom: 6px; }
.conn-go { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; background: none; border: 0; cursor: pointer; padding: 3px 0; text-align: left; }
.conn-name { font-size: 13.5px; font-weight: 600; }
.add-conn { display: grid; grid-template-columns: 1fr; gap: 6px; background: var(--blush); border-radius: var(--r); padding: 10px; }
.add-conn .btn { justify-self: start; }
.panel-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.conn-route { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.route-node { border: 1px solid var(--line); background: var(--blush); border-radius: var(--r); padding: 8px 10px; font-weight: 600; font-size: 13.5px; cursor: pointer; }
.glance { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.glance div { background: var(--blush); border-radius: var(--r); padding: 10px; }
.glance b { display: block; font-size: 18px; }
.glance span { font-size: 12px; color: var(--muted); }
.health-mini { list-style: none; padding: 0; margin: 0; }
.health-mini li { display: flex; align-items: center; gap: 8px; font-size: 13.5px; padding: 5px 0; }
.health-mini em { margin-left: auto; font-style: normal; font-size: 12px; color: var(--muted-2); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot.complete { background: var(--ok); }
.dot.attention { background: #E39A2D; }
.dot.none { background: #fff; border: 1.5px solid #C7AFB9; }
.panel-tip { margin-top: 14px; }

/* ---------- modal ---------- */
.modal-wrap { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 100; display: grid; place-items: center; padding: 20px; overflow-y: auto; }
.modal { background: #fff; border-radius: var(--r-lg); width: 100%; max-width: 520px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.18); }
.modal.wide { max-width: 860px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line-soft); }
.modal-head h2 { font-family: var(--serif); font-weight: 500; font-size: 24px; }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line-soft); }
.choice-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.choice { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: var(--r); padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.choice:hover { border-color: var(--pink); background: var(--blush); }
.choice span { font-size: 13px; color: var(--muted); }
.step-cat { margin-bottom: 16px; }
.step-cat h3 { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.step-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.step-opt { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: #fff; border-radius: var(--r); padding: 10px 12px; cursor: pointer; font-weight: 600; font-size: 14px; text-align: left; }
.step-opt:hover { border-color: var(--pink); background: var(--blush); }
.custom-row { display: flex; gap: 8px; }
.health-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.health-list li { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.hl-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 4px; }
.health-list p { font-size: 13.5px; color: var(--muted); }
.ai-ask { background: var(--blush); border-radius: var(--r); padding: 14px; margin-bottom: 16px; }
.ai-ask .fld { margin-bottom: 10px; }
.ai-ask textarea { background: #fff; }
.ai-ask .hint { margin-top: 8px; }
.ai-result { border: 1px solid var(--pink); border-radius: var(--r); padding: 16px; margin-bottom: 18px; font-size: 14.5px; }
.ai-result h3 { font-size: 15px; font-weight: 700; margin: 14px 0 6px; }
.ai-result p { margin-bottom: 8px; }
.ai-result.loading { border-style: dashed; color: var(--muted); }
.ai-result.error { border-color: #A3003F; }
.rev-title { font-family: var(--serif); font-weight: 500; font-size: 21px; margin-bottom: 10px; }
.rev h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.rev.simple { background: var(--blush); border-radius: var(--r); padding: 14px; }
.rev.simple p { font-weight: 600; }

/* ---------- toasts ---------- */
.toasts { position: fixed; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); z-index: 150; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100% - 32px); }
.toast { background: var(--black); color: #fff; padding: 11px 16px; border-radius: var(--r); font-size: 14px; transition: opacity .4s; }
.toast.out { opacity: 0; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .dash { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .goals-layout, .settings-grid { grid-template-columns: 1fr; }
  .results { position: static; }
  .legend { display: none; }
}
@media (max-width: 900px) {
  :root { --top: 58px; }
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; z-index: 80; transform: translateX(-100%); transition: transform .2s; height: 100%; padding-top: calc(26px + env(safe-area-inset-top, 0px)); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 70; }
  .only-mobile { display: inline-grid !important; }
  .logo-sm.only-mobile { display: inline !important; }
  .hide-mobile { display: none !important; }
  .topbar { padding: 0 12px; top: env(safe-area-inset-top, 0px); }
  .project-switch { min-width: 0; max-width: 170px; }
  .save-state { display: none; }
  .page { padding: 22px 16px 50px; }
  .page-body { padding: 18px 16px 50px; }
  .page-head h1, .empty-big h1 { font-size: 31px; }
  .proj-head { padding: 16px 16px 0; }
  .proj-title h1 { font-size: 25px; }
  .proj-actions .btn { height: 38px; padding: 0 12px; }
  .map-toolbar { padding: 10px 16px; }
  .map-area { grid-template-columns: 1fr; min-height: 420px; }
  body.on-map .main { height: auto; }
  .map-area { height: 70vh; flex: none; }
  .panel.open { width: auto; }
  .panel { position: fixed; left: 0; right: 0; bottom: 0; max-height: 72vh; z-index: 50; border-left: 0; border-top: 1px solid var(--line); border-radius: 14px 14px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.12); padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); display: none; }
  .panel.open { display: block; }
  .map-hint { display: none; }
  .dash, .two-col, .email-layout, .notes-layout { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .calc { position: static; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .health-list { grid-template-columns: 1fr; }
  .modal-wrap { padding: 0; align-items: end; }
  .modal, .modal.wide { max-width: none; border-radius: 14px 14px 0 0; max-height: 92vh; }
  .modal-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 560px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .proj-actions { width: 100%; }
  .proj-actions .btn { flex: 1; }
  .res-hero b { font-size: 38px; }
  .custom-row, .note-add, .attach-row { flex-direction: column; align-items: stretch; }
  .scen-mini b { font-size: 15px; }
  .tb-right { margin-left: 0; }
}
