/* The client portal. Phone-first: a bottom tab bar on phones, a left rail from 900px. Same palette as the CRM. */
@font-face{font-family:Inter;src:url(/fonts/inter.woff2) format("woff2");font-weight:400 700;font-display:swap}
@font-face{font-family:Sora;src:url(/fonts/sora.woff2) format("woff2");font-weight:500 800;font-display:swap}
@font-face{font-family:Michroma;src:url(/fonts/michroma.woff2) format("woff2");font-weight:400;font-display:swap}

:root{
  --bg:#05070e; --surface:#0b0f1d; --surface-2:#10152a; --surface-3:#161c35;
  --line:#1a2038; --line-2:#272e4c;
  --text:#eef0f7; --muted:#99a1bb; --dim:#787f9b;
  --accent:#7b88ff; --accent-bg:rgba(123,136,255,.14);
  --grad:linear-gradient(105deg,#38bdf8 0%,#6d7dff 48%,#8b5cf6 100%);
  --grad-btn:linear-gradient(105deg,#1f9cf0 0%,#5b6cff 46%,#7c4dff 100%);
  --grad-soft:linear-gradient(140deg,rgba(56,189,248,.10),rgba(139,92,246,.16));
  --ok:#34d399; --ok-bg:rgba(52,211,153,.12);
  --warn:#fbbf24; --warn-bg:rgba(251,191,36,.12);
  --bad:#f87171; --bad-bg:rgba(248,113,113,.13);
  --overlay:rgba(2,4,10,.62);
  --toast-bg:#eef0f7; --toast-fg:#05070e;
  --shadow:0 24px 60px -30px rgba(0,0,0,.85);
  --head:Sora,Inter,system-ui,sans-serif;
  --body:Inter,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --brand:Michroma,Sora,system-ui,sans-serif;
  --mono:ui-monospace,SFMono-Regular,"Cascadia Mono",Menlo,Consolas,monospace;
  color-scheme:dark;
}
@media (prefers-color-scheme: light){
  :root{
    --bg:#f4f5fb; --surface:#ffffff; --surface-2:#eef0f8; --surface-3:#e4e7f3;
    --line:#dfe2ee; --line-2:#c9cee2;
    --text:#0c1024; --muted:#525a76; --dim:#6c7391;
    --accent:#4c58e6; --accent-bg:rgba(76,88,230,.10);
    --grad-soft:linear-gradient(140deg,rgba(56,189,248,.10),rgba(139,92,246,.12));
    --ok:#0b8a5f; --ok-bg:rgba(11,138,95,.10);
    --warn:#a8650a; --warn-bg:rgba(217,140,20,.13);
    --bad:#c93a3a; --bad-bg:rgba(201,58,58,.10);
    --overlay:rgba(12,16,36,.40);
    --toast-bg:#0c1024; --toast-fg:#f4f5fb;
    --shadow:0 24px 50px -32px rgba(20,24,60,.45);
    color-scheme:light;
  }
}

*,*::before,*::after{box-sizing:border-box}
[hidden]{display:none!important}
html,body{min-height:100%}
body{margin:0;background:var(--bg);color:var(--text);font:15px/1.55 var(--body);-webkit-font-smoothing:antialiased;padding-top:env(safe-area-inset-top,0px)}
a{color:var(--accent)}
button,input,textarea,select{font:inherit;color:inherit}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:6px}
h1,h2,h3{font-family:var(--head);text-wrap:balance;margin:0;letter-spacing:-.01em}
h1{font-size:1.6rem;line-height:1.2;font-weight:600}
h2{font-size:1.08rem;font-weight:600}
h3{font-size:.95rem;font-weight:600}
p{margin:0}
.sprite{position:absolute;width:0;height:0;overflow:hidden}
.noscript{padding:24px 16px}
.num{font-variant-numeric:tabular-nums}
.mono{font-family:var(--mono);font-size:.88em}
.muted{color:var(--muted)}
.dim{color:var(--dim)}
.small{font-size:.8rem}
.error{color:var(--bad)}
.eyebrow{font-size:.72rem;letter-spacing:.09em;text-transform:uppercase;color:var(--dim);font-weight:600}
.stack-4{display:flex;flex-direction:column;gap:4px}
.stack-8{display:flex;flex-direction:column;gap:8px;min-width:0}
.stack-10{display:flex;flex-direction:column;gap:10px}
.pad-top{padding-top:10px}

/* header */
.top{position:sticky;top:env(safe-area-inset-top,0px);z-index:20;display:flex;align-items:center;gap:12px;padding-block:10px;padding-inline:max(16px,calc((100% - 1180px) / 2 + 16px));background:color-mix(in srgb,var(--bg) 88%,transparent);backdrop-filter:blur(10px);border-bottom:1px solid var(--line)}
.top svg{width:34px;height:auto;flex:none}
.top .who{min-width:0;flex:1;line-height:1.25}
.top .who b{display:block;font-family:var(--head);font-weight:600;font-size:.98rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.top .who span{font-size:.75rem;color:var(--dim);font-family:var(--brand);letter-spacing:.06em}
.avatar{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:var(--surface-3);border:1px solid var(--line-2);font-weight:600;font-family:var(--head);color:var(--text);text-decoration:none;flex:none}

/* shell */
main{width:100%;max-width:860px;margin:0 auto;padding:22px 16px calc(110px + env(safe-area-inset-bottom,0px));display:flex;flex-direction:column;gap:18px}
.view{display:flex;flex-direction:column;gap:18px}
.rail{display:none}
.tabs{position:fixed;left:0;right:0;bottom:0;z-index:20;display:grid;grid-template-columns:repeat(5,1fr);background:var(--surface);border-top:1px solid var(--line);padding:6px 4px calc(6px + env(safe-area-inset-bottom,0px))}
.tab{display:flex;flex-direction:column;align-items:center;gap:3px;padding:6px 2px;border-radius:10px;text-decoration:none;color:var(--dim);font-size:.7rem;font-weight:500}
.tab svg{width:22px;height:22px}
.tab[aria-current="page"]{color:var(--text)}
.tab[aria-current="page"] svg{color:var(--accent)}
@media (min-width:900px){
  .shell{display:grid;grid-template-columns:230px 1fr;max-width:1180px;margin:0 auto}
  .rail{display:flex;flex-direction:column;gap:4px;padding:22px 14px;position:sticky;top:64px;align-self:start}
  .rail .tab{flex-direction:row;gap:12px;font-size:.92rem;padding:10px 12px;color:var(--muted)}
  .rail .tab[aria-current="page"]{background:var(--accent-bg);color:var(--text)}
  .tabs{display:none}
  main{padding:26px 24px 60px;margin:0}
}

/* cards */
.card{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:18px;display:flex;flex-direction:column;gap:14px;min-width:0}
.card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap}
.card-head > div{min-width:0}
.grid2{display:grid;gap:18px;grid-template-columns:1fr}
@media (min-width:640px){.grid2{grid-template-columns:1fr 1fr}}
.section-title{display:flex;flex-direction:column;gap:6px}

/* pills */
.pill{display:inline-flex;align-items:center;gap:6px;font-size:.75rem;font-weight:600;padding:3px 10px;border-radius:999px;white-space:nowrap}
.pill::before{content:"";width:7px;height:7px;border-radius:50%;background:currentColor}
.pill.ok{color:var(--ok);background:var(--ok-bg)}
.pill.warn{color:var(--warn);background:var(--warn-bg)}
.pill.bad{color:var(--bad);background:var(--bad-bg)}
.pill.info{color:var(--accent);background:var(--accent-bg)}

/* buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid var(--line-2);background:var(--surface-2);border-radius:10px;padding:9px 15px;font-weight:600;font-size:.88rem;cursor:pointer;text-decoration:none;color:var(--text)}
.btn:hover{border-color:var(--accent)}
.btn.primary{background:var(--grad-btn);border-color:transparent;color:#fff}
.btn.primary:hover{filter:brightness(1.08)}
.btn.small{padding:5px 11px;font-size:.8rem;border-radius:8px}
.btn.ghost{background:none}
.btn[disabled]{opacity:.5;cursor:not-allowed}
.btn svg{width:16px;height:16px}
.row{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.row.spread{justify-content:space-between}

/* home tiles */
.tiles{display:grid;gap:12px;grid-template-columns:1fr}
@media (min-width:640px){.tiles{grid-template-columns:repeat(3,1fr)}}
.tile{display:flex;flex-direction:column;gap:10px;padding:16px;border-radius:14px;background:var(--surface);border:1px solid var(--line);text-decoration:none;color:var(--text);min-width:0}
.tile:hover{border-color:var(--line-2)}
.tile .t-top{display:flex;align-items:center;justify-content:space-between;gap:8px}
.tile .t-top span:first-child{font-family:var(--head);font-weight:600}
.tile .big{font-family:var(--head);font-size:1.5rem;font-weight:600;line-height:1}
.tile .big.site{font-size:1.05rem;overflow-wrap:anywhere;line-height:1.3}
.tile .sub{font-size:.82rem;color:var(--muted)}

/* notices */
.notice{display:flex;gap:12px;align-items:flex-start;padding:14px 16px;border-radius:14px;border:1px solid color-mix(in srgb,var(--warn) 40%,transparent);background:var(--warn-bg)}
.notice svg{flex:none;width:20px;height:20px;color:var(--warn);margin-top:2px}
.notice p{font-size:.9rem}
.notice.info{border-color:color-mix(in srgb,var(--accent) 35%,transparent);background:var(--accent-bg)}
.notice.info svg{color:var(--accent)}

/* lists */
.list{display:flex;flex-direction:column}
.li{display:flex;align-items:center;gap:12px;padding:12px 0;border-top:1px solid var(--line);min-width:0}
.li:first-child{border-top:0;padding-top:0}
.li:last-child{padding-bottom:0}
.li .main{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.li .main b{font-weight:600;overflow-wrap:anywhere}
.li .main span{font-size:.82rem;color:var(--muted);overflow-wrap:anywhere}
.li .main .more{color:var(--dim)}
.li .end{flex:none;text-align:right;font-size:.82rem;color:var(--muted);display:flex;flex-direction:column;align-items:flex-end;gap:6px}
.li.top-align{align-items:flex-start}
.empty{color:var(--muted);font-size:.88rem}

/* key/value */
.kv{display:grid;grid-template-columns:minmax(110px,auto) 1fr auto;gap:10px 14px;align-items:center;margin:0}
.kv dt{font-size:.82rem;color:var(--muted)}
.kv dd{margin:0;min-width:0;overflow-wrap:anywhere;font-weight:500}
/* On a phone the label sits above its value, so the value and its Copy button get the whole width. */
@media (max-width:560px){
  .kv{grid-template-columns:1fr auto;gap:2px 12px}
  .kv dt{grid-column:1 / -1;padding-top:8px}
  .kv dt:first-child{padding-top:0}
}
.copy{border:1px solid var(--line-2);background:none;border-radius:7px;padding:3px 9px;font-size:.75rem;cursor:pointer;color:var(--muted)}
.copy:hover{color:var(--text);border-color:var(--accent)}

/* meters */
.meter{display:flex;flex-direction:column;gap:6px}
.meter .m-top{display:flex;justify-content:space-between;font-size:.85rem}
.bar{height:8px;border-radius:99px;background:var(--surface-3);overflow:hidden}
.bar i{display:block;height:100%;width:0;border-radius:99px;background:var(--grad);transition:width .4s}
.bar i.over{background:var(--warn)}

/* steps */
ol.steps{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:14px;counter-reset:s}
ol.steps li{counter-increment:s;display:grid;grid-template-columns:28px 1fr;gap:12px;min-width:0}
ol.steps li::before{content:counter(s);width:28px;height:28px;border-radius:50%;display:grid;place-items:center;background:var(--accent-bg);color:var(--accent);font-weight:600;font-size:.82rem;font-family:var(--head)}
ol.steps li > div{min-width:0;display:flex;flex-direction:column;gap:8px}
.path{font-size:.85rem;color:var(--muted)}
.path b{color:var(--text);font-weight:600}

/* forms */
.f{display:flex;flex-direction:column;gap:6px;font-size:.85rem;font-weight:500}
input[type=email],input[type=text],textarea{width:100%;background:var(--surface-2);border:1px solid var(--line-2);border-radius:10px;padding:10px 12px;font-size:.95rem}
textarea{resize:vertical;min-height:96px;line-height:1.5}
input:focus,textarea:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-bg)}
#people-email{flex:1;min-width:180px;width:auto}
.checks{display:flex;flex-wrap:wrap;gap:6px 14px;font-size:.8rem}
.check{display:inline-flex;align-items:center;gap:6px;color:var(--muted)}
.check i{width:16px;height:16px;border-radius:50%;display:grid;place-items:center;font-style:normal;font-size:.65rem;font-weight:700}
.check.ok i{background:var(--ok-bg);color:var(--ok)}
.check.no i{background:var(--bad-bg);color:var(--bad)}
.check.no{color:var(--bad)}
.counter{font-size:.8rem;color:var(--dim)}
.counter.over{color:var(--bad)}
.fixed-text{font-size:.92rem;color:var(--muted);background:var(--surface-3);border:1px dashed var(--line-2);border-radius:10px;padding:8px 12px;font-weight:400}

