/* MomentumOS Portal. Mobile first: the base rules are the phone layout (one column, bottom tab bar);
   min-width breakpoints add the sidebar at 768px and more room at 1024px. Tokens match the website
   (momentumos-website/assets/site.css). No inline styles anywhere: the Content Security Policy forbids them. */

:root{
  --navy:#0F172A; --navy-2:#141D36;
  --page:#F4F6FB; --white:#FFFFFF; --line:#E3E7F0; --line-strong:#CBD2E0;
  --ink:#0F172A; --ink-2:#334155; --gray:#64748B; --gray-2:#94A3B8;
  --blue:#2563EB; --blue-deep:#1D4ED8; --blue-dark:#1E3A8A; --blue-tint:#DBEAFE; --blue-wash:#EFF4FF;
  --green-text:#166534; --green-tint:#DCFCE7;
  --yellow-text:#8A5B00; --yellow-tint:#FFF6DB;
  --red:#DC2626; --red-text:#991B1B; --red-tint:#FEE2E2;
  --font-body:"IBM Plex Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  --font-mono:"IBM Plex Mono","SFMono-Regular",Consolas,monospace;
  --r-sm:8px; --r-md:14px; --r-lg:20px;
  --shadow:0 1px 2px rgba(15,23,42,.05),0 24px 60px -24px rgba(30,58,138,.35);
  --top-h:56px; --tab-h:64px;
  --safe-top:env(safe-area-inset-top,0px); --safe-bottom:env(safe-area-inset-bottom,0px);
}

