/* Household 360 demo (demos/household-360.html). */
@font-face{font-family:"Geist";src:url("../fonts/geist-latin.woff2") format("woff2");font-weight:400 700;font-display:swap}
:root{
  --bg:#f3f3f5; --surface:#ffffff; --surface-2:#f8f9fb; --line:#e3e6ec; --line-2:#eef0f4;
  --ink:#16213b; --ink-2:#3e4a63; --muted:#5b6580;
  --brand:#0b5cd5; --brand-ink:#0a4fb8; --brand-soft:#eaf2ff; --nav:#16325c; --nav-2:#1d3f72;
  --violet:#7b3fe4; --violet-soft:#f2ebff; --green:#24703d; --green-soft:#e6f4ea;
  --red:#c23934; --red-soft:#fdecea; --amber:#b86e00; --amber-soft:#fff4e0; --teal:#0b8a8a;
  --shadow:0 1px 2px rgba(22,33,59,.06),0 1px 1px rgba(22,33,59,.04);
  box-sizing:border-box;
  padding-top:env(safe-area-inset-top,0px); padding-bottom:env(safe-area-inset-bottom,0px);
}
@media (prefers-color-scheme:dark){ :root:not([data-theme="light"]){
  --bg:#0f1420; --surface:#171e2d; --surface-2:#1c2436; --line:#2a3448; --line-2:#222b3d;
  --ink:#e8ecf5; --ink-2:#c3cadb; --muted:#8c96ad; --brand:#5b9dff; --brand-ink:#7fb2ff; --brand-soft:#1b2c4a;
  --nav:#0b1730; --nav-2:#132447; --violet:#a983ff; --violet-soft:#2a2145; --green:#5cc27b; --green-soft:#17301f;
  --red:#ff7a72; --red-soft:#3a1d1c; --amber:#f0b04a; --amber-soft:#3a2c14; --teal:#4fc9c9;
}}
:root[data-theme="dark"]{
  --bg:#0f1420; --surface:#171e2d; --surface-2:#1c2436; --line:#2a3448; --line-2:#222b3d;
  --ink:#e8ecf5; --ink-2:#c3cadb; --muted:#8c96ad; --brand:#5b9dff; --brand-ink:#7fb2ff; --brand-soft:#1b2c4a;
  --nav:#0b1730; --nav-2:#132447; --violet:#a983ff; --violet-soft:#2a2145; --green:#5cc27b; --green-soft:#17301f;
  --red:#ff7a72; --red-soft:#3a1d1c; --amber:#f0b04a; --amber-soft:#3a2c14; --teal:#4fc9c9;
}
*,*::before,*::after{box-sizing:inherit}
html{scroll-padding-top:env(safe-area-inset-top,0px)}
html,body{margin:0;height:100%}
body{background:var(--bg);color:var(--ink);font:13px/1.45 "Geist",Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;-webkit-font-smoothing:antialiased}
button{font:inherit;color:inherit;cursor:pointer}
a{color:var(--brand);text-decoration:none}
a:hover{text-decoration:underline}
:focus-visible{outline:2px solid var(--brand);outline-offset:2px;border-radius:4px}
svg{flex:none}

