/* ==========================================================================
   loco-ui — CLIENT PORTAL LAYER
   Loads AFTER loco-ui.css, which IS this portal's shared design system.

   WHY THIS FILE EXISTS (14 Aug 2026). Until now the portal carried its own
   inline <style> copy of the whole system while loco-ui.css carried another,
   and the two had already drifted: the portal had 47 selectors loco-ui lacked
   (the email log and the rich-reply editor, both added 13 Aug). Spinning up a
   SECOND client portal would have made that a three-way drift, which is why
   the skill says to migrate before the second instance, not after.

   The split was provably safe: of 347 shared selectors, 347 had byte-identical
   bodies. Only two rules differed, and both were the deliberate edits recorded
   in the skill — `.app` (auth gating, restored below) and `:root` (loco-ui adds
   `--muted`, naming the #9aa6ae the portal hardcodes).

   RULE: a SHARED component changes in loco-ui.css and every surface gets it.
   Anything only a client portal has — auth gating, the ticket editor, the
   email log — belongs here.
   ========================================================================== */

/* ---------- auth gating -----------------------------------------------------
   loco-ui.css ships `.app{display:flex}` because the HQ, chat and hub have no
   login wall. The portal does: the app stays hidden until `body.authed`, or the
   client's workspace would flash on screen before the session is checked.    */
.app{display:none}
body.authed .app{display:flex}
body.authed .login{display:none}

body.authed .app{display:flex}
body.authed .login{display:none}
.md-bar{display:flex;align-items:center;gap:4px;flex-wrap:wrap;margin-bottom:6px}
.md-tool{font-family:var(--font-b);font-size:12px;font-weight:600;color:var(--slate);
    background:#fff;border:1px solid var(--line);border-radius:8px;padding:5px 9px;cursor:pointer;
    line-height:1;transition:.12s}
.md-tool:hover{border-color:var(--copper4);color:var(--copper6)}
.md-tool.active{background:var(--copper1);border-color:transparent;color:var(--copper6)}
.md-tool b,.md-tool i{font-size:12.5px}
.md-sep{width:1px;height:18px;background:var(--line);margin:0 3px}
.md-right{margin-left:auto}
.cmt-form textarea.drop{border-color:var(--copper4);box-shadow:0 0 0 3px var(--copper1);
    background:var(--copper1)}
.md-preview{display:none;margin-top:8px;padding:12px 14px;border:1px dashed var(--line);
    border-radius:10px;background:var(--paper)}
.md-preview.on{display:block}
.md-hint{font-family:var(--font-m);font-size:10px;letter-spacing:.04em;color:#9aa6ae;margin-top:6px}
.md-body img.md-img{display:block;max-width:100%;height:auto;margin:10px 0;border-radius:10px;
    border:1px solid var(--line)}
.cmt-b .bx.md-body{font-size:13.5px}
.cmt-b .bx.md-body p{margin:0 0 8px}
.cmt-b .bx.md-body .md-ul,.cmt-b .bx.md-body .md-ol{margin:4px 0 8px}
.admin-only{display:none}
body[data-role="admin"] .admin-only{display:flex}
.badge.sent{color:var(--green);background:var(--green-bg)}
.badge.failed{color:var(--red);background:var(--red-bg)}
.ml-chart{display:flex;align-items:flex-end;gap:3px;height:92px;margin-top:4px}
.ml-day{flex:1;min-width:0;display:flex;flex-direction:column;justify-content:flex-end;gap:2px;height:100%;border-radius:4px;padding-bottom:1px}
.ml-day:hover{background:var(--line2)}
.ml-seg{border-radius:3px;min-height:3px}
.ml-seg.s{background:var(--copper4)}
.ml-seg.f{background:var(--red)}
.ml-zero{height:3px;background:var(--line);border-radius:3px}
.ml-axis{display:flex;justify-content:space-between;font-family:var(--font-m);font-size:10px;color:#9aa6ae;margin-top:9px}
.ml-key{display:flex;gap:16px;align-items:center;font-size:12px;color:var(--slate)}
.ml-key i{width:9px;height:9px;border-radius:3px;display:inline-block;margin-right:6px;vertical-align:-1px}
.ml-tools{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-bottom:16px}
.ml-search{flex:1;min-width:180px;max-width:320px;border:1px solid var(--line);background:#fff;border-radius:9px;padding:9px 13px;font-size:13.5px;font-family:var(--font-b);color:var(--ink)}
.ml-search:focus{outline:none;border-color:var(--copper4)}
.ml-tr{cursor:pointer}
.ml-tr:hover{background:var(--paper)}
.ml-tr.on{background:var(--paper)}
.ml-to{font-weight:600}
.ml-to small{display:block;color:var(--slate);font-weight:400;font-size:12px}
.ml-when{font-family:var(--font-m);font-size:12px;color:var(--slate);white-space:nowrap}
.ml-det>td{background:var(--paper);padding:0 14px 20px}
.ml-err{background:var(--red-bg);color:var(--red);border-radius:var(--r-sm);padding:12px 14px;font-family:var(--font-m);font-size:11.5px;line-height:1.55;white-space:pre-wrap;word-break:break-word}
.ml-meta{display:flex;flex-wrap:wrap;gap:8px 22px;font-size:12.5px;color:var(--slate);margin:14px 0 12px}
.ml-meta b{color:var(--ink);font-weight:600}
.ml-prev{width:100%;height:440px;border:1px solid var(--line);border-radius:var(--r-sm);background:#fff;display:block}
.ml-nobody{background:var(--blue-bg);color:var(--blue);border-radius:var(--r-sm);padding:12px 14px;font-size:13px;line-height:1.55}
@media(max-width:700px){.ml-hide-s{display:none}.ml-prev{height:320px}}

/* ---------- overview callout ----------------------------------------------
   The single thing waiting on the client, shown above the project cards.
   Copper rather than amber: this is a prompt, not a warning, and amber is
   already spoken for by overdue billing. Renders nothing when CLIENT.callout
   is absent, which is the default. */
.callout{display:flex;gap:16px;align-items:flex-start;background:var(--copper1);
  border:1px solid var(--copper4);border-radius:var(--r);padding:20px 22px;margin-bottom:24px}
.callout .co-ic{flex:none;width:34px;height:34px;border-radius:9px;display:grid;place-items:center;
  background:var(--white);border:1px solid var(--copper4);color:var(--copper)}
.callout .co-ic svg{width:17px;height:17px}
.callout .co-b{min-width:0}
.callout .co-k{font-family:var(--font-m);font-size:10px;letter-spacing:.1em;text-transform:uppercase;
  color:var(--copper6);margin:0 0 5px}
.callout h3{font-family:var(--font-d);font-size:16px;font-weight:600;margin:0 0 6px;color:var(--ink)}
.callout .co-b>p:last-of-type{font-size:13.5px;line-height:1.6;color:var(--slate);margin:0}
.callout .co-a{margin-top:14px}
@media(max-width:640px){.callout{padding:16px 16px;gap:12px}}

/* A short plain-English line under a project's title. Carries the status of work
   that has no stepper to describe it (proposed, paused, awaiting a decision). */
.proj-note{font-size:13.5px;line-height:1.6;color:var(--slate);margin:14px 0 0}
