/* Growth Lab tabs and the Creative factory (js/creative-factory.js). Builds
   on css/growth-desk.css (.gd, .gd-card, .gd-btn, .gd-pill …). */
.gd-tabs{ display:flex; gap:4px; margin:0 0 16px; border-bottom:1px solid var(--line); }
.gd-tabs a{ padding:10px 14px; margin-bottom:-1px; font:600 14px var(--f-sans); color:var(--muted); text-decoration:none; border-bottom:2px solid transparent; }
.gd-tabs a:hover{ color:var(--ink); }
.gd-tabs a.is-on{ color:var(--ink); border-bottom-color:var(--accent); }
.gd-switch{ display:inline-flex; align-items:center; gap:8px; font-size:13px; font-weight:600; cursor:pointer; white-space:nowrap; }
.gd-switch input{ appearance:none; width:36px; height:20px; margin:0; border-radius:999px; background:#D9D3C9; position:relative; cursor:pointer; transition:background .2s; flex:none; }
.gd-switch input::after{ content:""; position:absolute; top:2px; left:2px; width:16px; height:16px; border-radius:50%; background:#fff; transition:transform .2s; }
.gd-switch input:checked{ background:var(--accent); } .gd-switch input:checked::after{ transform:translateX(16px); }
.gd-switch input:focus-visible{ outline:2px solid var(--ink); outline-offset:2px; }

.cf{ display:grid; grid-template-columns:280px minmax(0,1fr); gap:18px; align-items:start; flex-direction:row; }
@media (max-width:900px){ .cf{ grid-template-columns:1fr; } }
.cf-menu{ background:#fff; border:1px solid var(--gd-line); border-radius:var(--gd-r); padding:10px; position:sticky; top:calc(var(--nav-h, 60px) + 12px); max-height:calc(100vh - var(--nav-h, 60px) - 24px); overflow:auto; }
@media (max-width:900px){ .cf-menu{ position:static; max-height:320px; } }
.cf-menu input{ width:100%; min-height:38px; border:1px solid var(--line-2); border-radius:10px; padding:0 12px; font:14px var(--f-sans); margin-bottom:6px; }
.cf-menu__h{ margin:10px 6px 4px; font:700 10.5px var(--f-sans); letter-spacing:.08em; text-transform:uppercase; color:var(--muted); }
.cf-menu__none{ padding:8px; }
.cf-item{ display:flex; gap:10px; align-items:center; width:100%; padding:8px; border:0; border-radius:10px; background:none; text-align:left; cursor:pointer; font:inherit; color:inherit; }
.cf-item:hover{ background:var(--gd-soft); } .cf-item.is-on{ background:var(--gd-ok-s); }
.cf-item:focus-visible{ outline:2px solid var(--ink); outline-offset:-2px; }
.cf-item .gd-thumb{ width:40px; height:40px; }
.cf-item__t{ display:flex; flex-direction:column; min-width:0; }
.cf-item__t b,.cf-item__t small{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; } .cf-item__t small{ color:var(--muted); font-size:12px; }
.cf-item__c{ display:flex; gap:4px; flex-wrap:wrap; margin-top:3px; }
.cf-c{ display:inline-block; font-style:normal; font-size:10.5px; font-weight:600; padding:2px 7px; border-radius:6px; background:#ECE8E1; color:var(--ink-2); }
.cf-c--ok{ background:var(--gd-ok-s); color:var(--gd-ok); } .cf-c--weave{ background:var(--gd-weave-s); color:var(--gd-weave); }

.cf-main{ display:flex; flex-direction:column; gap:16px; min-width:0; }
.cf-head{ display:flex; align-items:center; gap:14px; padding:16px 18px; }
.cf-head > div{ flex:1; min-width:0; } .cf-head h2{ font-size:19px; }
.cf-sec__b{ padding:0 18px 18px; display:flex; flex-direction:column; gap:14px; }
.cf-bar{ display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.cf-h3{ margin:6px 0 0 !important; font-size:14px !important; letter-spacing:.01em; }

.cf-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(170px,1fr)); gap:12px; }
.cf-ad{ border:1px solid var(--gd-line); border-radius:12px; overflow:hidden; display:flex; flex-direction:column; }
.cf-ad.is-best{ border-color:var(--gd-ok); box-shadow:0 0 0 1px var(--gd-ok); }
.cf-ad__art{ position:relative; aspect-ratio:1; background:var(--gd-soft); display:flex; align-items:center; justify-content:center; }
.cf-ad__art img{ width:100%; height:100%; object-fit:cover; display:block; }
.cf-best{ position:absolute; left:8px; top:8px; background:var(--gd-ok); color:#fff; font-size:10.5px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; padding:3px 7px; border-radius:6px; }
.cf-ad__d{ position:absolute; right:8px; bottom:8px; font-style:normal; font-size:10.5px; font-weight:600; background:rgba(255,255,255,.94); padding:3px 7px; border-radius:6px; }
.cf-ad__b{ padding:10px; display:flex; flex-direction:column; gap:4px; flex:1; } .cf-ad__b > b{ font-size:13px; line-height:1.3; } .cf-ad__b .gd-muted{ font-size:12px; }
.cf-kv{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px; margin:6px 0 0; }
.cf-kv div{ background:var(--gd-soft); border-radius:8px; padding:5px 6px; } .cf-kv dt{ font-size:10px; color:var(--muted); } .cf-kv dd{ margin:0; font-weight:700; font-size:13px; }

.cf-comps{ display:flex; flex-direction:column; gap:12px; }
.cf-comp{ display:grid; grid-template-columns:minmax(0,1.3fr) minmax(0,1fr); gap:14px; border:1px solid var(--gd-line); border-radius:12px; padding:12px; }
@media (max-width:700px){ .cf-comp{ grid-template-columns:1fr; } }
.cf-strip{ display:flex; gap:6px; overflow-x:auto; padding-bottom:4px; }
.cf-strip figure{ margin:0; flex:0 0 84px; } .cf-strip img{ width:84px; height:112px; object-fit:cover; border-radius:8px; display:block; border:1px solid var(--gd-line); }
.cf-strip figcaption{ font-size:10.5px; color:var(--muted); text-align:center; margin-top:2px; }
.cf-comp__b{ display:flex; flex-direction:column; gap:6px; min-width:0; } .cf-comp__b p{ font-size:13px; }
.cf-comp__h{ display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
.cf-days{ font-size:11px; font-weight:600; padding:2px 8px; border-radius:999px; background:#ECE8E1; color:var(--ink-2); } .cf-days.is-long{ background:var(--gd-ok-s); color:var(--gd-ok); }
.cf-comp__do{ display:flex; gap:8px; flex-wrap:wrap; margin-top:auto; }
.cf-add{ border:1px solid var(--gd-line); background:var(--gd-soft); border-radius:12px; padding:14px; display:flex; flex-direction:column; gap:4px; }
.cf-add__do{ display:flex; align-items:center; justify-content:flex-end; gap:12px; flex-wrap:wrap; }
.cf-agent{ border-top:1px solid var(--gd-line); padding-top:10px; }
.cf-agent summary{ cursor:pointer; font-weight:600; font-size:13px; } .cf-agent code{ font-size:11.5px; background:var(--gd-soft); padding:1px 5px; border-radius:4px; overflow-wrap:anywhere; }
.cf-agent ol{ padding-left:18px; display:flex; flex-direction:column; gap:6px; }

.cf-ins{ margin:0; padding:0; list-style:none; counter-reset:ins; display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:10px; }
.cf-ins li{ counter-increment:ins; position:relative; border:1px solid var(--gd-line); border-radius:12px; padding:12px 12px 12px 44px; display:flex; flex-direction:column; gap:4px; }
.cf-ins li::before{ content:counter(ins); position:absolute; left:12px; top:12px; width:22px; height:22px; border-radius:50%; background:var(--ink); color:#fff; font-size:12px; font-weight:700; display:flex; align-items:center; justify-content:center; }
.cf-ins p{ font-size:13px; color:var(--ink-2); }
.cf-pb{ border:1px solid var(--gd-line); border-radius:14px; padding:14px; background:#FBFAF8; display:flex; flex-direction:column; gap:12px; }
.cf-pb.is-on{ border-color:#BFE0E3; background:#F4FAFA; }
.cf-pb__h{ display:flex; justify-content:space-between; align-items:flex-start; gap:12px; flex-wrap:wrap; }
.cf-pb__g{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; } @media (max-width:900px){ .cf-pb__g{ grid-template-columns:1fr; } }
.cf-pb h4{ margin:0 0 6px; font-size:11px; letter-spacing:.07em; text-transform:uppercase; color:var(--muted); }
.cf-pb ul{ margin:0; padding-left:16px; font-size:13px; display:flex; flex-direction:column; gap:4px; } .cf-pb p{ display:flex; flex-wrap:wrap; gap:4px; margin:0 0 8px; }
.cf-pb__do{ display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; border-top:1px solid var(--gd-line); padding-top:10px; }

.cf-reads{ display:flex; flex-direction:column; gap:12px; }
.cf-read{ border:1px solid var(--gd-line); border-radius:12px; padding:12px; display:flex; flex-direction:column; gap:10px; }
.cf-read header{ display:flex; gap:10px; align-items:flex-start; flex-wrap:wrap; }
.cf-read header > div:nth-child(2){ display:flex; flex-direction:column; min-width:160px; }
.cf-score{ width:40px; height:40px; flex:none; border-radius:10px; background:var(--ink); color:#fff; font-weight:700; display:flex; align-items:center; justify-content:center; }
.cf-sw{ flex:1 1 300px; display:flex; flex-wrap:wrap; gap:6px; justify-content:flex-end; }
.cf-s,.cf-w{ font-size:11.5px; padding:3px 8px; border-radius:6px; } .cf-s{ background:var(--gd-ok-s); color:var(--gd-ok); } .cf-w{ background:var(--gd-bad-s); color:var(--gd-bad); }
.cf-frames{ display:flex; gap:10px; overflow-x:auto; padding-bottom:4px; }
.cf-frame{ margin:0; flex:0 0 200px; border:1px solid var(--gd-line); border-radius:10px; overflow:hidden; background:#fff; }
.cf-frame__i{ position:relative; aspect-ratio:4 / 5; background:var(--gd-soft); } .cf-frame__i img{ width:100%; height:100%; object-fit:cover; display:block; }
.cf-frame__i em{ position:absolute; left:6px; bottom:6px; font-style:normal; font-size:10.5px; font-weight:700; background:rgba(255,255,255,.94); padding:2px 6px; border-radius:5px; }
.cf-frame dl{ margin:0; padding:8px; display:flex; flex-direction:column; gap:4px; font-size:11.5px; }
.cf-frame dt{ font-size:10px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:var(--muted); } .cf-frame dd{ margin:0; }

/* the outside systems: green when connected, grey when not */
.gd-sys{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin:0 0 14px; }
@media (max-width:760px){ .gd-sys{ grid-template-columns:1fr; } }
.gd-sys__i{ display:grid; grid-template-columns:auto auto 1fr; grid-template-rows:auto auto; align-items:center; column-gap:8px; row-gap:2px; padding:10px 14px; border-radius:12px; border:1px solid #E6E2DB; background:#fff; color:var(--ink); text-decoration:none; min-width:0; }
.gd-sys__i:hover{ border-color:var(--ink); }
.gd-sys__i i{ width:10px; height:10px; border-radius:50%; background:#B8B1A6; box-shadow:0 0 0 3px #EEEBE6; }
.gd-sys__i b{ font-size:14px; }
.gd-sys__i span{ justify-self:end; font-size:11.5px; font-weight:700; padding:3px 9px; border-radius:999px; background:#EEEBE6; color:#5F5A53; white-space:nowrap; }
.gd-sys__i small{ grid-column:1 / -1; font-size:12px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.gd-sys__i.is-on{ border-color:#BFE3CF; background:#F3FBF6; }
.gd-sys__i.is-on i{ background:#1E8E4E; box-shadow:0 0 0 3px #D3F0DF; }
.gd-sys__i.is-on span{ background:#1E8E4E; color:#fff; }

/* your bot */
.cf-bot{ border:1px solid var(--gd-line); border-radius:12px; padding:14px; background:#FBFAF8; display:flex; flex-direction:column; gap:10px; }
.cf-bot__h{ display:flex; justify-content:space-between; align-items:flex-start; gap:10px; flex-wrap:wrap; }
.cf-pill--ok{ background:#F3FBF6; border-color:#BFE3CF; color:#1E7B4E; font-weight:600; }
.cf-steps{ margin:0; padding-left:20px; display:flex; flex-direction:column; gap:12px; font-size:13px; }
.cf-steps li{ display:flex; flex-direction:column; gap:6px; align-items:flex-start; }
.cf-steps li > b{ display:inline; }
.cf-inline{ display:inline-flex; gap:8px; align-items:center; flex-wrap:wrap; }
.cf-inline input{ min-height:34px; border:1px solid var(--line-2); border-radius:10px; padding:0 10px; font:13px var(--f-sans); width:180px; }
.cf-connect{ width:100%; display:flex; flex-direction:column; gap:6px; background:#fff; border:1px solid #F3DDB0; border-radius:10px; padding:10px; }
.cf-connect textarea,.cf-paste textarea{ width:100%; font:12px/1.45 ui-monospace,SFMono-Regular,Menlo,monospace; border:1px solid var(--line-2); border-radius:8px; padding:8px; resize:vertical; background:#fff; }
.cf-paste{ width:100%; display:flex; flex-direction:column; gap:6px; }
