/* zapp.css - the shared application layer for every ZEUS page.
 *
 * WHY THIS FILE EXISTS. Before it, eight pages each carried their own full stylesheet with
 * its own palette: the documents page declared a teal/navy system, the chat page another,
 * the social page a third. The shared chrome then had to fight all three with !important,
 * and two of them overflowed the viewport on a phone. The owner's instruction was
 * "the homepage is formatted correctly, apply this formatting throughout", so the homepage's
 * idiom - .wrap, .zh-sec, .zh-head, .zh-btn over the UIP light tokens - is now the only
 * idiom, and this file supplies the components the homepage did not need.
 *
 * LOAD ORDER IS PART OF THE CONTRACT. Every page loads, in this order:
 *   zx.css  base.css  brand-uip.css  home.css  zhome.css  zapp.css
 * base.css is the DARK token set; brand-uip.css redefines the same tokens LIGHT. Anything
 * after it must therefore use var() and never a literal color, or it will be correct on one
 * brand and wrong on the other. The one exception is near-black ink on a gold ground, which
 * is stated literally because gold is a fill in both systems.
 *
 * MOBILE IS A HARD RULE, NOT A PREFERENCE. Nothing here may make the document wider than the
 * viewport at 390px. Wide content scrolls INSIDE its own container (.zx-tbl, .zx-pipe,
 * .zx-scroll); it never pushes the page. Every grid collapses. Long unbroken strings - a
 * token, a URL, an email - get overflow-wrap, because one of those was the entire cause of a
 * 189px overflow on the social page.
 */

/* ---------- layout primitives -------------------------------------------- */
.zx-half{display:grid;grid-template-columns:1fr 1fr;gap:18px;align-items:start;
 margin:0 0 18px;}
.zx-half>.zh-sec{margin:0;height:100%;}
@media(max-width:900px){.zx-half{grid-template-columns:1fr;}}

.zx-g2{display:grid;grid-template-columns:1fr 1fr;gap:14px;}
.zx-g3{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;}
.zx-g4{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;}
@media(max-width:980px){.zx-g3,.zx-g4{grid-template-columns:repeat(2,1fr);}}
@media(max-width:640px){.zx-g2,.zx-g3,.zx-g4{grid-template-columns:1fr;}}

.zx-box{background:var(--panel2);border:1px solid var(--line);border-radius:11px;
 padding:15px 16px;}
.zx-box h3{font-size:14.5px;margin:0 0 6px;color:var(--head);line-height:1.3;}
.zx-box p{font-size:13px;color:var(--ink);margin:0;}
.zx-box p+p{margin-top:8px;}
.zx-box .zh-btn{margin-top:12px;padding:9px 16px;font-size:11.5px;}

.zx-sub{font-size:13.5px;color:var(--muted);margin:0 0 14px;max-width:84ch;}
.zx-lab{font-size:11px;letter-spacing:.11em;text-transform:uppercase;color:var(--muted);
 font-weight:700;margin:20px 0 9px;display:block;}

/* ---------- miniZEUS in a half-width frame ------------------------------- */
/* home.css lays the ask box out as two columns, which is right on the homepage where the
   drop zone sits beside it. In a half-width frame there is no room for two, so the stack
   variant puts the log above the input and lets the frame stay narrow. */
.az-stack{display:block;}
.az-stack .az-log{height:214px;}
.zx-half .az-drop{padding:26px 16px;}

/* The homepage runs the ask box inside the narrower of two columns. Two columns inside one
   column leaves the drop zone about 150px wide and its sentence breaks every third word, so
   inside .zh-two it stacks. Caught by looking at the render, not by any markup check. */
.zh-two .az{grid-template-columns:1fr;}

/* ---------- empty / offline state ---------------------------------------- */
/* A figure with no source behind it shows this, never an invented number. The page is live
   and waiting for data; it does not pretend to hold any. */
.zx-state{background:var(--panel2);border:1px solid var(--line2);border-left:3px solid var(--gold);
 border-radius:10px;padding:15px 17px;}
.zx-state h3{font-size:14px;margin:0 0 5px;color:var(--head);}
.zx-state p{font-size:13px;color:var(--muted);margin:0;max-width:80ch;}
.zx-state.off{border-left-color:var(--line2);}
.zx-state.bad{border-left-color:var(--bad);}
.zx-empty{color:var(--muted);font-weight:400;}