/* phone bubble */
.bubble-wrap{background:var(--surface-2);border-radius:14px;padding:14px;display:flex;flex-direction:column;gap:6px}
.bubble{align-self:flex-start;max-width:88%;background:var(--surface-3);border-radius:16px 16px 16px 4px;padding:9px 13px;font-size:.88rem;overflow-wrap:anywhere}
.bubble-from{font-size:.72rem;color:var(--dim)}

/* code chip */
.code{display:flex;align-items:center;justify-content:space-between;gap:10px;background:var(--surface-2);border:1px solid var(--line);border-radius:10px;padding:10px 12px}
.code .mono{font-size:1rem;letter-spacing:.02em;overflow-wrap:anywhere}

/* table */
.tbl-wrap{overflow-x:auto}
table{width:100%;border-collapse:collapse;font-size:.86rem;min-width:520px}
th{text-align:left;font-size:.72rem;letter-spacing:.07em;text-transform:uppercase;color:var(--dim);font-weight:600;padding:0 10px 8px 0}
td{padding:10px 10px 10px 0;border-top:1px solid var(--line);vertical-align:top}
td:last-child,th:last-child{padding-right:0}

details.more{border-top:1px solid var(--line);padding-top:12px}
details.more summary{cursor:pointer;font-weight:600;font-size:.88rem;color:var(--muted)}
details.more[open] summary{margin-bottom:10px}

