/* On-page edit widget — dev only. Hidden on any host that isn't local/preview/tunnel. */
#gf-edit-launch {
  position: fixed; right: 18px; bottom: 18px; z-index: 9998;
  display: flex; align-items: center; gap: 8px;
  background: #171b1a; color: #f2efe6; border: 1px solid #3a3f3c;
  font: 600 12px/1 'DM Sans', Arial, sans-serif; letter-spacing: .02em;
  padding: 12px 15px; border-radius: 26px; cursor: pointer;
  box-shadow: 0 8px 24px rgba(10, 14, 12, .28);
}
#gf-edit-launch:hover { background: #242927; }
#gf-edit-launch .dot { width: 8px; height: 8px; border-radius: 50%; background: #a38238; }
#gf-edit-launch.has-queue .dot { background: #6fbf73; }

#gf-edit-panel {
  position: fixed; right: 18px; bottom: 18px; z-index: 9999; width: 360px; max-width: calc(100vw - 24px);
  background: #fff; color: #1d211f; border: 1px solid #e2e0d8; border-radius: 10px;
  box-shadow: 0 24px 60px rgba(12, 16, 14, .3);
  font: 13px/1.5 'DM Sans', Arial, sans-serif; display: none; overflow: hidden;
}
#gf-edit-panel.open { display: block; }
#gf-edit-panel header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 15px; background: #171b1a; color: #f2efe6;
}
#gf-edit-panel header b { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
#gf-edit-panel header button {
  background: none; border: 0; color: #cfd6cf; font-size: 17px; line-height: 1; cursor: pointer; padding: 2px 4px;
}
.gf-body { padding: 14px 15px 16px; max-height: min(70vh, 560px); overflow-y: auto; }
.gf-hint { font-size: 11px; color: #7d8a80; margin: 0 0 10px; }
.gf-body textarea {
  width: 100%; min-height: 92px; resize: vertical; padding: 10px 11px;
  border: 1px solid #e2e0d8; border-radius: 6px; font: inherit; background: #fbfaf6; color: #1d211f;
}
.gf-body textarea:focus { outline: 2px solid #a38238; outline-offset: 1px; }
.gf-drop {
  margin-top: 10px; border: 1px dashed #cfcabc; border-radius: 6px; padding: 14px 12px;
  text-align: center; font-size: 11px; color: #8b948b; cursor: pointer; background: #fcfbf7;
}
.gf-drop.hot { border-color: #a38238; color: #6d5a2e; background: #f7f3e8; }
.gf-shots { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.gf-shots figure { margin: 0; position: relative; width: 62px; }
.gf-shots img { width: 62px; height: 46px; object-fit: cover; border-radius: 4px; border: 1px solid #e2e0d8; }
.gf-shots button {
  position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%;
  border: 1px solid #e2e0d8; background: #fff; color: #6b6f6b; font-size: 11px; line-height: 1; cursor: pointer;
}
.gf-row { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.gf-row button, .gf-send {
  font: 600 12px 'DM Sans', Arial, sans-serif; border-radius: 5px; cursor: pointer; padding: 10px 13px;
}
.gf-pick { border: 1px solid #dcd8cc; background: #fff; color: #4a5350; }
.gf-pick.on { background: #f3ecda; border-color: #a38238; color: #6d5a2e; }
.gf-send { flex: 1; border: 0; background: #171b1a; color: #f6f4ee; }
.gf-send:disabled { opacity: .5; cursor: default; }
.gf-target { font-size: 11px; color: #6d5a2e; background: #f7f3e8; border-radius: 4px; padding: 7px 9px; margin-top: 10px; display: none; }
.gf-target.show { display: block; }
.gf-log { margin-top: 14px; border-top: 1px solid #efeee8; padding-top: 10px; font-size: 11px; color: #7d8a80; }
.gf-log b { display: block; color: #3f4a44; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; }
.gf-log ul { list-style: none; margin: 0; padding: 0; max-height: 108px; overflow-y: auto; }
.gf-log li { padding: 5px 0; border-bottom: 1px solid #f4f3ee; display: flex; gap: 6px; }
.gf-log li span.tick { color: #6fbf73; }
.gf-log li span.wait { color: #c9a24a; }
.gf-toast { position: fixed; left: 18px; bottom: 74px; z-index: 9999; background: #171b1a; color: #f4f1e8;
  font: 12px 'DM Sans', Arial, sans-serif; padding: 10px 14px; border-radius: 6px; opacity: 0; transition: opacity .25s; }
.gf-toast.show { opacity: 1; }
@media (max-width: 520px) {
  #gf-edit-panel { right: 8px; left: 8px; bottom: 8px; width: auto; }
  #gf-edit-launch { right: 12px; bottom: 12px; }
}

/* agent status strip inside the widget */
.gf-agent { display: flex; align-items: center; gap: 7px; font-size: 11px; color: #55605a;
  background: #f4f3ee; border-radius: 5px; padding: 7px 9px; margin: 0 0 10px; }
.gf-agent i { width: 7px; height: 7px; border-radius: 50%; background: #b9b5a8; flex: none; }
.gf-agent i.watching { background: #5aa96a; box-shadow: 0 0 0 3px rgba(90, 169, 106, .18); animation: gfPulse 2s infinite; }
.gf-agent i.working { background: #c9a24a; box-shadow: 0 0 0 3px rgba(201, 162, 74, .2); animation: gfPulse 1.1s infinite; }
.gf-agent i.done { background: #5aa96a; }
.gf-agent i.offline { background: #b9b5a8; }
@keyframes gfPulse { 50% { box-shadow: 0 0 0 6px rgba(90, 169, 106, .05); } }
.gf-reload { position: fixed; left: 18px; bottom: 18px; z-index: 9999; background: #171b1a; color: #f2efe6;
  font: 12px 'DM Sans', Arial, sans-serif; padding: 10px 12px; border-radius: 7px; display: flex; gap: 9px;
  align-items: center; box-shadow: 0 10px 28px rgba(10, 14, 12, .3); }
.gf-reload button { border: 0; background: #a38238; color: #171b1a; font: 600 11px 'DM Sans', Arial, sans-serif;
  padding: 6px 10px; border-radius: 4px; cursor: pointer; }

/* messages from the agent inside the widget */
.gf-notes ul { max-height: 132px; }
.gf-notes li { align-items: flex-start; gap: 8px; flex-direction: column; padding: 8px 0; }
.gf-notes li span { color: #3f4a44; font-size: 11px; line-height: 1.45; }
.gf-notes li.question span { color: #6d5a2e; }
.gf-reply { align-self: flex-start; border: 1px solid #dcd8cc; background: #fff; color: #4a5350;
  font: 600 10px 'DM Sans', Arial, sans-serif; padding: 5px 9px; border-radius: 4px; cursor: pointer; }
.gf-reply:hover { border-color: #a38238; color: #6d5a2e; }
#gf-edit-launch.has-note { background: #6d5a2e; border-color: #a38238; }
#gf-edit-launch.has-note .dot { background: #ffd479; animation: gfPulse 1.4s infinite; }

/* option chips inside agent notes */
.gf-picks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.gf-pickopt { border: 1px solid #dcd8cc; background: #fff; color: #3f4a44; font: 600 11px 'DM Sans', Arial, sans-serif;
  padding: 7px 11px; border-radius: 16px; cursor: pointer; }
.gf-pickopt:hover { background: #171b1a; border-color: #171b1a; color: #f6f4ee; }

/* ---------- reload pill: warmer, less dull ---------- */
.gf-reload {
  background: linear-gradient(160deg, #23271f 0%, #171a14 55%, #101310 100%);
  color: #f5f1e5;
  border: 1px solid rgba(226, 195, 127, .34);
  border-radius: 9px;
  padding: 9px 9px 9px 13px;
  letter-spacing: .01em;
  box-shadow: 0 14px 34px -12px rgba(18, 22, 16, .55), 0 2px 0 rgba(255, 255, 255, .06) inset,
              0 0 0 1px rgba(0, 0, 0, .18);
  backdrop-filter: saturate(120%);
}
.gf-reload::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; flex: 0 0 auto;
  background: #e2c37f; box-shadow: 0 0 0 3px rgba(226, 195, 127, .16);
  animation: gfGlow 2.4s ease-in-out infinite;
}
@keyframes gfGlow { 50% { box-shadow: 0 0 0 6px rgba(226, 195, 127, .05); } }
.gf-reload button {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, #d9b878 0%, #b8944f 52%, #a38238 100%);
  color: #1a1d17; border-radius: 6px; padding: 7px 13px; font-weight: 700; letter-spacing: .015em;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .45) inset, 0 4px 10px -4px rgba(0, 0, 0, .55);
  transition: transform .18s ease, filter .18s ease;
}
.gf-reload button::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-120%);
  background: linear-gradient(105deg, transparent 20%, rgba(255, 255, 255, .55) 50%, transparent 80%);
  animation: gfSheen 3.6s ease-in-out infinite;
}
@keyframes gfSheen { 0% { transform: translateX(-120%); } 55%, 100% { transform: translateX(120%); } }
.gf-reload button:hover { transform: translateY(-1px); filter: brightness(1.06); }
.gf-reload button:active { transform: translateY(0) scale(.985); }
@media (prefers-reduced-motion: reduce) {
  .gf-reload::before, .gf-reload button::after { animation: none; }
}

/* ---------- element picking: hover glow + committed selection ---------- */
.gf-ov{position:fixed;top:0;left:0;width:0;height:0;pointer-events:none;z-index:999996;opacity:0;border-radius:6px;
  border:1.5px solid #d3ab5c;
  background:linear-gradient(180deg, rgba(226,195,127,.18), rgba(226,195,127,.10));
  box-shadow:0 0 0 1px rgba(211,171,92,.28), 0 14px 34px -16px rgba(96,72,24,.6);
  transition:top .11s cubic-bezier(.2,.7,.3,1), left .11s cubic-bezier(.2,.7,.3,1),
             width .11s cubic-bezier(.2,.7,.3,1), height .11s cubic-bezier(.2,.7,.3,1),
             background .18s ease, border-color .18s ease, box-shadow .18s ease, opacity .12s ease}
.gf-ov.is-on{opacity:1}
.gf-ov.is-sel{border:2px solid #2f7a5c;
  background:linear-gradient(180deg, rgba(47,122,92,.16), rgba(47,122,92,.07));
  box-shadow:0 0 0 1px rgba(47,122,92,.3), 0 0 0 6px rgba(47,122,92,.10), 0 18px 40px -18px rgba(17,54,40,.55)}
.gf-ov-tag{position:absolute;top:-26px;left:-1px;max-width:340px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  font:600 10px/1 ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.04em;
  padding:6px 9px;border-radius:5px;color:#f6f1e2;background:#22261f;
  box-shadow:0 6px 18px -8px rgba(0,0,0,.6)}
.gf-ov.is-sel .gf-ov-tag{background:#2f7a5c;color:#fff}
.gf-ov:not(.is-on) .gf-ov-tag{display:none}
.gf-ov[data-flip="1"] .gf-ov-tag{top:auto;bottom:-26px}
/* the picked element keeps its own marker if the overlay scrolls away */
.gf-selected{outline:2px solid #2f7a5c!important;outline-offset:2px;border-radius:3px;
  box-shadow:0 0 0 6px rgba(47,122,92,.12)!important}
.gf-target .gf-unpick{border:1px solid #d9d5c8;background:#fff;color:#5c635e;width:20px;height:20px;border-radius:50%;
  font:400 13px/1 Arial,sans-serif;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;
  padding:0;transition:background .15s ease,color .15s ease,border-color .15s ease}
.gf-target .gf-unpick:hover{background:#2f7a5c;border-color:#2f7a5c;color:#fff}
.gf-target.show span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gf-target.show{display:flex;align-items:center;gap:8px}

/* launcher: unmistakable "requests waiting" state (20261201-63) */
#gf-edit-launch{gap:8px;padding-right:12px}
#gf-edit-launch .gf-qbadge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;
  padding:0 5px;border-radius:9px;background:#c8a44f;color:#1a1d17;font:700 10.5px/1 'DM Sans',Arial,sans-serif;
  box-shadow:0 0 0 1px rgba(0,0,0,.12)}
#gf-edit-launch .gf-qbadge[hidden]{display:none}
#gf-edit-launch.has-queue{background:#1f2a22;color:#f4f1e6;border-color:#3d5a45;
  animation:gfQueuePulse 2.2s ease-in-out infinite}
#gf-edit-launch.has-queue .dot{background:#7ad489;box-shadow:0 0 0 3px rgba(122,212,137,.22)}
@keyframes gfQueuePulse{
  0%,100%{box-shadow:0 12px 30px -14px rgba(12,20,14,.6), 0 0 0 0 rgba(200,164,79,0)}
  50%{box-shadow:0 12px 30px -14px rgba(12,20,14,.6), 0 0 0 7px rgba(200,164,79,.20)}
}
@media (prefers-reduced-motion: reduce){ #gf-edit-launch.has-queue{animation:none} }

/* perfectly round close / unpick controls (20261201-66) */
.gf-target .gf-unpick{
  flex:0 0 20px;width:20px;height:20px;min-width:20px;min-height:20px;
  aspect-ratio:1/1;border-radius:50%;padding:0;margin:0;line-height:1;
  display:inline-flex;align-items:center;justify-content:center;
  font:400 13px/20px Arial,sans-serif;text-align:center;
  transform:none;overflow:hidden
}
.gf-target .gf-unpick::before{content:"×";display:block;line-height:1;transform:translateY(-1px)}
.gf-target .gf-unpick{font-size:0}
#gf-edit-panel header button{
  flex:0 0 24px;width:24px;height:24px;min-width:24px;min-height:24px;aspect-ratio:1/1;
  border-radius:50%;padding:0;line-height:1;display:inline-flex;align-items:center;justify-content:center;font-size:0
}
#gf-edit-panel header button::before{content:"×";font:400 15px/1 Arial,sans-serif;display:block;transform:translateY(-1px)}

/* keep the × visible: plain glyph, no pseudo-element */
.gf-target .gf-unpick{font:400 15px/1 Arial,sans-serif;color:#5c635e}
.gf-target .gf-unpick::before{content:none}
.gf-target .gf-unpick:hover{color:#fff}
#gf-edit-panel header button{font:400 16px/1 Arial,sans-serif;color:inherit}
#gf-edit-panel header button::before{content:none}

/* ---- the two floating chips now share one design language (20261201-73) ---- */
#gf-edit-launch,.gf-reload{
  height:44px;min-height:44px;border-radius:22px;
  background:linear-gradient(160deg,#23271f 0%,#171a14 55%,#101310 100%);
  color:#f5f1e5;border:1px solid rgba(226,195,127,.34);
  box-shadow:0 14px 34px -12px rgba(18,22,16,.55),0 2px 0 rgba(255,255,255,.06) inset;
  font:600 12px/1 'DM Sans',Arial,sans-serif;letter-spacing:.02em;
}
#gf-edit-launch{padding:0 15px;gap:9px}
#gf-edit-launch:hover{background:linear-gradient(160deg,#2b3027 0%,#1d211a 55%,#141813 100%)}
#gf-edit-launch .dot{width:8px;height:8px}
.gf-reload{padding:0 7px 0 15px;gap:10px;align-items:center}
.gf-reload button{border-radius:16px;padding:0 12px;height:30px;line-height:1}
.gf-reload::before{width:8px;height:8px;background:#e2c37f}
@media (max-width:700px){
  .gf-reload{left:12px;right:12px;bottom:70px;justify-content:space-between;width:auto}
  .gf-reload button{flex:0 0 auto}
  #gf-edit-launch{right:12px;bottom:12px;left:auto;height:42px;border-radius:21px}
  .gf-toast{bottom:132px;left:12px;right:12px}
}

/* one look for both chips, in every state — only the dot / badge changes */
#gf-edit-launch.has-note,
#gf-edit-launch.has-queue{
  background:linear-gradient(160deg,#23271f 0%,#171a14 55%,#101310 100%);
  border-color:rgba(226,195,127,.34);color:#f5f1e5;
}
#gf-edit-launch.has-note .dot{background:#e2c37f;box-shadow:0 0 0 3px rgba(226,195,127,.18);animation:gfGlow 2.4s ease-in-out infinite}
#gf-edit-launch.has-queue .dot{background:#7ad489;box-shadow:0 0 0 3px rgba(122,212,137,.20);animation:none}
#gf-edit-launch.has-queue.has-note .dot{background:#7ad489}

/* agent status: green dot lines up with the first line of the message (20261201-75) */
.gf-agent{align-items:flex-start}
.gf-agent i{margin-top:4px;flex:0 0 auto}
.gf-agent span{line-height:1.45;min-width:0;overflow-wrap:anywhere}

/* screenshot thumbnail: remove button you can actually see (20261201-80) */
.gf-shots figure .gf-shot-x{
  position:absolute;top:-7px;right:-7px;width:20px;height:20px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;padding:0;line-height:1;
  background:#22261f;color:#fff;border:1.5px solid #fff;font:400 13px/1 Arial,sans-serif;
  box-shadow:0 2px 6px rgba(12,16,14,.35);cursor:pointer;z-index:2;
  transition:background .15s ease,transform .15s ease;
}
.gf-shots figure .gf-shot-x:hover{background:#7c2f2f;transform:scale(1.08)}
.gf-shots figure .gf-shot-x:focus-visible{outline:2px solid #c8a44f;outline-offset:2px}

/* ---------- affiliate tags block (inside the edit panel) ---------- */
.gf-aff { margin-top: 14px; border: 1px solid #eae8e0; border-radius: 8px; background: #fbfaf6; }
.gf-aff > summary {
  list-style: none; cursor: pointer; padding: 9px 11px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font: 600 10px/1 'DM Sans', Arial, sans-serif; letter-spacing: .09em; text-transform: uppercase; color: #3f4a44;
}
.gf-aff > summary::-webkit-details-marker { display: none; }
.gf-aff > summary::after { content: '⌄'; color: #a8a396; font-size: 12px; line-height: 1; }
.gf-aff[open] > summary::after { content: '⌃'; }
.gf-aff > summary em { font-style: normal; letter-spacing: .04em; text-transform: none; font-weight: 600;
  color: #9a958a; margin-left: auto; margin-right: 6px; font-size: 10px; }
.gf-aff > summary em.on { color: #7a5f1f; }
.gf-aff-body { padding: 2px 11px 11px; border-top: 1px solid #efeee8; }
.gf-aff-body .gf-hint { margin: 9px 0 10px; }
.gf-aff-body label {
  display: grid; grid-template-columns: 66px 1fr; align-items: center; gap: 8px;
  margin-bottom: 7px; font: 600 11px/1 'DM Sans', Arial, sans-serif; color: #55605a;
}
.gf-aff-body input {
  width: 100%; box-sizing: border-box; padding: 7px 9px; border: 1px solid #dedbd1; border-radius: 6px;
  background: #fff; color: #1d211f; font: 12px/1.2 'DM Mono', ui-monospace, monospace;
}
.gf-aff-body input:focus { outline: 2px solid #d8c68e; outline-offset: 0; border-color: #c9a24a; }
.gf-aff-body .gf-row { margin-top: 9px; }
.gf-aff-body .gf-send { padding: 9px 12px; border-radius: 6px; font-size: 11px; }
.gf-aff-body label { grid-template-columns: 66px 1fr auto; }
.gf-aff-body .gf-aff-tally {
  font: 600 9px/1 'DM Sans', Arial, sans-serif; letter-spacing: .06em; text-transform: uppercase;
  color: #a8a396; white-space: nowrap;
}
.gf-aff-body .gf-aff-tally.on { color: #7a5f1f; }