/* ---------- metric row ---------------------------------------------------- */
.zx-mets{display:grid;grid-template-columns:repeat(4,1fr);gap:13px;}
@media(max-width:860px){.zx-mets{grid-template-columns:repeat(2,1fr);}}
.zx-met{background:var(--panel2);border:1px solid var(--line);border-top:3px solid var(--gold);
 border-radius:10px;padding:14px 15px;}
.zx-met .v{font-size:25px;font-weight:700;color:var(--head);line-height:1.15;
 overflow-wrap:anywhere;}
.zx-met .l{font-size:11.5px;color:var(--muted);margin-top:5px;}

/* ---------- tables -------------------------------------------------------- */
/* Wide tables scroll inside this box. They must never widen the document: the render gate
   measures the page at 390px and two pages used to fail it here. */
.zx-tbl{overflow-x:auto;-webkit-overflow-scrolling:touch;border:1px solid var(--line);
 border-radius:11px;background:var(--ground);}
.zx-tbl table{width:100%;min-width:620px;border-collapse:collapse;font-size:13px;}
.zx-tbl th{background:var(--head);color:#fff;text-align:left;font-size:10.5px;
 letter-spacing:.08em;text-transform:uppercase;padding:10px 13px;font-weight:700;
 white-space:nowrap;}
.zx-tbl td{padding:11px 13px;border-top:1px solid var(--line);vertical-align:middle;
 color:var(--ink);}
.zx-tbl tbody tr:hover td{background:var(--panel2);}
.zx-tbl td b{color:var(--head);}
.zx-tbl td small{display:block;font-size:11px;color:var(--muted);overflow-wrap:anywhere;}
.zx-tbl .num{text-align:right;white-space:nowrap;}

.zx-av{display:inline-flex;width:26px;height:26px;border-radius:50%;background:var(--head);
 color:#fff;align-items:center;justify-content:center;font-size:10.5px;font-weight:700;
 margin-right:8px;flex:none;}

.zx-chip{display:inline-block;font-size:10.5px;font-weight:700;letter-spacing:.04em;
 padding:3px 9px;border-radius:999px;border:1px solid var(--line2);color:var(--muted);
 white-space:nowrap;}
.zx-chip.ok{color:var(--ok);border-color:var(--ok);}
.zx-chip.warn{color:var(--warn);border-color:var(--warn);}
.zx-chip.bad{color:var(--bad);border-color:var(--bad);}
.zx-chip.key{color:var(--head);border-color:var(--head);}
.zx-chip.hid{color:var(--teal);border-color:var(--teal);}

/* ---------- buttons / controls -------------------------------------------- */
.zx-btn{display:inline-block;padding:9px 16px;border-radius:7px;font-size:11.5px;
 font-weight:700;letter-spacing:.06em;text-transform:uppercase;text-decoration:none;
 border:1px solid var(--line2);background:var(--ground);color:var(--head);cursor:pointer;
 font-family:inherit;}
