/* Growth Lab desk (command center → Grow → Growth Lab). js/growth-desk.js.
   The command center's paper, ink and petrol; green-teal for winners and
   scaling, burnt orange for losers, violet for Weave, ink for Meta. Every
   button is the same height in a row; nothing scrolls sideways but the table. */
.gd{ --gd-ok:#0B7F8C; --gd-ok-s:#E3F2F3; --gd-bad:#B4460F; --gd-bad-s:#FCEBE0; --gd-weave:#5B3FD6; --gd-weave-s:#EFEBFD;
  --gd-warn:#8A5A00; --gd-warn-s:#FFF1D6; --gd-line:#E6E2DB; --gd-soft:#F6F4F0; --gd-r:16px;
  display:flex; flex-direction:column; gap:18px; color:var(--ink); font-size:14px; line-height:1.45; min-width:0; }
.gd *{ box-sizing:border-box; }
.gd h2,.gd h3{ margin:0; font-family:var(--f-sans); letter-spacing:-.01em; }
.gd h2{ font-size:17px; font-weight:600; } .gd h3{ font-size:15px; font-weight:600; }
.gd p{ margin:0; }
.gd-sub{ display:block; font-size:12.5px; color:var(--muted); }
.gd-muted{ color:var(--muted); }
.gd-vh{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.gd-mark{ width:30px; height:30px; flex:none; }
.gd-empty{ margin:0; padding:26px; border:1px dashed var(--line-2); border-radius:var(--gd-r); text-align:center; color:var(--muted); background:#fff; }
.gd-empty b{ color:var(--ink); }

/* buttons: one height, one shape */
.gd-btn{ display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:38px; padding:0 14px; border-radius:10px; border:1px solid transparent;
  font:600 13px/1 var(--f-sans); white-space:nowrap; cursor:pointer; text-decoration:none; transition:background .15s, border-color .15s, opacity .15s; }
.gd-btn--s{ min-height:34px; padding:0 12px; font-size:12.5px; }
.gd-btn--accent{ background:var(--gd-ok); color:#fff; } .gd-btn--accent:hover{ background:var(--accent-d); }
.gd-btn--ink{ background:var(--ink); color:#fff; } .gd-btn--ink:hover{ background:#2b2926; }
.gd-btn--weave{ background:var(--gd-weave); color:#fff; } .gd-btn--weave:hover{ background:#4A30BF; }
.gd-btn--bad{ background:var(--gd-bad); color:#fff; } .gd-btn--bad:hover{ background:#963A0C; }
.gd-btn--badline{ background:#fff; color:var(--gd-bad); border-color:var(--gd-bad); } .gd-btn--badline:hover{ background:var(--gd-bad-s); }
.gd-btn--ghost{ background:#fff; color:var(--ink); border-color:var(--line-2); } .gd-btn--ghost:hover{ border-color:var(--ink); }
.gd-btn:disabled{ opacity:.55; cursor:default; }
.gd-btn.is-off{ opacity:1; background:var(--gd-soft); color:var(--muted-2); border-color:var(--gd-line); cursor:default; }
.gd-btn:focus-visible,.gd-chip:focus-visible,.gd-ask input:focus-visible{ outline:2px solid var(--ink); outline-offset:2px; }

/* the band and the numbers */
.gd-band{ display:flex; flex-wrap:wrap; gap:8px; }
.gd-pill{ font-size:12px; padding:5px 11px; border-radius:999px; background:#fff; border:1px solid var(--gd-line); color:var(--ink-2); }
.gd-pill--warn{ background:var(--gd-warn-s); border-color:#F3DDB0; color:var(--gd-warn); font-weight:600; }
.gd-kpis{ display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
@media (max-width:900px){ .gd-kpis{ grid-template-columns:repeat(2,minmax(0,1fr)); } }
.gd-kpi{ background:#fff; border:1px solid var(--gd-line); border-radius:14px; padding:14px 16px; display:flex; flex-direction:column; gap:2px; min-width:0; }
.gd-kpi span,.gd-kpi small{ font-size:12px; color:var(--muted); }
.gd-kpi b{ font-size:24px; letter-spacing:-.02em; }

/* cards */
.gd-card{ background:#fff; border:1px solid var(--gd-line); border-radius:var(--gd-r); min-width:0; }
.gd-card__h{ display:flex; flex-wrap:wrap; justify-content:space-between; align-items:flex-end; gap:10px; padding:16px 18px 12px; }
.gd-legend{ display:flex; flex-wrap:wrap; gap:14px; font-size:12px; color:var(--ink-2); }
.gd-legend span{ display:inline-flex; align-items:center; gap:6px; }
.gd-dot{ width:10px; height:10px; border-radius:3px; display:inline-block; } .gd-dot--ok{ background:var(--gd-ok); } .gd-dot--bad{ background:var(--gd-bad); }

/* the agent */
.gd-agent{ overflow:hidden; border-color:#D6E9EB; box-shadow:0 1px 0 rgba(0,0,0,.02), 0 8px 24px -18px rgba(11,127,140,.35); }
.gd-agent__h{ display:flex; align-items:center; gap:12px; padding:14px 18px; border-bottom:1px solid var(--gd-line); }
.gd-agent__h > div{ flex:1; min-width:0; } .gd-agent__h b{ font-size:15px; }
.gd-agent__h .gd-mark{ width:36px; height:36px; }
.gd-need{ font-size:12px; font-weight:600; padding:5px 12px; border-radius:999px; white-space:nowrap; }
.gd-need.is-warn{ background:var(--gd-warn-s); color:var(--gd-warn); } .gd-need.is-ok{ background:var(--gd-ok-s); color:var(--gd-ok); }
.gd-chat{ display:flex; flex-direction:column; gap:14px; padding:16px 18px; max-height:440px; overflow-y:auto; overscroll-behavior:contain; background:linear-gradient(#fff,#fff); }
.gd-msg{ display:flex; gap:10px; align-items:flex-start; max-width:min(760px,100%); }
.gd-msg .gd-mark{ width:26px; height:26px; margin-top:2px; }
.gd-bubble{ background:var(--gd-soft); border-radius:4px 16px 16px 16px; padding:11px 14px; display:flex; flex-direction:column; gap:8px; min-width:0; }
.gd-bubble p{ white-space:pre-line; overflow-wrap:anywhere; }
.gd-msg--me{ align-self:flex-end; } .gd-msg--me p{ background:var(--ink); color:#fff; border-radius:16px 4px 16px 16px; padding:10px 14px; overflow-wrap:anywhere; }
.gd-tag{ align-self:flex-start; font-size:10.5px; font-weight:700; letter-spacing:.07em; padding:3px 8px; border-radius:6px; }
.gd-tag--ok{ background:var(--gd-ok-s); color:var(--gd-ok); } .gd-tag--bad{ background:var(--gd-bad-s); color:var(--gd-bad); }
.gd-tag--weave{ background:var(--gd-weave-s); color:var(--gd-weave); } .gd-tag--meta{ background:#E8EAF0; color:#2B2F3A; }
.gd-tag--warn{ background:var(--gd-warn-s); color:var(--gd-warn); } .gd-tag--plain{ background:#ECE8E1; color:var(--ink-2); }
.gd-acts{ display:flex; flex-wrap:wrap; gap:8px; }
.gd-closed{ font-size:12px; font-weight:600; color:var(--muted); }
.gd-ask{ border-top:1px solid var(--gd-line); padding:12px 18px 16px; display:flex; flex-direction:column; gap:10px; }
.gd-chips{ display:flex; flex-wrap:wrap; gap:8px; }
.gd-chip{ border:1px solid var(--gd-line); background:#fff; color:var(--ink-2); border-radius:999px; padding:0 12px; min-height:32px; font:500 12.5px var(--f-sans); cursor:pointer; }
.gd-chip:hover{ border-color:var(--ink); }
.gd-ask__row{ display:flex; gap:8px; }
.gd-ask input{ flex:1; min-width:0; min-height:44px; border:1px solid var(--line-2); border-radius:12px; padding:0 14px; font:14px var(--f-sans); background:#fff; color:var(--ink); }
.gd-ask .gd-btn{ min-height:44px; padding:0 20px; }

/* the results table */
.gd-scroll{ overflow-x:auto; border-top:1px solid var(--gd-line); }
.gd-table{ min-width:1040px; }
.gd-tr{ display:grid; grid-template-columns:minmax(240px,2.4fr) 1fr .8fr .6fr .6fr .9fr 1.2fr 300px; gap:12px; align-items:center; padding:10px 18px; border-bottom:1px solid #F1EEE9; }
.gd-tr:last-child{ border-bottom:0; }
.gd-tr--h{ padding:9px 18px; background:#FAF8F5; font-size:11px; font-weight:600; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); }
.gd-tr.is-win{ background:#F1F8F8; } .gd-tr.is-lose{ background:#FFF8F3; } .gd-tr.is-off > :not(.gd-do){ opacity:.45; }
.gd-var{ display:flex; align-items:center; gap:12px; min-width:0; }
.gd-var > span:last-child{ display:flex; flex-direction:column; min-width:0; }
.gd-var b,.gd-var small{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; } .gd-var small{ font-size:12.5px; color:var(--muted); }
.gd-thumb{ width:46px; height:46px; flex:none; border-radius:10px; overflow:hidden; background:var(--gd-soft); border:1px solid var(--gd-line); display:flex; align-items:center; justify-content:center; }
.gd-thumb img{ width:100%; height:100%; object-fit:cover; display:block; }
.gd-thumb--l{ width:56px; height:56px; }
.gd-noimg{ font-size:9.5px; color:var(--muted-2); text-align:center; padding:4px; line-height:1.2; }
.gd-roas{ display:flex; align-items:center; gap:8px; } .gd-roas b{ width:32px; font-size:15px; }
.gd-roas i{ flex:1; height:6px; border-radius:3px; background:#EEEAE3; overflow:hidden; } .gd-roas em{ display:block; height:100%; background:var(--muted-2); }
.is-win .gd-roas b{ color:var(--gd-ok); } .is-win .gd-roas em{ background:var(--gd-ok); }
.is-lose .gd-roas b{ color:var(--gd-bad); } .is-lose .gd-roas em{ background:var(--gd-bad); }
.gd-do{ display:flex; align-items:center; gap:6px; flex-wrap:nowrap; }
.gd-badge{ font-size:10.5px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; padding:4px 7px; border-radius:6px; }
.gd-badge--ok{ background:var(--gd-ok); color:#fff; } .gd-badge--bad{ background:var(--gd-bad-s); color:var(--gd-bad); }

/* scale and variations */
.gd-sec{ display:flex; flex-direction:column; gap:12px; }
.gd-sec__h{ display:flex; flex-direction:column; gap:2px; }
.gd-kick{ font-size:11px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; }
.gd-kick--ok{ color:var(--gd-ok); } .gd-kick--weave{ color:var(--gd-weave); }
.gd-proc{ padding:18px; display:flex; flex-direction:column; gap:16px; }
.gd-proc + .gd-proc{ margin-top:12px; }
.gd-proc__h{ display:flex; align-items:center; gap:14px; flex-wrap:wrap; }
.gd-proc__h > div{ flex:1 1 320px; min-width:0; }
.gd-prog > div{ display:flex; justify-content:space-between; font-size:13px; margin-bottom:6px; } .gd-prog span{ color:var(--muted); }
.gd-prog i{ display:block; height:8px; border-radius:4px; background:#EEEAE3; overflow:hidden; } .gd-prog em{ display:block; height:100%; background:var(--gd-ok); transition:width .6s ease; }

.gd-ads{ display:grid; grid-template-columns:repeat(auto-fill,minmax(184px,1fr)); gap:14px; }
.gd-ad{ border:1px solid var(--gd-line); border-radius:14px; overflow:hidden; display:flex; flex-direction:column; background:#fff; }
.gd-ad header{ display:flex; align-items:center; justify-content:space-between; gap:6px; padding:8px 10px; font-size:12px; }
.gd-ad header > span{ display:inline-flex; align-items:center; gap:5px; min-width:0; } .gd-ad header small{ color:var(--muted); }
.gd-ad header .gd-mark{ width:16px; height:16px; }
.gd-ad__f{ position:absolute; right:8px; top:8px; font-style:normal; font-size:10.5px; font-weight:600; color:var(--ink); background:rgba(255,255,255,.94); padding:3px 7px; border-radius:6px; white-space:nowrap; }
.gd-ad__art{ position:relative; aspect-ratio:4 / 5; background:var(--gd-soft); overflow:hidden; display:flex; align-items:center; justify-content:center; }
.gd-ad__art img{ width:100%; height:100%; object-fit:cover; display:block; }
.gd-ad__n{ position:absolute; left:8px; bottom:8px; font-size:10.5px; font-weight:700; background:rgba(255,255,255,.94); padding:3px 7px; border-radius:6px; }
.gd-ad__b{ padding:10px; display:flex; flex-direction:column; gap:8px; flex:1; }
.gd-ad__b > b{ font-size:13px; line-height:1.3; min-height:34px; }
.gd-ad__b .gd-btn,.gd-ad__b .gd-live{ margin-top:auto; width:100%; }
.gd-ad__art.gd-skel{ position:relative; }
.gd-ad__cta{ display:flex; justify-content:space-between; align-items:center; font-size:12px; font-weight:600; background:var(--gd-soft); border-radius:8px; padding:6px 8px; }
.gd-ad__cta small{ font-weight:400; color:var(--muted); }
.gd-live{ display:inline-flex; align-items:center; justify-content:center; min-height:38px; border-radius:10px; background:var(--gd-ok-s); color:var(--gd-ok); font-size:12.5px; font-weight:600; }
.gd-live--weave{ background:var(--gd-weave-s); color:var(--gd-weave); width:100%; margin-top:auto; }
.gd-skel{ color:var(--muted); font-size:12px; background:linear-gradient(100deg,#F3F0EB 30%,#FAF8F5 50%,#F3F0EB 70%); background-size:200% 100%; animation:gd-shine 1.4s linear infinite; }
.gd-skel--w{ width:100%; height:100%; display:flex; align-items:center; justify-content:center; color:var(--gd-weave); font-weight:600; background:linear-gradient(100deg,#F1EEFC 30%,#F9F7FF 50%,#F1EEFC 70%); background-size:200% 100%; }
@keyframes gd-shine{ to{ background-position:-200% 0; } }
@media (prefers-reduced-motion:reduce){ .gd-skel,.gd-skel--w{ animation:none; } }
.gd-line{ display:block; height:10px; border-radius:4px; background:#EFEBE4; width:90%; } .gd-line--s{ width:60%; }
.is-wait .gd-ad__b .gd-btn{ margin-top:auto; }

.gd-weave{ display:flex; flex-wrap:wrap; align-items:center; gap:8px 10px; background:var(--gd-weave-s); border-radius:12px; padding:10px 12px; font-size:13px; }
.gd-weave .gd-mark{ width:20px; height:20px; } .gd-arrow{ color:var(--gd-weave); font-weight:700; }
.gd-w{ width:20px; height:20px; border-radius:6px; background:var(--gd-weave); color:#fff; font-size:11px; font-weight:700; display:inline-flex; align-items:center; justify-content:center; }
.gd-grow{ flex:1; }
.gd-step{ font-size:12px; font-weight:600; padding:5px 10px; border-radius:999px; border:1px solid var(--gd-line); background:#fff; color:var(--muted); }
.gd-step--done{ background:#fff; border-color:#D6E9EB; color:var(--gd-ok); } .gd-step--now{ background:var(--gd-weave); border-color:var(--gd-weave); color:#fff; }
.gd-vars{ display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:14px; }
.gd-var-card{ border:1px solid var(--gd-line); border-radius:14px; overflow:hidden; display:flex; flex-direction:column; }
.gd-var-card__art{ height:200px; background:var(--gd-soft); display:flex; align-items:center; justify-content:center; padding:16px; }
.gd-var-card.is-wait .gd-var-card__art{ padding:0; }
.gd-piece{ display:block; height:100%; width:auto; max-width:100%; border-radius:6px; overflow:hidden; box-shadow:0 6px 16px -8px rgba(0,0,0,.35); background:#fff; }
.gd-piece img{ width:100%; height:100%; object-fit:cover; display:block; }
.gd-var-card__b{ padding:12px 14px 14px; display:flex; flex-direction:column; gap:6px; flex:1; }
.gd-var-card__art{ position:relative; }
.gd-ruler{ position:absolute; right:10px; bottom:10px; font-size:11px; font-weight:700; background:var(--ink); color:#fff; padding:4px 8px; border-radius:6px; }
.gd-vk{ align-self:flex-start; font-size:10.5px; font-weight:700; letter-spacing:.07em; text-transform:uppercase; padding:3px 8px; border-radius:6px; background:var(--gd-weave-s); color:var(--gd-weave); }
.gd-vk--size{ background:var(--gd-ok-s); color:var(--gd-ok); } .gd-vk--layout{ background:#ECE8E1; color:var(--ink-2); }
.gd-var-card__t{ font-size:16px; }
.gd-var-card__n{ font-size:12.5px; margin-top:-4px; }
.gd-specs{ margin:4px 0 0; display:grid; gap:4px; font-size:12.5px; }
.gd-specs > div{ display:grid; grid-template-columns:96px 1fr; gap:8px; }
.gd-specs dt{ color:var(--muted); } .gd-specs dd{ margin:0; min-width:0; overflow-wrap:anywhere; }
.gd-specs mark{ background:var(--gd-weave-s); color:var(--gd-weave); font-weight:600; padding:0 5px; border-radius:4px; }
.gd-prompt{ font-size:12px; color:var(--ink-2); background:var(--gd-soft); border-radius:8px; padding:8px 10px; margin-top:4px; }
.gd-prompt__t{ display:-webkit-box; -webkit-line-clamp:4; -webkit-box-orient:vertical; overflow:hidden; }
.gd-prompt span{ display:block; font-size:10px; font-weight:700; letter-spacing:.07em; text-transform:uppercase; color:var(--muted); margin-bottom:2px; }
.gd-prompt--plain{ background:none; padding:0; }
.gd-var-card__do{ margin-top:auto; padding-top:10px; display:flex; flex-direction:column; gap:8px; }
.gd-var-card__do .gd-btn,.gd-var-card__do .gd-live{ width:100%; margin:0; }

/* the eight ad designs (inside .gd-ad__art, 4:5) */
.gd-cr{ position:absolute; inset:0; overflow:hidden; }
.gd-cr img{ width:100%; height:100%; object-fit:cover; display:block; }
.gd-cr--headline{ display:flex; flex-direction:column; }
.gd-cr--headline img{ flex:1; min-height:0; }
.gd-cr--headline p{ margin:0; padding:12px 12px 30px; font:400 19px/1.1 var(--f-display); }
.gd-cr--before{ display:grid; grid-template-rows:1fr 1fr; }
.gd-cr--before > span{ position:relative; overflow:hidden; }
.gd-cr--before em{ position:absolute; right:8px; top:8px; font-style:normal; font-size:10.5px; font-weight:700; background:rgba(255,255,255,.94); padding:2px 7px; border-radius:6px; }
.gd-cr--before i{ position:absolute; left:50%; top:50%; transform:translate(-50%,-50%) rotate(90deg); width:30px; height:30px; border-radius:50%; background:var(--ink); color:#fff; font-style:normal; font-weight:700; display:flex; align-items:center; justify-content:center; box-shadow:0 0 0 3px #fff; }
.gd-cr--review{ display:flex; flex-direction:column; gap:8px; padding:16px 14px; }
.gd-stars{ color:#E0A100; letter-spacing:2px; font-size:14px; }
.gd-cr--review q{ font:400 19px/1.15 var(--f-display); quotes:"“" "”"; }
.gd-cr--review small{ font-size:11.5px; opacity:.8; }
.gd-cr__pic{ margin-top:auto; width:44%; aspect-ratio:1; border-radius:10px; overflow:hidden; border:3px solid #fff; box-shadow:0 6px 14px -6px rgba(0,0,0,.4); }
.gd-cr__badge{ position:absolute; left:10px; top:10px; width:64px; height:64px; border-radius:50%; display:flex; flex-direction:column; align-items:center; justify-content:center; font-weight:700; font-size:16px; line-height:1; box-shadow:0 4px 12px -4px rgba(0,0,0,.35); }
.gd-cr__badge small{ font-size:10px; font-weight:500; margin-bottom:2px; }
.gd-cr__strip{ position:absolute; left:0; right:0; bottom:0; padding:8px 10px 30px; background:rgba(18,17,16,.78); color:#fff; font-size:11.5px; font-weight:600; text-align:right; }
.gd-cr--grid{ display:grid; grid-template-columns:1fr 1fr; grid-template-rows:1fr 1fr; gap:2px; background:#fff; }
.gd-cr--grid > span{ overflow:hidden; }
.gd-cr--closeup img{ transform:scale(1.9); transform-origin:50% 40%; }
.gd-cr--gift{ display:flex; align-items:center; justify-content:center; }
.gd-cr__frame{ width:70%; aspect-ratio:1; border:6px solid #fff; border-radius:4px; overflow:hidden; transform:rotate(-3deg); box-shadow:0 10px 22px -10px rgba(0,0,0,.5); }
.gd-cr__ribbon{ position:absolute; right:-34px; top:18px; transform:rotate(35deg); background:#B4460F; color:#fff; font-size:10px; font-weight:700; padding:4px 40px; }
.gd-ad__n{ z-index:1; } .gd-ad__f{ z-index:1; }

@media (max-width:640px){
  .gd-proc__h .gd-btn{ width:100%; }
  .gd-ask__row .gd-btn{ padding:0 14px; }
  .gd-ads{ grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .gd-agent__h{ flex-wrap:wrap; }
}