*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{margin:0;font:400 1rem/1.5 var(--font-body);color:var(--ink);background:var(--page);min-height:100vh;min-height:100dvh}
img,svg{max-width:100%}
a{color:var(--blue-deep)}
h1,h2,h3{line-height:1.25;margin:0 0 .5rem}
h1{font-size:1.35rem}
h2{font-size:1.1rem}
p{margin:0 0 1rem}
:focus-visible{outline:3px solid var(--blue);outline-offset:2px}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.muted{color:var(--gray)}
.small{font-size:.875rem}
.mono{font-family:var(--font-mono)}
.stack>*+*{margin-top:1rem}
.skip{position:absolute;left:-999px;top:0;background:#fff;padding:.5rem 1rem;z-index:99}
.skip:focus{left:1rem;top:1rem}

/* ------------------------------------------------------------------ buttons and forms */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:.5rem;min-height:48px;padding:.5rem 1.25rem;
  border-radius:var(--r-sm);border:1px solid transparent;font:600 1rem/1.2 var(--font-body);background:var(--blue);
  color:#fff;text-decoration:none;cursor:pointer;width:100%;text-align:center}
.btn:hover{background:var(--blue-deep)}
.btn-secondary{background:var(--white);color:var(--ink);border-color:var(--line-strong)}
.btn-secondary:hover{background:var(--blue-wash)}
.btn-danger{background:var(--white);color:var(--red-text);border-color:var(--red-tint)}
.btn-danger:hover{background:var(--red-tint)}
.btn-link{background:none;border:0;color:var(--blue-deep);padding:0;min-height:44px;width:auto;font-weight:600}
.btn-link:hover{background:none;text-decoration:underline}
.actions{display:flex;flex-direction:column;gap:.75rem;margin-top:1.25rem}
.field{margin-bottom:1rem}
label,.label{display:block;font-weight:600;margin:0 0 .35rem}
input[type=text],input[type=email],input[type=password],input[type=tel],input[type=search],select,textarea{
  width:100%;min-height:48px;padding:.65rem .8rem;border:1px solid var(--line-strong);border-radius:var(--r-sm);
  font:inherit;font-size:1rem;background:#fff;color:var(--ink)}
input:focus,select:focus,textarea:focus{border-color:var(--blue)}
input.code{font:600 1.6rem/1 var(--font-mono);letter-spacing:.35em;text-align:center;padding-left:.35em}
.hint{color:var(--gray);font-size:.875rem;margin:.35rem 0 0}
.alert{padding:.8rem 1rem;border-radius:var(--r-sm);margin:0 0 1rem;font-size:.95rem}
.alert-error{background:var(--red-tint);color:var(--red-text)}
.alert-ok{background:var(--green-tint);color:var(--green-text)}
.alert-info{background:var(--blue-wash);color:var(--blue-dark)}
.alert-warn{background:var(--yellow-tint);color:var(--yellow-text)}

/* ------------------------------------------------------------------ sign-in pages */
.auth{min-height:100vh;min-height:100dvh;display:flex;flex-direction:column;align-items:center;
  padding:calc(1.25rem + var(--safe-top)) 1rem calc(1.5rem + var(--safe-bottom));
  background:radial-gradient(120% 60% at 50% 0%,#1E3A8A 0%,var(--navy) 60%)}
.auth-brand{margin:.75rem 0 1.25rem}
.auth-brand img{display:block;width:200px;height:auto}
.auth-card{width:100%;max-width:440px;background:#fff;border-radius:var(--r-lg);padding:1.5rem 1.25rem;box-shadow:var(--shadow)}
.auth-card h1{font-size:1.4rem}
.auth-foot{color:var(--gray-2);font-size:.85rem;margin-top:1.25rem;text-align:center}
.auth-foot a{color:#fff}
.qr{display:flex;justify-content:center;margin:1rem 0}
.qr svg{display:block;width:min(240px,100%);height:auto;aspect-ratio:1}
.secret{font:600 1rem/1.6 var(--font-mono);letter-spacing:.05em;word-break:break-all;background:var(--page);
  border-radius:var(--r-sm);padding:.6rem .75rem;text-align:center}
.steps{padding-left:1.2rem;margin:0 0 1rem}
.steps li+li{margin-top:.4rem}

/* ------------------------------------------------------------------ app shell: phone */
.shell{min-height:100vh;min-height:100dvh;display:flex;flex-direction:column}
.topbar{position:sticky;top:0;z-index:20;display:flex;align-items:center;gap:.75rem;
  min-height:calc(var(--top-h) + var(--safe-top));padding:var(--safe-top) 1rem 0;background:var(--navy);color:#fff}
.topbar-logo{display:flex;align-items:center;flex:none}
.topbar-logo img{display:block;height:24px;width:auto}
.topbar-title{flex:1;min-width:0;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  text-align:right;font-size:.95rem;color:#E2E8F0}
.avatar{flex:none;display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:50%;
  background:var(--blue);color:#fff;font-weight:600;font-size:.85rem;text-decoration:none}
.sidenav{display:none}
.content{flex:1;width:100%;max-width:1100px;margin:0 auto;
  padding:1rem 1rem calc(var(--tab-h) + 1.5rem + var(--safe-bottom))}
.tabbar{position:fixed;left:0;right:0;bottom:0;z-index:30;display:grid;grid-auto-flow:column;grid-auto-columns:1fr;
  min-height:calc(var(--tab-h) + var(--safe-bottom));padding-bottom:var(--safe-bottom);background:#fff;
  border-top:1px solid var(--line)}
.tabbar a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:48px;
  font-size:.72rem;font-weight:500;color:var(--gray);text-decoration:none}
.tabbar a[aria-current=page]{color:var(--blue-deep)}
.tabbar svg,.sidenav svg{width:24px;height:24px;flex:none}

/* ------------------------------------------------------------------ app shell: tablet and desktop */
@media (min-width:768px){
  .shell{display:grid;grid-template-columns:232px minmax(0,1fr);grid-template-rows:auto 1fr}
  .topbar{grid-column:1/-1;grid-row:1;padding:0 1.5rem}
  .topbar-logo img{height:28px}
  .sidenav{grid-column:1;grid-row:2;display:flex;flex-direction:column;gap:2px;padding:1rem .75rem;background:#fff;
    border-right:1px solid var(--line);position:sticky;top:var(--top-h);height:calc(100vh - var(--top-h));
    height:calc(100dvh - var(--top-h));overflow-y:auto}
  .sidenav a,.sidenav button{display:flex;align-items:center;gap:.75rem;width:100%;min-height:44px;padding:.6rem .75rem;
    border-radius:var(--r-sm);color:var(--ink-2);text-decoration:none;font:500 .95rem/1.2 var(--font-body);
    background:none;border:0;cursor:pointer;text-align:left}
  .sidenav a:hover,.sidenav button:hover{background:var(--page)}
  .sidenav a[aria-current=page]{background:var(--blue-wash);color:var(--blue-deep)}
  .sidenav .spacer{flex:1}
  .tabbar{display:none}
  .content{grid-column:2;grid-row:2;padding:1.5rem 2rem 2rem;margin:0}
  h1{font-size:1.6rem}
  .actions{flex-direction:row;flex-wrap:wrap}
  .actions .btn{width:auto}
  .auth{justify-content:center}
  .auth-card{padding:2rem}
}
@media (min-width:1024px){
  .shell{grid-template-columns:256px minmax(0,1fr)}
  .content{padding:2rem 2.5rem 2.5rem}
}

/* ------------------------------------------------------------------ page parts */
.page-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.75rem;margin-bottom:1.25rem}
.page-head h1{margin:0}
.page-head .btn{width:auto}
.card{background:#fff;border:1px solid var(--line);border-radius:var(--r-md);padding:1rem}
.card+.card{margin-top:1rem}
.card h2{margin-bottom:.75rem}
@media (min-width:768px){.card{padding:1.25rem 1.5rem}}
.grid-2{display:grid;gap:1rem}
@media (min-width:1024px){.grid-2{grid-template-columns:1fr 1fr;align-items:start}.grid-2 .card+.card{margin-top:0}}
.form-row{display:grid;gap:0 1rem}
@media (min-width:768px){.form-row{grid-template-columns:repeat(auto-fit,minmax(200px,1fr))}}

.badge{display:inline-block;padding:.15rem .55rem;border-radius:999px;font-size:.78rem;font-weight:600;
  background:var(--page);color:var(--ink-2);white-space:nowrap}
.badge-ok{background:var(--green-tint);color:var(--green-text)}
.badge-warn{background:var(--yellow-tint);color:var(--yellow-text)}
.badge-off{background:var(--red-tint);color:var(--red-text)}
.badge-info{background:var(--blue-tint);color:var(--blue-dark)}

/* Lists that are rows on a phone and stay rows on desktop */
.rows{list-style:none;margin:0;padding:0;background:#fff;border:1px solid var(--line);border-radius:var(--r-md);overflow:hidden}
.rows li+li{border-top:1px solid var(--line)}
.row{display:flex;align-items:center;gap:.75rem;min-height:60px;padding:.75rem 1rem;color:inherit;text-decoration:none}
a.row:hover{background:var(--page)}
.row-main{flex:1;min-width:0}
.row-title{font-weight:600;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.row-sub{display:block;color:var(--gray);font-size:.875rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.row-end{flex:none;display:flex;align-items:center;gap:.5rem}

/* Tables become labelled cards on a phone */
.table{width:100%;border-collapse:collapse;font-size:.95rem}
.table th{text-align:left;font-size:.8rem;text-transform:uppercase;letter-spacing:.04em;color:var(--gray);font-weight:600}
.table th,.table td{padding:.6rem .5rem;border-bottom:1px solid var(--line);vertical-align:top}
@media (max-width:767.98px){
  .table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
  .table,.table tbody,.table tr,.table td{display:block;width:100%}
  .table tr{padding:.5rem 0;border-bottom:1px solid var(--line)}
  .table td{border:0;padding:.2rem 0;display:flex;gap:.75rem}
  .table td::before{content:attr(data-label);flex:0 0 7.5rem;color:var(--gray);font-size:.85rem}
}

.empty{text-align:center;padding:2.5rem 1rem;color:var(--ink-2)}
.empty svg{width:48px;height:48px;color:var(--blue);margin-bottom:.75rem}
.copy{display:flex;flex-direction:column;gap:.5rem}
.copy input{font-family:var(--font-mono);font-size:.9rem}
@media (min-width:768px){.copy{flex-direction:row}.copy .btn{width:auto;flex:none}}
.kv{display:grid;grid-template-columns:auto 1fr;gap:.35rem 1rem;margin:0}
.kv dt{color:var(--gray)}
.kv dd{margin:0;min-width:0;overflow-wrap:anywhere}
.inline-form{display:inline}
details summary{cursor:pointer;font-weight:600;min-height:44px;display:flex;align-items:center}

/* ================================================================== day 2: inbox, alerts, bell */
[hidden]{display:none !important}
.topbar-icon{position:relative;flex:none;display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;
  color:#E2E8F0;border-radius:50%}
.topbar-icon svg{width:24px;height:24px}
.topbar-icon .count{position:absolute;top:4px;right:2px;min-width:18px;height:18px;padding:0 4px;border-radius:9px;
  background:var(--red);color:#fff;font:600 .7rem/18px var(--font-body);text-align:center}
.avatar{position:relative}
.presence{position:absolute;right:-1px;bottom:-1px;width:12px;height:12px;border-radius:50%;border:2px solid var(--navy)}
.presence-online{background:#22C55E}.presence-busy{background:#F5B301}.presence-away{background:var(--gray-2)}
.avatar-muted{background:var(--blue-tint);color:var(--blue-dark)}
.menu-rows{margin-bottom:1rem}
.menu-rows svg{width:24px;height:24px;color:var(--blue);flex:none}
.radio-list{border:0;padding:0;margin:0 0 1rem}
.radio-list label,.check{display:flex;gap:.6rem;align-items:flex-start;font-weight:400;margin:.4rem 0;min-height:32px}
.radio-list input,.check input{width:20px;height:20px;margin-top:2px;flex:none}
fieldset{border:0;padding:0;margin:0 0 1rem;min-width:0}
input[type=time]{width:100%;min-height:48px;padding:.5rem .8rem;border:1px solid var(--line-strong);border-radius:var(--r-sm);font:inherit}

/* The inbox is edge to edge on a phone. */
.content-flush{padding:0 0 calc(var(--tab-h) + var(--safe-bottom))}
.inbox-head{padding:1rem 1rem .25rem}
.inbox-head h1{margin:0}
.chips{display:flex;gap:.5rem;overflow-x:auto;padding:.5rem 1rem .75rem;scrollbar-width:none;-webkit-overflow-scrolling:touch}
.chips::-webkit-scrollbar{display:none}
.chip{flex:none;display:inline-flex;align-items:center;min-height:36px;padding:0 .9rem;border-radius:999px;border:1px solid var(--line-strong);
  background:#fff;color:var(--ink-2);text-decoration:none;font-size:.9rem;font-weight:500;white-space:nowrap}
.chip[aria-current=true]{background:var(--navy);border-color:var(--navy);color:#fff}
.conv-rows{list-style:none;margin:0;padding:0;background:#fff;border-top:1px solid var(--line)}
.conv-rows li+li{border-top:1px solid var(--line)}
.conv{display:flex;gap:.75rem;align-items:flex-start;padding:.85rem 1rem;color:inherit;text-decoration:none;min-height:72px}
.conv:hover{background:var(--page)}
.conv[aria-current=page]{background:var(--blue-wash)}
.conv .avatar{flex:none}
.conv-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.conv-top{display:flex;gap:.5rem;align-items:baseline}
.conv-name{flex:1;min-width:0;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.conv-time{flex:none;color:var(--gray);font-size:.8rem}
.conv-preview{color:var(--gray);font-size:.9rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.conv-tags:empty{display:none}
.conv-tags{display:flex;gap:.35rem;flex-wrap:wrap;margin-top:2px}
.conv.unread .conv-name{font-weight:700}
.conv.unread .conv-preview{color:var(--ink)}
.dot{flex:none;width:10px;height:10px;border-radius:50%;background:var(--blue);margin-top:.45rem}
.more-row{text-align:center;padding:1rem}
.more-row .btn{width:auto}
.list-alert{margin:0 1rem 1rem}
.small-empty{padding:2rem 1rem}

/* Phone: the list, or the open conversation, one at a time. */
.inbox-thread{display:none}
.has-thread .inbox-list{display:none}
.has-thread .inbox-thread{display:flex;flex-direction:column;min-height:calc(100dvh - var(--top-h) - var(--safe-top))}
body.thread-open .tabbar{display:none}
body.thread-open .content-flush{padding-bottom:0}
.thread-head{display:flex;align-items:center;gap:.6rem;padding:.6rem .75rem;background:#fff;border-bottom:1px solid var(--line);
  position:sticky;top:calc(var(--top-h) + var(--safe-top));z-index:10}
.thread-head h1{font-size:1.05rem;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.thread-who{flex:1;min-width:0}
.icon-btn{display:inline-flex;align-items:center;justify-content:center;flex:none;width:44px;height:44px;border-radius:50%;
  border:0;background:none;color:var(--ink-2);cursor:pointer}
.icon-btn:hover{background:var(--page)}
.icon-btn svg{width:22px;height:22px}
.contact-card{background:#fff;border-bottom:1px solid var(--line);padding:0 1rem}
.contact-card summary{font-size:.9rem;color:var(--blue-deep)}
.contact-body{padding:.25rem 0 1rem}
.contact-body .kv{margin-bottom:1rem}
.inline-row{display:flex;gap:.5rem}
.inline-row .btn{width:auto;flex:none}
.assign-form,.note-form{margin-top:.75rem}
.note-form textarea{width:100%;min-height:60px;padding:.6rem .8rem;border:1px solid var(--line-strong);border-radius:var(--r-sm);font:inherit;margin-bottom:.5rem}
.note-form .btn{width:auto}
.note-form .btn svg{width:18px;height:18px}
.timeline{flex:1;padding:1rem .75rem;display:flex;flex-direction:column;gap:.5rem}
.day-sep{text-align:center;margin:.75rem 0 .25rem;color:var(--gray);font-size:.8rem}
.day-sep span{background:var(--page);padding:.15rem .6rem;border-radius:999px}
.msg{display:flex;flex-direction:column;max-width:85%}
.msg-in{align-self:flex-start;align-items:flex-start}
.msg-out{align-self:flex-end;align-items:flex-end}
.bubble{margin:0;padding:.6rem .85rem;border-radius:18px;white-space:pre-wrap;overflow-wrap:anywhere;font-size:.98rem}
.msg-in .bubble{background:#fff;border:1px solid var(--line);border-bottom-left-radius:6px}
.msg-out .bubble{background:var(--blue);color:#fff;border-bottom-right-radius:6px}
.msg-meta{margin:.2rem .4rem 0;color:var(--gray);font-size:.75rem}
.msg-meta .failed{color:var(--red-text);font-weight:600}
.media img{display:block;max-width:240px;max-height:320px;border-radius:14px;margin-top:.25rem;background:var(--line)}
.file{display:inline-block;margin-top:.25rem;padding:.5rem .75rem;border-radius:12px;background:#fff;border:1px solid var(--line);font-size:.9rem}
.note{align-self:stretch;background:var(--yellow-tint);border-radius:12px;padding:.6rem .85rem;font-size:.92rem}
.note p{margin:0;white-space:pre-wrap;overflow-wrap:anywhere}
.note .note-head{color:var(--yellow-text);font-size:.78rem;font-weight:600;margin-bottom:.2rem}
.system{align-self:center;color:var(--gray);font-size:.8rem;margin:.25rem 0;text-align:center}
.composer{position:sticky;bottom:0;background:#fff;border-top:1px solid var(--line);padding:.5rem .5rem calc(.5rem + var(--safe-bottom))}
.composer .alert{margin:.25rem .25rem .5rem}
.composer .hint{margin:0 .5rem .35rem}
.composer-row{display:flex;align-items:flex-end;gap:.25rem}
.composer textarea{flex:1;min-height:44px;max-height:160px;padding:.6rem .85rem;border:1px solid var(--line-strong);border-radius:22px;
  font:inherit;font-size:1rem;resize:none;line-height:1.4}
.composer .send{background:var(--blue);color:#fff}
.composer .send:hover{background:var(--blue-deep)}
.attach{cursor:pointer}
.composer-meta{margin:.25rem .75rem 0;color:var(--gray);font-size:.78rem;display:flex;gap:.75rem;justify-content:space-between;min-height:1.1em}
.thread-empty{display:none}

/* Tablet: the sidebar is in, but a conversation still takes the whole content area. */
@media (min-width:768px){
  .content-flush{padding:0;margin:0;max-width:none}
  .thread-head{top:var(--top-h)}
  .has-thread .inbox-thread{min-height:calc(100dvh - var(--top-h))}
  body.thread-open .content-flush{padding-bottom:0}
}
/* Desktop: list and conversation side by side, each scrolling on its own. */
@media (min-width:1024px){
  .inbox{display:grid;grid-template-columns:360px minmax(0,1fr);height:calc(100dvh - var(--top-h))}
  .inbox-list{display:block !important;overflow-y:auto;border-right:1px solid var(--line);background:#fff}
  .inbox-thread{display:flex !important;flex-direction:column;min-height:0;overflow:hidden}
  .has-thread .inbox-thread{min-height:0}
  .thread-head{position:static}
  .thread-head .back{display:none}
  .timeline{overflow-y:auto}
  .composer{position:static}
  .thread-empty{display:flex;flex:1;flex-direction:column;align-items:center;justify-content:center;color:var(--gray)}
  .thread-empty svg{width:48px;height:48px;color:var(--gray-2)}
  .msg{max-width:70%}
}

/* ================================================================== day 3: Job Done, contacts, reviews */
/* The + button: floats above the tab bar on a phone; from 768px the sidebar's New link takes its place. */
.fab{position:fixed;right:1rem;bottom:calc(var(--tab-h) + var(--safe-bottom) + 1rem);z-index:25;display:inline-flex;
  align-items:center;justify-content:center;width:56px;height:56px;border-radius:50%;background:var(--blue);color:#fff;
  box-shadow:0 6px 20px -6px rgba(30,58,138,.6)}
.fab:hover{background:var(--blue-deep)}
.fab svg{width:26px;height:26px}
body.thread-open .fab{display:none}
@media (max-width:767.98px){.content:has(.fab){padding-bottom:calc(var(--tab-h) + var(--safe-bottom) + 5.5rem)}}
.sidenav-new,.desktop-only{display:none}
@media (min-width:768px){
  .fab{display:none}
  .sidenav .sidenav-new{display:flex;justify-content:center;gap:.5rem;margin-bottom:.75rem;background:var(--blue);color:#fff;
    font-weight:600}
  .sidenav .sidenav-new:hover,.sidenav .sidenav-new[aria-current=page]{background:var(--blue-deep);color:#fff}
  .desktop-only{display:inline-flex}
}

.search-row{display:flex;gap:.5rem;margin-bottom:.25rem}
.search-row .btn{width:auto;flex:none}
.chips-inline{padding:.5rem 0 .75rem;margin:0 -1rem;padding-left:1rem;padding-right:1rem}
@media (min-width:768px){.chips-inline{margin:0;padding-left:0;padding-right:0;flex-wrap:wrap;overflow:visible}}
.rows .row-end .badge{max-width:8rem;overflow:hidden;text-overflow:ellipsis}
@media (max-width:479.98px){.rows .row-end .badge+.badge{display:none}}

.picked{display:flex;align-items:center;gap:.75rem;padding:.75rem;margin-bottom:1rem;background:var(--blue-wash);
  border-radius:var(--r-sm)}
.picked .btn-link{flex:none}
.pick-rows{margin-top:1rem}
.card .inline-row input{flex:1;min-width:0}
.done-card{text-align:center;padding:2rem 1.25rem}
.done-card>svg{width:56px;height:56px;color:var(--green-text);background:var(--green-tint);border-radius:50%;padding:12px;
  margin-bottom:.75rem}
.done-card .actions{justify-content:center}

.contact-head{display:flex;align-items:center;gap:.75rem;margin-bottom:1rem}
.contact-head h1{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.contact-head .icon-btn{margin-left:-.5rem}
@media (min-width:768px){.contact-head .icon-btn{display:none}}
.avatar-lg{width:48px;height:48px;font-size:1.1rem}
.action-strip{margin:0 0 1rem}
.contact-hint{margin:0 0 1rem}
.action-strip .btn svg{width:20px;height:20px}
.tag-list{display:flex;flex-wrap:wrap;gap:.5rem;margin-bottom:.75rem}
.tag-pill{display:inline-flex;align-items:center;gap:.15rem;padding-left:.75rem;border-radius:999px;background:var(--page);
  border:1px solid var(--line);font-size:.9rem;font-weight:500}
.tag-x{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border:0;background:none;
  border-radius:50%;color:var(--gray);font-size:1.2rem;line-height:1;cursor:pointer}
.tag-x:hover{color:var(--red-text);background:var(--red-tint)}
.card>.note+.note,.note-form+.note{margin-top:.75rem}
details.card summary{margin:-.25rem 0}
details.card[open] summary{margin-bottom:.75rem}
.danger-link{margin:1.25rem 0 0;text-align:center}
.danger-link a{color:var(--red-text);display:inline-flex;align-items:center;min-height:44px}

.review{align-items:flex-start}
.review>svg{width:22px;height:22px;flex:none;color:#F5B301;margin-top:2px}
.review-text{display:block;margin:.2rem 0;white-space:pre-wrap;overflow-wrap:anywhere;color:var(--ink-2)}

/* ================================================================== phase 2: Talk to us, setup, console */
.support-head{display:flex;align-items:center;gap:.9rem}
.support-head p{margin:0}
.support-head .row-sub{white-space:normal}
.chat{list-style:none;margin:0 0 1rem;padding:0;display:flex;flex-direction:column;gap:.6rem}
.chat-msg{max-width:85%;padding:.6rem .85rem;border-radius:14px;background:var(--page)}
.chat-mine{align-self:flex-end;background:var(--blue-tint)}
.chat-theirs{align-self:flex-start}
.chat-who{margin:0 0 .15rem;font-size:.78rem;font-weight:600;color:var(--gray)}
.chat-text{margin:0;white-space:pre-wrap;overflow-wrap:anywhere}
.chat-empty{margin:0 0 1rem}
.support-form textarea{width:100%}
.support-form .actions{margin-top:.75rem}
.setup-count{margin:0 0 .5rem}
.setup-bar{display:block;width:100%;height:10px;border:0;border-radius:999px;overflow:hidden;background:var(--line);
  -webkit-appearance:none;appearance:none}
.setup-bar::-webkit-progress-bar{background:var(--line);border-radius:999px}
.setup-bar::-webkit-progress-value{background:var(--blue);border-radius:999px}
.setup-bar::-moz-progress-bar{background:var(--blue);border-radius:999px}
.setup-group{margin:1.5rem 0 .6rem;font-size:1rem}
.setup-row{align-items:flex-start}
.setup-row>svg{width:22px;height:22px;flex:none;color:var(--gray);margin-top:1px}
.setup-done>svg{color:var(--green-text)}
.setup-dot{flex:none;width:12px;height:12px;margin:6px 5px 0;border-radius:50%;border:2px solid var(--blue)}
.setup-next{display:block;color:var(--ink-2);font-size:.92rem;margin-top:.15rem;white-space:normal}
.setup-row .row-title{white-space:normal}
.setup-row a{display:inline-flex;align-items:center;min-height:44px;font-weight:600}
.setup-copy{margin-top:.5rem}
.setup-who{margin:.25rem 0 .1rem}
.setup-help{margin-top:1.25rem}
.card[id],.chat-msg,:target{scroll-margin-top:calc(var(--top-h) + var(--safe-top) + 12px)}
.setup-table td>div{min-width:0}
.golive{margin-bottom:1rem;padding-bottom:1rem;border-bottom:1px solid var(--line)}
.setup-table select,.setup-table input{min-height:44px}
@media (min-width:768px){.setup-table td:first-child{width:45%}.setup-table .row-sub{white-space:normal}}
input[type=color]{width:100%;min-height:48px;padding:4px;border:1px solid var(--line-strong);border-radius:var(--r-sm);background:#fff}

/* ================================================================== phase 3: billing, team, dashboard */
.card h3{font-size:1rem;margin:1.25rem 0 .5rem}
.billing-status p{margin:0 0 .75rem}
.billing-status p:last-child{margin-bottom:0}
.billing-steps{list-style:none;margin:0;padding:0;counter-reset:step}
.billing-steps>li{position:relative;padding:.75rem 0 .75rem 2.5rem;border-top:1px solid var(--line);counter-increment:step}
.billing-steps>li:first-child{border-top:0}
.billing-steps>li::before{content:counter(step);position:absolute;left:0;top:.7rem;width:28px;height:28px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;background:var(--blue-tint);color:var(--blue-dark);font-weight:600;font-size:.9rem}
.billing-steps>li.done::before{content:"✓";background:var(--green-tint);color:var(--green-text)}
.billing-steps .row-title{white-space:normal;margin:.15rem 0 .25rem}
.billing-steps .row-title svg{display:none}
.balance{font-size:2rem;font-weight:700;margin:.25rem 0 .5rem;font-variant-numeric:tabular-nums}
.balance-low{color:var(--red-text)}
.funds-form fieldset{margin:1rem 0 0}
.funds-chips{margin:0 0 .5rem;padding-top:.25rem;flex-wrap:wrap}
.chip-radio{position:relative;margin:0;font-weight:500}
.chip-radio input{position:absolute;opacity:0;width:1px;height:1px}
.chip-radio span{display:inline-flex;align-items:center;min-height:44px;padding:0 1.1rem;border-radius:999px;border:1px solid var(--line-strong);
  background:#fff;cursor:pointer}
.chip-radio input:checked+span{background:var(--navy);border-color:var(--navy);color:#fff}
.chip-radio input:focus-visible+span{outline:3px solid var(--blue);outline-offset:2px}
.recharge-form{margin-top:1.25rem;padding-top:.25rem;border-top:1px solid var(--line)}
.recharge-form .inline-row input{flex:1;min-width:0}
.addon-row{align-items:flex-start}
.addon-about{white-space:normal}
.addon-row .row-end{flex-direction:column;align-items:flex-end;gap:.25rem}
.usage-month{border-top:1px solid var(--line);padding:.25rem 0}
.usage-month:first-of-type{border-top:0}
.usage-month .kv{margin:.25rem 0 .75rem}
.btn:disabled{opacity:.5;cursor:not-allowed}
.payment-element{min-height:200px;margin:.5rem 0 1rem}
.stats{display:grid;gap:1rem;grid-template-columns:repeat(auto-fill,minmax(min(100%,220px),1fr))}
.stats .card+.card{margin-top:0}
.stat h2{font-size:.9rem;color:var(--gray);font-weight:600;margin:0 0 .35rem}
.stat-num{font-size:2rem;font-weight:700;margin:0;font-variant-numeric:tabular-nums;line-height:1.15}
.stat-unit{font-size:1rem;font-weight:500;color:var(--gray)}
.stat-sub{margin:.35rem 0 0;color:var(--ink-2);font-size:.9rem}
.stat-wait{background:var(--page);border-style:dashed}
.team-rows{overflow:visible}
.team-row{align-items:center}
.team-actions{flex:none;position:relative}
.team-actions summary{min-height:44px;padding:0 .75rem;border:1px solid var(--line-strong);border-radius:var(--r-sm);font-weight:500;
  font-size:.9rem;list-style:none}
.team-actions summary::-webkit-details-marker{display:none}
.team-actions[open] summary{background:var(--blue-wash)}
.team-menu{position:absolute;right:0;top:calc(100% + 4px);z-index:20;width:min(280px,80vw);padding:.75rem;background:#fff;
  border:1px solid var(--line);border-radius:var(--r-md);box-shadow:var(--shadow);display:flex;flex-direction:column;gap:.25rem}
.team-menu .inline-row select{flex:1;min-width:0}
.danger-text{color:var(--red-text)}
.owner-tools{margin-top:1rem;border-top:1px solid var(--line);padding-top:.5rem}
.owner-tools form{margin-top:.75rem}