.zx-btn:hover{border-color:var(--gold);}
.zx-btn.p{background:var(--gold);color:#1a1204;border-color:var(--gold);}
.zx-btn.p:hover{background:#b9962f;}
.zx-btn.sm{padding:6px 11px;font-size:10.5px;letter-spacing:.04em;}
.zx-btn[disabled]{opacity:.5;cursor:not-allowed;}
.zx-acts{display:flex;gap:7px;flex-wrap:wrap;}

.zx-tabrow{display:flex;gap:6px;flex-wrap:wrap;margin:0 0 16px;}
.zx-tab{padding:9px 15px;border-radius:7px;border:1px solid var(--line2);
 background:var(--ground);color:var(--head);font-size:12.5px;font-weight:700;cursor:pointer;
 font-family:inherit;}
.zx-tab.on{background:var(--head);color:#fff;border-color:var(--head);}

.zx-form{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:start;}
@media(max-width:560px){.zx-form{grid-template-columns:1fr;}}
.zx-in,.zx-form input,.zx-form select,.zx-form textarea{width:100%;background:var(--ground);
 color:var(--ink);border:1px solid var(--line2);border-radius:8px;padding:9px 11px;
 font-family:inherit;font-size:13px;}
.zx-row{display:flex;gap:9px;flex-wrap:wrap;align-items:center;margin:0 0 9px;}
.zx-row label{font-size:12.5px;color:var(--muted);min-width:150px;}
.zx-row input[type=number]{max-width:92px;}
.zx-hint{font-size:11.5px;color:var(--muted);margin:8px 0 0;line-height:1.5;
 overflow-wrap:anywhere;}
.zx-hint code,code{background:var(--panel2);border-radius:4px;padding:1px 5px;
 font-family:Consolas,ui-monospace,monospace;font-size:11.5px;color:var(--head);
 overflow-wrap:anywhere;}

/* ---------- list rows ----------------------------------------------------- */
.zx-rows{display:flex;flex-direction:column;gap:8px;}
.zx-r{display:flex;align-items:center;gap:11px;border:1px solid var(--line);
 border-radius:9px;padding:9px 12px;background:var(--ground);flex-wrap:wrap;}
.zx-r .t{flex:1 1 180px;min-width:0;}
.zx-r .t b{display:block;font-size:13.5px;color:var(--head);overflow-wrap:anywhere;}
.zx-r .t small{font-size:11.5px;color:var(--muted);overflow-wrap:anywhere;}

/* ---------- pipeline board ------------------------------------------------ */
.zx-pipe{display:flex;gap:13px;overflow-x:auto;-webkit-overflow-scrolling:touch;
 padding:2px 2px 10px;}
.zx-col{flex:0 0 224px;background:var(--panel2);border:1px solid var(--line);
 border-radius:11px;padding:12px;display:flex;flex-direction:column;gap:9px;}
.zx-col>h3{font-size:12.5px;margin:0;color:var(--head);display:flex;
 justify-content:space-between;align-items:center;gap:8px;}
.zx-col>p{font-size:11.5px;color:var(--muted);margin:0;}
.zx-col .zx-state{padding:11px 12px;background:var(--ground);}
.zx-col .zx-state h3{font-size:12.5px;}
.zx-col .zx-state p{font-size:11.5px;}

/* ---------- calendar ------------------------------------------------------ */
.zx-cal{display:grid;grid-template-columns:repeat(7,1fr);gap:9px;}
@media(max-width:1000px){.zx-cal{grid-template-columns:repeat(3,1fr);}}
@media(max-width:620px){.zx-cal{grid-template-columns:1fr;}}
.zx-day{background:var(--panel2);border:1px solid var(--line);border-radius:10px;
 padding:11px;display:flex;flex-direction:column;gap:8px;min-width:0;}
.zx-day>.d{font-size:11px;letter-spacing:.08em;text-transform:uppercase;
 color:var(--muted);font-weight:700;}
.zx-day textarea{width:100%;min-height:74px;resize:vertical;background:var(--ground);
 color:var(--ink);border:1px solid var(--line2);border-radius:7px;padding:7px 8px;
 font-family:inherit;font-size:12.5px;}
.zx-day select{width:100%;}
.zx-day .zx-acts{margin-top:auto;}
.zx-canvas{max-width:100%;height:auto;border:1px solid var(--line);border-radius:8px;
 display:block;margin-top:9px;}

/* ---------- chat surface -------------------------------------------------- */
.zx-chat{display:grid;grid-template-columns:230px 1fr;gap:14px;align-items:start;}
@media(max-width:820px){.zx-chat{grid-template-columns:1fr;}}
.zx-rail{background:var(--panel2);border:1px solid var(--line);border-radius:11px;
 padding:10px;display:flex;flex-direction:column;gap:5px;}
.zx-rail button{text-align:left;background:transparent;border:0;border-radius:7px;
 padding:9px 11px;font-size:13px;color:var(--head);cursor:pointer;font-family:inherit;
 overflow-wrap:anywhere;}
.zx-rail button.on{background:var(--ground);border:1px solid var(--line2);font-weight:700;}
.zx-pane{background:var(--panel2);border:1px solid var(--line);border-radius:11px;
 padding:13px;min-width:0;}
.zx-msgs{height:320px;overflow-y:auto;display:flex;flex-direction:column;gap:11px;
 padding-right:4px;}
.zx-msg{background:var(--ground);border:1px solid var(--line);border-radius:9px;
 padding:9px 11px;}
.zx-msg .w{font-size:11px;letter-spacing:.07em;text-transform:uppercase;color:var(--teal);
 font-weight:700;}
.zx-msg .x{font-size:13px;color:var(--ink);white-space:pre-wrap;overflow-wrap:anywhere;}
.zx-msg.me{border-left:3px solid var(--teal);}

/* ---------- drafts / preformatted ---------------------------------------- */
.zx-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch;}
.zx-pre{background:var(--panel2);border:1px solid var(--line);border-radius:9px;
 padding:12px 13px;font-family:Consolas,ui-monospace,monospace;font-size:12px;
 color:var(--ink);white-space:pre-wrap;overflow-wrap:anywhere;margin:0;}

/* ---------- phase ladder (strategic action dashboard) -------------------- */
.zx-ladder{list-style:none;margin:0;padding:0;counter-reset:ph;}
.zx-ladder li{counter-increment:ph;position:relative;padding:0 0 18px 48px;
 border-left:2px solid var(--line);}
.zx-ladder li:last-child{border-left-color:transparent;padding-bottom:0;}
.zx-ladder li::before{content:counter(ph);position:absolute;left:-14px;top:0;width:26px;
 height:26px;border-radius:50%;background:var(--ground);border:2px solid var(--line2);
 color:var(--muted);font:700 11px/23px Arial,Helvetica,sans-serif;text-align:center;}
.zx-ladder li.done::before{background:var(--ok);border-color:var(--ok);color:#fff;
 content:"\2713";}
.zx-ladder li.now::before{background:var(--head);border-color:var(--head);color:#fff;}
.zx-ladder h3{font-size:14.5px;margin:0 0 3px;color:var(--head);}
.zx-ladder p{font-size:13px;color:var(--muted);margin:0;max-width:82ch;}

/* ---------- demo-variant sample marker ----------------------------------- */
/* The market-capture site keeps its sample records, and they stay labeled. The label is
   removed by supplying real data, never by editing the label out. */
.zx-demobar{max-width:1300px;margin:12px auto 0;padding:11px 18px;border-radius:10px;
 background:#FBF3DC;border:1px solid var(--gold);color:#5f4a0c;font-size:12.5px;
 line-height:1.55;}
.zx-demobar b{display:block;font-size:11px;letter-spacing:.1em;text-transform:uppercase;
 margin-bottom:3px;}
.zx-smp{display:inline-block;font-size:10px;letter-spacing:.1em;text-transform:uppercase;
 font-weight:700;color:#7a5c00;background:#FBF3DC;border:1px solid var(--gold);
 border-radius:999px;padding:3px 9px;vertical-align:middle;margin-left:9px;}

/* ---------- definition grid (account, billing) --------------------------- */
.zx-dl{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:15px;
 margin:14px 0 0;padding-top:13px;border-top:1px solid var(--line);}
.zx-dl dt{font-size:10px;letter-spacing:.11em;text-transform:uppercase;color:var(--muted);
 font-weight:700;margin-bottom:4px;}
.zx-dl dd{margin:0;font-size:14px;color:var(--head);overflow-wrap:anywhere;}
.zx-dl dd small{display:block;font-size:11px;color:var(--muted);font-weight:400;}

/* ---------- misc ---------------------------------------------------------- */
.zx-offscreen{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);
 white-space:nowrap;}
.zx-note{background:var(--panel2);border:1px solid var(--line);border-left:3px solid var(--teal);
 border-radius:9px;padding:13px 15px;font-size:13px;color:var(--ink);margin:14px 0 0;}
.zx-note b{color:var(--head);}
.zx-sec-split{display:grid;grid-template-columns:1fr 1fr;gap:18px;}
@media(max-width:900px){.zx-sec-split{grid-template-columns:1fr;}}
img,svg,canvas,table{max-width:100%;}
.wrap{overflow-x:clip;}

/* ---------- print: landscape plan export --------------------------------- */
/* The owner asked for the social plan to export as a landscape, printable PDF. Print to PDF
   from the browser is the mechanism: @page sets the orientation so the sheet comes out
   landscape without the operator changing a dialog setting. */
@media print{
  @page{size:A4 landscape;margin:12mm;}
  .zx-top,.zx-noprint,footer.z,.zx-demobar{display:none !important;}
  body{background:#fff !important;}
  .zh-sec,.zx-box,.zx-day{box-shadow:none !important;break-inside:avoid;}
  .zx-cal{grid-template-columns:repeat(7,1fr) !important;}
  .zx-day textarea{border:0;min-height:0;height:auto;resize:none;overflow:visible;}
  a[href]::after{content:"";}
}