/* catch-all row */
.li.catch{align-items:flex-start}
.catch-more{color:var(--dim)!important}

/* voicemail player */
.vm-btn{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--line-2);background:var(--accent-bg);color:var(--text);border-radius:999px;padding:4px 12px 4px 8px;font-weight:600;font-size:.82rem;cursor:pointer;font-variant-numeric:tabular-nums}
.vm-btn svg{width:16px;height:16px;color:var(--accent)}
.vm-btn:hover,.vm-btn[aria-expanded="true"]{border-color:var(--accent)}
tr.vm-row td{border-top:0;padding-top:0}
.vm{display:flex;flex-wrap:wrap;align-items:center;gap:10px 14px;padding:12px 14px;border-radius:12px;background:var(--surface-2);border:1px solid var(--line)}
.vm-play{width:42px;height:42px;border-radius:50%;border:0;background:var(--grad-btn);color:#fff;display:grid;place-items:center;cursor:pointer;flex:none}
.vm-play svg{width:20px;height:20px}
.vm-mid{flex:1;min-width:180px;display:flex;flex-direction:column;gap:4px}
.vm-mid input[type=range]{width:100%;accent-color:var(--accent);margin:0}
.vm-meta{display:flex;justify-content:space-between;gap:8px;font-size:.76rem;color:var(--dim)}

/* photo upload */
.drop{position:relative;display:flex;align-items:center;gap:14px;padding:16px;border:1.5px dashed var(--line-2);border-radius:12px;cursor:pointer;background:var(--surface-2);font-weight:400}
.drop:hover,.drop.over{border-color:var(--accent);background:var(--accent-bg)}
.drop:focus-within{border-color:var(--accent)}
.drop input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
.drop > svg{width:30px;height:30px;color:var(--accent);flex:none}
.drop b{font-weight:600}
.thumbs{display:grid;grid-template-columns:repeat(auto-fill,minmax(84px,1fr));gap:8px}
.thumbs:empty{display:none}
.thumb{position:relative;aspect-ratio:1;max-width:100%;border-radius:10px;overflow:hidden;background:var(--surface-3);border:1px solid var(--line)}
.thumb img{width:100%;height:100%;object-fit:cover;display:block}
.thumb button{position:absolute;top:4px;right:4px;width:24px;height:24px;border-radius:50%;border:0;background:var(--overlay);color:#fff;cursor:pointer;font-size:.9rem;line-height:1}

/* billing */
.bal{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:8px 16px;padding:14px;border-radius:12px;background:var(--grad-soft)}
.bal .big{font-family:var(--head);font-size:1.6rem;font-weight:600;line-height:1.1}

/* sign-in */
.auth{min-height:100vh;display:grid;place-items:center;padding:32px 16px}
.auth-card{width:100%;max-width:420px;display:flex;flex-direction:column;gap:18px}
.brandline{display:flex;align-items:center;gap:12px}
.brandline svg{width:44px;height:auto}
.brandline span{font-family:var(--brand);font-size:.78rem;letter-spacing:.08em;color:var(--muted)}

/* toast + sheet */
.toast{position:fixed;left:50%;bottom:calc(84px + env(safe-area-inset-bottom,0px));transform:translateX(-50%) translateY(12px);background:var(--toast-bg);color:var(--toast-fg);padding:10px 16px;border-radius:10px;font-weight:600;font-size:.88rem;opacity:0;pointer-events:none;transition:opacity .2s,transform .2s;z-index:60;max-width:calc(100% - 32px)}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
@media (min-width:900px){.toast{bottom:28px}}
.scrim{position:fixed;inset:0;background:var(--overlay);z-index:50;display:grid;place-items:end center}
@media (min-width:640px){.scrim{place-items:center}}
.sheet{width:100%;max-width:520px;background:var(--surface);border:1px solid var(--line-2);border-radius:18px 18px 0 0;padding:20px 18px calc(20px + env(safe-area-inset-bottom,0px));display:flex;flex-direction:column;gap:14px;box-shadow:var(--shadow);max-height:90vh;overflow:auto}
@media (min-width:640px){.sheet{border-radius:18px}}
@media (prefers-reduced-motion:reduce){*{transition:none!important}}