/* ---------- shell ---------- */
.top{position:sticky;top:0;z-index:20;height:52px;background:var(--nav);display:flex;align-items:center;gap:16px;padding:0 16px;color:#fff}
.logo{width:40px;height:28px;display:grid;place-items:center}
.search{flex:1;max-width:520px;margin:0 auto;display:flex;align-items:center;gap:8px;background:var(--nav-2);border:1px solid rgba(255,255,255,.25);border-radius:6px;padding:7px 12px;color:rgba(255,255,255,.75)}
.search input{all:unset;flex:1;color:#fff}
.top-actions{display:flex;gap:14px;align-items:center}
.avatar{width:30px;height:30px;border-radius:50%;background:#fff;color:var(--nav);display:grid;place-items:center;font-weight:700;font-size:12px}
.layout{display:grid;grid-template-columns:1fr;min-height:calc(100% - 52px)}
.page{padding:16px;min-width:0}

/* ---------- header ---------- */
.card{background:var(--surface);border:1px solid var(--line);border-radius:8px;box-shadow:var(--shadow)}
.hdr{display:flex;align-items:center;gap:12px;padding:4px 4px 14px;flex-wrap:wrap}
.hicon{width:36px;height:36px;border-radius:8px;background:var(--violet);display:grid;place-items:center;color:#fff}
.hdr small{display:block;color:var(--muted);font-size:11px}
.hdr h1{margin:0;font-size:20px;font-weight:700;letter-spacing:-.01em}
.btns{margin-left:auto;display:flex;gap:6px;flex-wrap:wrap}
.btn{border:1px solid var(--line);background:var(--surface);color:var(--brand);border-radius:6px;padding:6px 12px;font-weight:600;font-size:12px;display:inline-flex;align-items:center;gap:6px}
.btn:hover{background:var(--brand-soft)}
.btn.primary{background:var(--brand);color:#fff;border-color:var(--brand)}
.btn[aria-pressed="true"]{background:var(--brand-soft);border-color:transparent}
.kpis{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));padding:12px 0}
.kpi{padding:0 16px;border-right:1px solid var(--line-2)}
.kpi:last-child{border:0}
.kpi span{display:block;color:var(--muted);font-size:11px}
.kpi b{font-size:15px;font-weight:600}
.main{display:grid;grid-template-columns:minmax(0,1fr) 380px;gap:14px;margin-top:14px;align-items:start}
.col{display:flex;flex-direction:column;gap:14px;min-width:0}

/* contacts */
.sec-h{display:flex;align-items:center;gap:10px;padding:12px 16px}
.sec-h h2{margin:0;font-size:14px;font-weight:600}
.sec-h .va{margin-left:auto;font-size:12px;font-weight:500}
.ico{width:24px;height:24px;border-radius:6px;display:grid;place-items:center;color:#fff}
.contacts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;padding:0 16px 14px}
.ct{border:1px solid var(--line);border-radius:8px;padding:10px 12px;display:grid;grid-template-columns:28px 1fr;gap:4px 10px}
.ct .av{width:28px;height:28px;border-radius:6px;background:var(--violet);color:#fff;display:grid;place-items:center}
.ct .nm{display:flex;align-items:center;gap:6px}
.ct>div{min-width:0}
.ct .nm a{font-weight:600}
.ct .role{font-size:11px;color:var(--muted)}
.ct dl{grid-column:1/-1;margin:6px 0 0;display:grid;grid-template-columns:52px 1fr;gap:1px 6px;font-size:12px}
.ct dt{color:var(--muted)}
.ct dd{margin:0;min-width:0;overflow:hidden;text-overflow:ellipsis}
.ct dt,.ct dd{line-height:24px}
.ct dd a{display:inline-block;min-height:24px}   /* a comfortable target for a finger */
.mini{margin-left:auto;display:flex;gap:4px}
.mini button{width:26px;height:24px;border:1px solid var(--line);background:var(--surface);border-radius:5px;display:grid;place-items:center;color:var(--brand)}

/* tabs */
.tabs{display:flex;gap:2px;padding:0 12px;border-bottom:1px solid var(--line);overflow-x:auto}
.tabs button{border:0;background:none;padding:12px 12px 10px;font-weight:500;color:var(--ink-2);white-space:nowrap;border-bottom:3px solid transparent}
.tabs button[aria-selected="true"]{color:var(--brand);border-color:var(--brand);font-weight:600}
.panel{padding:16px}
.panel[hidden]{display:none}

/* activity */
.ah{display:flex;align-items:flex-start;gap:12px;margin-bottom:14px;flex-wrap:wrap}
.ah h3{margin:0;font-size:16px}
.ah p{margin:2px 0 0;color:var(--muted);font-size:12px}
.ah>div:nth-child(2){flex:1 1 240px;min-width:0}
.filters{display:grid;grid-template-columns:1.4fr 1fr 1.5fr repeat(3,1fr) auto;gap:8px;align-items:end;margin-bottom:12px}
.f{min-width:0}
.f label{display:block;font-size:11px;color:var(--ink-2);margin-bottom:3px}
.f input,.f select{width:100%;border:1px solid var(--line);background:var(--surface);color:var(--ink);border-radius:6px;padding:7px 9px;font:inherit;font-size:12px}
.chips{display:flex;gap:4px;border:1px solid var(--line);border-radius:6px;padding:4px;background:var(--surface);min-height:33px;flex-wrap:wrap}
.chip{border:1px solid transparent;border-radius:4px;padding:2px 7px;font-size:11px;font-weight:600;display:inline-flex;align-items:center;gap:4px;opacity:.45}
.chip[aria-pressed="true"]{opacity:1}
.chip.int{background:var(--brand-soft);color:var(--brand)}
.chip.evt{background:var(--violet-soft);color:var(--violet)}
.chip.tsk{background:var(--green-soft);color:var(--green)}
.clear{border:1px solid var(--line);background:var(--surface);color:var(--brand);border-radius:6px;padding:7px 10px;font-size:12px;font-weight:600}
.tbl-wrap{overflow-x:auto;border:1px solid var(--line);border-radius:8px}
table{width:100%;border-collapse:collapse}
th{background:var(--surface-2);text-align:left;font-weight:600;font-size:12px;color:var(--ink-2);padding:9px 10px;border-bottom:1px solid var(--line);white-space:nowrap}
td{padding:9px 10px;border-bottom:1px solid var(--line-2);vertical-align:middle}

/* the activity list: stacked rows that fit any width; on a wide window it turns into a table (end of this sheet) */
.act{border:1px solid var(--line);border-radius:8px;overflow:hidden}
.act-h{display:none}
.item+.item{border-top:1px solid var(--line-2)}
.row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:0 12px;align-items:start;padding:11px 10px 11px 12px;cursor:pointer}
.row:hover{background:var(--surface-2)}
.row.sel{background:var(--brand-soft)}
.c-ic{display:flex;align-items:center;gap:8px}
.dot{width:8px;height:8px;border-radius:50%;flex:none}
.tic{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;color:#fff;flex:none}
.rmain{display:flex;flex-direction:column;gap:4px;min-width:0}
.rtop{display:flex;flex-wrap:wrap;align-items:center;gap:5px 10px}
.c-ttl{flex:1 1 170px;min-width:0}
.c-ttl a{font-weight:600}
.c-ttl small{color:var(--muted);font-size:12px}
.c-ttl small::before{content:" – "}
.rtags{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.c-st{display:flex;align-items:center;gap:6px}
.od{color:var(--red);font-size:11px;font-weight:600}
.rsub{display:flex;flex-wrap:wrap;gap:0 7px;font-size:12px;color:var(--muted)}
.rsub>.c+.c::before{content:"·";margin-right:7px}
.c-when small{font-size:inherit}
.c-when small::before{content:" · "}
.sum{color:var(--ink-2);font-size:12px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.c-chev{all:unset;box-sizing:border-box;width:26px;height:26px;display:grid;place-items:center;border-radius:5px;color:var(--muted);cursor:pointer}
.c-chev:hover{background:var(--line)}
.c-chev:focus-visible{outline:2px solid var(--brand);outline-offset:1px}
.c-chev svg{transition:transform .15s}
.row.opened .c-chev svg{transform:rotate(90deg)}
.badge{display:inline-flex;align-items:center;gap:4px;font-size:11px;font-weight:600;border-radius:4px;padding:3px 7px;white-space:nowrap}
.b-int{background:var(--brand-soft);color:var(--brand)}
.b-evt{background:var(--violet-soft);color:var(--violet)}
.b-tsk{background:var(--green-soft);color:var(--green)}
.b-eml{background:var(--line-2);color:var(--ink-2)}
.row.sel .b-int,.row.sel .proc.has{background:var(--surface)}
.proc{border:1px solid var(--line);border-radius:5px;padding:3px 8px;font-size:11px;font-weight:600;white-space:nowrap;background:var(--surface)}
.proc.has{background:var(--brand-soft);color:var(--brand);border-color:transparent}
.st{display:inline-flex;align-items:center;gap:5px;font-size:11px;font-weight:600;border-radius:4px;padding:3px 8px;white-space:nowrap}
.st-c{background:var(--green-soft);color:var(--green)}
.st-o{background:var(--red-soft);color:var(--red)}
.st-p{background:var(--brand-soft);color:var(--brand)}
.st-o::before,.st-c::before,.st-p::before{content:"";width:7px;height:7px;border-radius:50%;background:currentColor}
.exp{padding:2px 12px 14px}
.xbox{border:1px solid color-mix(in srgb,var(--brand) 35%,var(--line));border-radius:8px;overflow:hidden}
.xsec{padding:12px 14px}
.xsec+.xsec{border-top:1px solid var(--line-2)}
.xsec h4{margin:0 0 8px;font-size:13px;display:flex;align-items:center;gap:7px}
.xsec>p{margin:0;font-size:12px;color:var(--ink-2)}
/* one process: who and where it stands on the first line, its path underneath (the path wraps when space is short) */
.pcs{display:grid;gap:8px}
.pc{border:1px solid var(--line-2);border-radius:6px;padding:9px 10px;min-width:0}
.pc-h{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;font-size:12px;margin-bottom:9px}
.pc-h>b{font-weight:600}
.pc-h .own{margin-left:auto}
.cnum{font-weight:600;display:inline-flex;align-items:center;gap:5px;text-decoration:underline}
.path{display:flex;flex-wrap:wrap;align-items:center;row-gap:7px}
.step{display:inline-flex;align-items:center;gap:6px;font-size:11px;color:var(--muted);white-space:nowrap}
.step:not(:first-child)::before{content:"";width:20px;height:1.5px;background:var(--line);margin:0 2px 0 8px}
.step.reach:not(:first-child)::before{background:var(--brand)}
.step i{width:16px;height:16px;border-radius:50%;border:1.5px solid var(--muted);display:grid;place-items:center;flex:none;background:var(--surface)}
.step.done{color:var(--ink-2)}
.step.done i{background:var(--brand);border-color:var(--brand);color:#fff}
.step.cur{color:var(--brand);font-weight:600}
.step.cur i{border-color:var(--brand);background:radial-gradient(circle,var(--brand) 0 3.5px,var(--surface) 4px)}
.cst{font-size:11px;font-weight:600;border-radius:4px;padding:3px 8px;background:var(--line-2);color:var(--ink-2);white-space:nowrap}
.cst.prog{background:var(--brand-soft);color:var(--brand)}
.cst.closed{background:var(--green-soft);color:var(--green)}
.own{display:flex;align-items:center;gap:7px;white-space:nowrap}
.own b{width:24px;height:24px;border-radius:50%;background:var(--violet-soft);color:var(--violet);font-size:10px;display:grid;place-items:center}
.more{display:flex;justify-content:center;margin-top:12px}
.empty{padding:28px;text-align:center;color:var(--muted)}

/* side panel: its heading and tabs keep their height, only the body underneath scrolls */
.side{position:sticky;top:66px;max-height:calc(100vh - 80px);display:flex;flex-direction:column;overflow:hidden}
.side:focus{outline:none}
.side-h{flex:none;display:flex;gap:10px;padding:14px 14px 0;align-items:flex-start}
.side-h h3{margin:0;font-size:16px;overflow-wrap:anywhere}
.side-h small{color:var(--muted)}
.side-h .ctl{margin-left:auto;display:flex;gap:4px;flex:none}
.side-h .ctl button{border:0;background:none;width:26px;height:26px;border-radius:5px;display:grid;place-items:center;color:var(--ink-2)}
.side-h .ctl button:hover{background:var(--surface-2)}
.side-h .ctl button:disabled{opacity:.35;cursor:default;background:none}
.side .tabs{flex:none;padding:0 8px;margin-top:10px}
.side .tabs button{padding:9px 10px 7px;font-size:12px}
.side-b{flex:1 1 auto;min-height:0;overflow:auto;padding:12px 14px 14px}
.toolbar{display:flex;gap:6px;align-items:center;border:1px solid var(--line);border-bottom:0;border-radius:6px 6px 0 0;padding:5px 8px;background:var(--surface-2);font-size:11px;color:var(--ink-2)}
.toolbar b{border:1px solid var(--line);border-radius:4px;padding:1px 6px;background:var(--surface)}
.toolbar button{border:0;background:none;min-width:22px;height:22px;padding:0 4px;border-radius:4px;font-size:12px}
.toolbar button:hover{background:var(--line)}
.note{border:1px solid var(--line);border-radius:0 0 6px 6px;padding:12px;font-size:12px;color:var(--ink-2)}
.note:focus{outline:none;border-color:var(--brand)}
.note p{margin:0 0 10px}
.note>:last-child{margin-bottom:0}
.note h4{margin:12px 0 4px;font-size:13px;color:var(--ink)}
.note>h4:first-child{margin-top:0}
.note ul{margin:0 0 10px;padding-left:18px}
.subh{display:flex;align-items:center;gap:6px;font-size:13px;font-weight:600;margin:16px 0 8px}
.ai{display:grid;grid-template-columns:18px 1fr auto;gap:8px;align-items:start;padding:5px 0;font-size:12px}
.ai input{margin:2px 0 0;accent-color:var(--brand)}
.ai.done span{text-decoration:line-through;color:var(--muted)}
.ai time{color:var(--muted);white-space:nowrap}
.rel{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.relc{border:1px solid var(--line);border-radius:6px;padding:8px;display:flex;gap:8px;align-items:center;font-size:12px;min-width:0}
.relc>div,.relc>a{min-width:0;overflow-wrap:anywhere}
.relc small{display:block;color:var(--muted)}
.kv{display:grid;grid-template-columns:110px minmax(0,1fr);gap:8px 10px;font-size:12px;margin:0}
.kv dt{color:var(--muted)}
.kv dd{margin:0}
.scrim{display:none}

/* bottom row */
.bottom{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-top:14px}
.opps,.cases{list-style:none;margin:0;padding:0 16px 10px}
.opps li,.cases li{display:grid;gap:1px 10px;align-items:baseline;padding:7px 0;border-bottom:1px solid var(--line-2);font-size:12px}
.opps li:last-child,.cases li:last-child{border:0}
.opps li{grid-template-columns:minmax(0,1fr) auto}
.opps a{font-weight:600}
.opps small{grid-column:1/-1;color:var(--muted)}
.cases li{grid-template-columns:auto minmax(0,1fr)}
.cases li a+a{color:var(--ink);font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cases small{grid-column:2;color:var(--muted)}
.qa{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:0 16px 14px}
.qa button{border:1px solid var(--line);background:var(--surface);border-radius:6px;padding:10px;display:flex;align-items:center;gap:8px;font-weight:600;font-size:12px;text-align:left}
.qa button:hover{border-color:var(--brand)}

/* financial accounts */
.fsum{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:14px}
.fsum div{background:var(--surface-2);border:1px solid var(--line);border-radius:8px;padding:12px}
.fsum span{display:block;font-size:11px;color:var(--muted)}
.fsum b{font-size:17px}
.num{text-align:right;white-space:nowrap}
.acct{min-width:600px}
.acct td:first-child{white-space:nowrap}
.acct .tog{border:0;background:none;padding:0 6px 0 0;color:var(--muted)}
.acct .tog svg{transition:transform .15s}
.acct .tog[aria-expanded="true"] svg{transform:rotate(90deg)}
tr.hold>td{padding:0;background:var(--surface-2)}
.hold-t th,.hold-t td{font-size:12px;padding:8px}
.hold-t td{background:var(--surface-2)}
.hold-t th:first-child,.hold-t td:first-child{padding-left:34px;white-space:normal}
.hold-t tr:last-child td{border-bottom:0}
.alloc{display:flex;height:6px;border-radius:3px;overflow:hidden;width:120px;max-width:100%;background:var(--line);margin-top:4px}
.alloc i{display:block;height:100%}
.pos{display:flex;align-items:center;gap:6px;white-space:nowrap}
.pos i{display:block;height:5px;border-radius:3px;background:var(--brand)}
.gain{color:var(--green);font-weight:600}
.subcards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:14px;align-items:start}
.subcards .card{padding:12px 14px}
.sc-h{display:flex;align-items:center;gap:10px}
.sc-h .btn{margin-left:auto}
.sc-r{display:flex;justify-content:space-between;align-items:baseline;gap:12px;margin-top:10px;padding-top:10px;border-top:1px solid var(--line-2);font-size:12px}
.sc-r>div{min-width:0}
.sc-r a{font-weight:600}
.sc-r small{display:block;color:var(--muted);margin-top:2px}
.sc-r>b{white-space:nowrap}

/* relationships */
.tree{display:flex;flex-direction:column;align-items:center;gap:0}
.grp{border:1px solid var(--line);border-radius:10px;background:var(--surface);padding:12px;width:240px;max-width:100%;min-width:0}
.grp.root{border-color:var(--teal);box-shadow:0 0 0 3px color-mix(in srgb,var(--teal) 14%,transparent)}
.grp h4{margin:0 0 2px;font-size:13px;display:flex;align-items:center;gap:8px}
.grp h4 a,.mem>div{min-width:0;overflow-wrap:anywhere}
.grp>small{display:block;color:var(--muted);margin-bottom:8px;font-size:11px}
.mem{display:flex;align-items:center;gap:8px;border:1px solid var(--line-2);border-radius:6px;padding:6px 8px;margin-top:6px;font-size:12px;background:var(--surface-2)}
.mem small{display:block;color:var(--muted);font-size:11px}
.mem .tag{margin-left:auto;font-size:10px;font-weight:600;color:var(--teal);background:color-mix(in srgb,var(--teal) 12%,transparent);padding:2px 6px;border-radius:4px}
.addrel{width:100%;margin-top:8px;border:1px dashed var(--line);background:none;border-radius:6px;padding:6px;color:var(--brand);font-weight:600;font-size:12px}
.vline{width:2px;height:24px;background:var(--line)}
.kids{display:flex;justify-content:center;align-items:flex-start;width:100%}
.kid{position:relative;flex:0 1 256px;min-width:0;display:flex;flex-direction:column;align-items:center;padding:24px 8px 0}
.kid::before{content:"";position:absolute;top:0;left:0;right:0;border-top:2px solid var(--line)}
.kid:first-child::before{left:50%}
.kid:last-child::before{right:50%}
.kid:only-child::before{display:none}
.kid::after{content:"";position:absolute;top:0;left:calc(50% - 1px);width:2px;height:24px;background:var(--line)}
.kid .grp{text-align:left;width:100%}
@media (max-width:820px){
  .tree{align-items:stretch}
  .tree>.grp{width:100%}
  .tree>.vline{margin-left:24px}
  .kids{flex-direction:column;align-items:stretch;padding-left:24px}
  .kid{flex:none;align-items:stretch;padding:12px 0 0 22px}
  .kid::before{top:0;bottom:0;left:0;right:auto;border-top:0;border-left:2px solid var(--line)}
  .kid:first-child::before{left:0}
  .kid:last-child::before{right:auto;bottom:auto;height:36px}
  .kid:only-child::before{display:block}
  .kid::after{top:34px;left:0;width:22px;height:2px}
  .kid .grp{width:100%}
}
/* goals */
.goal{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:16px;align-items:center;border:1px solid var(--line);border-radius:10px;padding:16px}
.goal+.goal{margin-top:14px}
.goal h4{margin:0;font-size:17px;display:flex;flex-wrap:wrap;gap:6px 10px;align-items:center}
.gnote{font-size:12px;color:var(--muted);margin-top:6px}
.gstats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-top:14px}
.gstats span{display:block;color:var(--muted);font-size:11px}
.gstats b{font-size:14px}
.ring{width:96px;height:96px}
.bar{height:8px;border-radius:4px;background:var(--line);overflow:hidden;margin-top:12px}
.bar i{display:block;height:100%;background:var(--green)}
.plan{border:1px solid var(--line);border-radius:10px;padding:14px 16px;margin-top:14px}
.plan-h{display:flex;flex-wrap:wrap;align-items:center;gap:8px 10px}
.plan ol{margin:10px 0 0;padding-left:0;list-style:none}
.plan li{display:flex;gap:8px;align-items:center;padding:6px 0;border-top:1px solid var(--line-2);font-size:12px}
.due{margin-left:auto;color:var(--muted);white-space:nowrap}
.due.late{color:var(--red);font-weight:600}

/* details */
.dgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 28px}
.fld{border-bottom:1px solid var(--line-2);padding:8px 0;display:flex;justify-content:space-between;gap:8px}
.fld span{display:block;font-size:11px;color:var(--muted)}
.fld>div{min-width:0;overflow-wrap:anywhere}
.fld .ed{border:0;background:none;color:var(--muted);opacity:0}
.fld:hover .ed,.fld .ed:focus-visible{opacity:1}
.dsec{margin:18px 0 6px;font-size:13px;font-weight:600;background:var(--surface-2);border-radius:6px;padding:7px 10px}

.toast{position:fixed;left:50%;bottom:calc(20px + env(safe-area-inset-bottom,0px));transform:translateX(-50%) translateY(20px);max-width:calc(100% - 24px);background:var(--ink);color:var(--bg);padding:9px 16px;border-radius:6px;font-weight:600;font-size:12px;opacity:0;transition:.2s;pointer-events:none;z-index:50}
.toast.on{opacity:1;transform:translateX(-50%) translateY(0)}
[hidden]{display:none!important}

@media (max-width:1280px){.kpis{grid-template-columns:repeat(4,1fr);row-gap:10px}.filters{grid-template-columns:repeat(3,minmax(0,1fr))}}
/* no room for two columns: the notes slide in over the page when an activity is picked */
@media (max-width:1100px){
  .main,.bottom{grid-template-columns:minmax(0,1fr)}
  .side{position:fixed;z-index:40;top:0;right:0;bottom:0;width:min(420px,100%);max-height:none;border-radius:0;border-width:0 0 0 1px;box-shadow:-16px 0 40px rgba(22,33,59,.22);transform:translateX(104%);visibility:hidden;transition:transform .25s ease,visibility 0s .25s}
  .side.open{transform:none;visibility:visible;transition:transform .25s ease}
  .scrim{display:block;position:fixed;inset:0;z-index:39;background:rgba(22,33,59,.4);opacity:0;pointer-events:none;transition:opacity .25s}
  .scrim.on{opacity:1;pointer-events:auto}
}
@media (max-width:760px){
  .layout{grid-template-columns:1fr}.hide-sm{display:none!important}
  .page{padding:12px}
  .contacts,.dgrid,.subcards{grid-template-columns:minmax(0,1fr)}
  .fsum,.gstats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .kpis{grid-template-columns:repeat(2,1fr)}.filters{grid-template-columns:repeat(2,minmax(0,1fr))}
  .btns{margin-left:0}
  /* activity rows: no icon column, the date on its own line */
  .c-ic{display:none}
  .row{grid-template-columns:minmax(0,1fr) auto;gap:0 8px}
  .rsub{display:block}
  .rsub>.c{display:inline}
  .rsub>.c-when{display:block}
  .rsub>.c-own::before{content:none}
  /* the account tables keep to the columns that matter most */
  .x-sm{display:none}
  .acct{min-width:0}
  .acct th,.acct td{padding:8px 6px}
  .acct td:first-child{white-space:normal}
  .hold-t th:first-child,.hold-t td:first-child{padding-left:10px}
  .goal{grid-template-columns:minmax(0,1fr)}.ring{justify-self:start;width:80px;height:80px}
  .pc-h .own{margin-left:0}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important}}

/* a wide window: the activity list becomes a table, one column per field */
@media (min-width:1560px){
  .act-h,.row{display:grid;grid-template-columns:58px 128px 108px minmax(124px,1fr) minmax(170px,2.2fr) minmax(112px,.7fr) 140px 108px minmax(112px,.7fr) 38px;gap:0;align-items:center;padding:0}
  .act-h{background:var(--surface-2);border-bottom:1px solid var(--line);font-weight:600;font-size:12px;color:var(--ink-2);white-space:nowrap}
  .act-h>div{padding:9px 10px}
  .act-h>div:first-child{grid-column:1/3}
  .rmain,.rtop,.rtags,.rsub{display:contents}
  .row .c{grid-row:1;min-width:0;padding:9px 10px;font-size:13px;color:var(--ink)}
  .c-ic{grid-column:1;padding-right:0!important}
  .c-when{grid-column:2;white-space:nowrap}
  .c-type{grid-column:3}.c-ttl{grid-column:4}.c-sum{grid-column:5}.c-rel{grid-column:6}.c-proc{grid-column:7}.c-st{grid-column:8;display:block}.c-own{grid-column:9}
  .c-chev{grid-column:10;grid-row:1;justify-self:center}
  .c-when small,.c-ttl small,.od{display:block}
  .c-when small{color:var(--muted);font-size:11px}
  .c-when small::before,.c-ttl small::before,.rsub>.c+.c::before{content:none}
  .c-rel{color:var(--brand)!important}
  .od{margin-top:3px}
}

/* nothing pushes the page wider than a phone screen */
.search{min-width:0}
.search input{min-width:0;width:0}

/* ---------- colours and sizes that used to be style="" attributes ---------- */
.bg-brand{background:var(--brand)}.bg-violet{background:var(--violet)}.bg-green{background:var(--green)}.bg-teal{background:var(--teal)}
.bg-red{background:var(--red)}.bg-amber{background:var(--amber)}.bg-muted{background:var(--muted)}.bg-sky{background:#1ba1e2}
.bg-orange{background:#e8780b}.bg-pink{background:#e2367a}.bg-teal-fixed{background:#0b8a8a}
.plain-btn{all:unset;cursor:pointer}
.hicon-lg{width:40px;height:40px}
.tic-lg{width:38px;height:38px}.tic-md{width:26px;height:26px}.tic-sm{width:24px;height:24px;border-radius:6px}
.muted{color:var(--muted)}.flush{margin:0}.minw0{min-width:0}.strong{font-weight:600}
.relc-gap{margin-bottom:6px}.push-right{margin-left:auto}
.sec-h-tight{padding:0 0 8px}.sec-h-tight10{padding:0 0 10px}
/* the "this is sample data" line under the top bar */
.sample{margin:0;padding:7px 16px;background:var(--amber-soft);color:var(--ink);border-bottom:1px solid var(--line);font-size:12px;line-height:1.45}
.sample span{color:var(--ink-2)}
