/* IG Page Builder (pages/ig-page.js, 24.11.2026) — the Instagram profile of one phone's login in Instagram's own
   look, edited in place; right of it the changes and "Apply to phone" with the phone's progress. Phone: the page
   on top, the panel below, Apply sticks to the bottom. Shell + panel = ui-v2 tokens; the page = Instagram's colours.
   Doc: docs/marketing/IG-PAGE-BUILDER.md */

#igpb-modal { z-index: 205; overflow: hidden; overscroll-behavior: contain; padding: 0 !important; }
#igpb-modal > .modal.modal-fs { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
.igpb { background: var(--v2-bg, #F5F4F1); font-family: var(--v2-font, Inter, system-ui, sans-serif); color: var(--v2-ink, #141414); text-align: left; }
.igpb .modal-body.igpb-body { padding: 0; background: var(--v2-bg, #F5F4F1); overflow: auto; flex: 1; min-height: 0; }
.igpb-lay { display: grid; grid-template-columns: 430px 360px; gap: 22px; padding: 20px 24px 40px; justify-content: center; align-items: start; }
.igpb-side { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* panel cards (same build as the OF builder's) */
.igpb-card { background: var(--v2-surface, #fff); border: 1px solid var(--v2-line, #E7E5E0); border-radius: var(--v2-r-card, 12px); overflow: hidden; min-width: 0; }
.igpb-ch { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--v2-line2, #F0EEEA); }
.igpb-ch h3 { margin: 0; font: 600 15px/1.2 var(--v2-font); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--v2-ink); }
.igpb-cb { padding: 12px 16px; }
.igpb-cb + .igpb-cb { border-top: 1px solid var(--v2-line2, #F0EEEA); }
.igpb-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--v2-ink3, #736F67); }
.igpb-dot.is-ok { background: var(--v2-ok, #157F3D); }
.igpb-dot.is-run { background: #E0A526; }
.igpb-dot.is-err { background: var(--v2-err, #C23B3B); }
.igpb-dot.is-todo { background: transparent; box-shadow: inset 0 0 0 2px var(--v2-ink3, #736F67); }
.igpb-dot.is-off { background: var(--v2-line, #E7E5E0); }
.igpb-ib { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: none; border-radius: var(--v2-r-ctl, 9px);
  border: 0; background: transparent; color: var(--v2-ink2, #57544E); cursor: pointer; padding: 0; }
.igpb-ib:hover { background: var(--v2-soft, #F3F1EC); color: var(--v2-ink); }
.igpb-save { display: inline-flex; align-items: center; color: var(--v2-ink3); }
.igpb-save.is-ok { color: var(--v2-ok); } .igpb-save.is-err { color: var(--v2-err); cursor: pointer; }
.igpb-spin { animation: igpbspin .9s linear infinite; }
@keyframes igpbspin { to { transform: rotate(360deg); } }

/* change rows */
.igpb-row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--v2-line2, #F0EEEA); font-size: 13.5px; line-height: 1.35; }
.igpb-row:last-child { border-bottom: 0; }
.igpb-row > .igpb-dot { margin-top: 5px; }
.igpb-row .t { flex: 1; min-width: 0; }
.igpb-row .l { font-weight: 600; color: var(--v2-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.igpb-row .v { color: var(--v2-ink2); white-space: pre-wrap; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.igpb-row .v.is-err { color: var(--v2-err); }
.igpb-row .igpb-ib { margin: -4px -6px -4px 0; }
.igpb-row img.th { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; }
.igpb-empty { padding: 14px 16px; font-size: 13.5px; color: var(--v2-ink2); }
.igpb-foot { padding: 12px 16px 14px; border-top: 1px solid var(--v2-line2, #F0EEEA); }
.igpb-apply { display: flex; width: 100%; align-items: center; justify-content: center; gap: 8px; height: 44px; border-radius: var(--v2-r-ctl, 9px);
  border: 1px solid var(--v2-gold, #B8922A); background: var(--v2-gold, #B8922A); color: #111; font: 600 14.5px/1 var(--v2-font); cursor: pointer; }
.igpb-apply:disabled { opacity: .45; cursor: default; }
.igpb-apply .n { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: rgba(0,0,0,.14); display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; }

/* the phone during / after a run */
.igpb-run { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 14px; align-items: start; }
.igpb-frame { width: 132px; aspect-ratio: 406 / 720; border-radius: 14px; overflow: hidden; background: #111; border: 3px solid #1d1d1f; box-shadow: 0 0 0 1px var(--v2-line); position: relative; }
.igpb-frame img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.igpb-frame .skel { position: absolute; inset: 0; width: auto; height: auto; border-radius: 0; display: block; }
.igpb-steps { display: flex; flex-direction: column; gap: 7px; min-width: 0; font-size: 13px; }
.igpb-step { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.igpb-step > .igpb-dot { margin-top: 4px; }
.igpb-step .x { min-width: 0; }
.igpb-step .x b { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.igpb-step .x span { color: var(--v2-err); display: block; font-size: 12.5px; word-break: break-word; }
.igpb-now { font-size: 12.5px; color: var(--v2-ink2); word-break: break-word; }
.igpb-st { font: 600 12px/1 var(--v2-font); padding: 5px 8px; border-radius: var(--v2-r-chip, 6px); background: var(--v2-soft, #F3F1EC); color: var(--v2-ink2); white-space: nowrap; }
.igpb-st.is-ok { background: var(--v2-ok-soft, #E6F3EA); color: var(--v2-ok, #157F3D); }
.igpb-st.is-err { background: var(--v2-err-soft, #F8E5E5); color: var(--v2-err, #C23B3B); }
.igpb-st.is-run { background: #FBF1D9; color: #8A6410; }
.igpb-cancel { margin-top: 10px; height: 32px; padding: 0 12px; border-radius: var(--v2-r-ctl, 9px); border: 1px solid var(--v2-line); background: var(--v2-surface); font: 600 12.5px/1 var(--v2-font); color: var(--v2-ink); cursor: pointer; }
.igpb-lightbox { position: fixed; inset: 0; z-index: 260; background: rgba(0,0,0,.86); display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.igpb-lightbox img { max-width: 92vw; max-height: 92dvh; border-radius: 18px; }

/* ── The Instagram page ─────────────────────────────────────────────────── */
.igp { --ig-bg: #fff; --ig-ink: #000; --ig-ink2: #737373; --ig-btn: #efefef; --ig-line: #dbdbdb; --ig-link: #00376b; --ig-blue: #0095f6;
  background: var(--ig-bg); color: var(--ig-ink); border: 1px solid var(--v2-line, #E7E5E0); border-radius: 28px; overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; line-height: 18px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04); min-width: 0; }
@media (prefers-color-scheme: dark) {
  .igp { --ig-bg: #000; --ig-ink: #f5f5f5; --ig-ink2: #a8a8a8; --ig-btn: #262626; --ig-line: #363636; --ig-link: #e0f1ff; --ig-blue: #0095f6; border-color: #262626; }
}
.igp-top { display: flex; align-items: center; gap: 14px; height: 52px; padding: 0 16px; }
.igp-top .u { flex: 1; min-width: 0; text-align: center; font-weight: 700; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; justify-content: center; gap: 4px; }
.igp-top svg { flex: none; }
.igp-head { display: flex; align-items: center; gap: 22px; padding: 4px 16px 10px; }
.igp-av { position: relative; flex: none; width: 88px; height: 88px; border-radius: 50%; padding: 0; border: 0; background: transparent; cursor: pointer; }
.igp-av img, .igp-av .ph { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; background: var(--ig-btn); }
.igp-av .ph { display: flex; align-items: center; justify-content: center; color: var(--ig-ink2); }
.igp-av.is-ring { padding: 3px; background: conic-gradient(from 210deg, #feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5, #feda75); }
.igp-av.is-ring img { border: 3px solid var(--ig-bg); }
.igp-av .ed { position: absolute; inset: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.45); color: #fff; opacity: 0; transition: opacity .15s; }
.igp-av:hover .ed, .igp-av:focus-visible .ed { opacity: 1; }
.igp-hr { flex: 1; min-width: 0; }
.igp-counts { display: flex; gap: 22px; margin-top: 6px; }
.igp-counts div { display: flex; flex-direction: column; }
.igp-counts b { font-size: 16px; font-weight: 600; line-height: 20px; }
.igp-counts span { font-size: 14px; }

/* editable parts: a quiet frame on hover, gold when changed, red when it cannot go out */
.igp [contenteditable] { outline: none; border-radius: 6px; cursor: text; position: relative; min-width: 24px; }
.igp [contenteditable]:hover { box-shadow: 0 0 0 1px var(--ig-line); }
.igp [contenteditable]:focus { box-shadow: 0 0 0 2px var(--ig-blue); }
.igp [contenteditable]:empty::before { content: attr(data-ph); color: var(--ig-ink2); }
.igp .is-chg { box-shadow: 0 0 0 2px var(--v2-gold, #B8922A); }
.igp .is-bad, .igp .is-bad:hover, .igp .is-bad:focus { box-shadow: 0 0 0 2px var(--v2-err, #C23B3B); }
.igp-name { font-weight: 600; font-size: 15px; line-height: 20px; display: inline-block; max-width: 100%; padding: 0 3px; margin-left: -3px; white-space: pre; overflow: hidden; }
.igp-bio { margin: 0 16px; padding: 2px 4px; margin-left: 12px; white-space: pre-wrap; word-break: break-word; }
.igp-link { display: flex; align-items: center; gap: 4px; margin: 2px 12px 0; padding: 2px 4px; color: var(--ig-link); font-weight: 600; }
.igp-link svg { flex: none; }
.igp-link [contenteditable] { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; }
.igp-link.is-empty { opacity: .55; }
.igp-link.is-empty:hover, .igp-link.is-empty:focus-within { opacity: 1; }
.igp { position: relative; }
.igp-cnt { position: absolute; z-index: 1; font: 600 11px/1 var(--v2-font); color: var(--ig-ink2); pointer-events: none; }
.igp-cnt.is-err { color: var(--v2-err, #C23B3B); }
.igp-btns { display: flex; gap: 6px; padding: 14px 16px 4px; }
.igp-btns span { flex: 1; height: 32px; border-radius: 8px; background: var(--ig-btn); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; }

.igp-hls { display: flex; gap: 14px; padding: 14px 16px 6px; overflow-x: auto; scrollbar-width: none; }
.igp-hls::-webkit-scrollbar { display: none; }
.igp-hl { flex: none; width: 66px; display: flex; flex-direction: column; align-items: center; gap: 5px; position: relative; }
.igp-hl .c { width: 64px; height: 64px; border-radius: 50%; padding: 3px; border: 1px solid var(--ig-line); background: var(--ig-bg); cursor: default; display: block; }
.igp-hl .c img, .igp-hl .c .ph { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: flex; align-items: center; justify-content: center; background: var(--ig-btn); color: var(--ig-ink); }
.igp-hl.is-new .c { border-style: dashed; cursor: pointer; }
.igp-hl .t { font-size: 12px; line-height: 15px; max-width: 70px; text-align: center; white-space: nowrap; overflow: hidden; padding: 1px 3px; }
.igp-hl .rm { position: absolute; top: -4px; right: -2px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--ig-ink); color: var(--ig-bg);
  display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; opacity: 0; transition: opacity .15s; }
.igp-hl:hover .rm, .igp-hl .rm:focus-visible { opacity: 1; }
.igp-hl.add .c { cursor: pointer; border: 1px solid var(--ig-line); }
.igp-hl.add .c .ph { background: transparent; }
.igp-tabs { display: flex; border-bottom: 1px solid var(--ig-line); margin-top: 12px; }
.igp-tabs span { flex: 1; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--ig-ink2); }
.igp-tabs span.on { color: var(--ig-ink); box-shadow: inset 0 -1px 0 var(--ig-ink); }
.igp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.igp-grid .p { position: relative; aspect-ratio: 3 / 4; background: var(--ig-btn); overflow: hidden; }
.igp-grid .p img { width: 100%; height: 100%; object-fit: cover; display: block; }
.igp-grid .p svg { position: absolute; top: 7px; right: 7px; color: #fff; filter: drop-shadow(0 0 2px rgba(0,0,0,.5)); }
.igp-none { padding: 40px 16px 48px; text-align: center; color: var(--ig-ink2); }
.igp-none b { display: block; color: var(--ig-ink); font-size: 20px; line-height: 26px; margin-bottom: 6px; }
.igp-gone { padding: 70px 24px; text-align: center; }
.igp-gone b { display: block; font-size: 20px; line-height: 26px; margin-bottom: 8px; }
.igp-gone span { color: var(--ig-ink2); }
.igp .skel { display: block; background: var(--ig-btn); }

/* phone pass (24.11.2026) */
@media (max-width: 820px) {
  .igpb-lay { grid-template-columns: minmax(0, 1fr); padding: 12px 12px calc(88px + env(safe-area-inset-bottom)); gap: 14px; }
  .igpb-side { position: static; }
  .igp { border-radius: 20px; }
  .igp-hl .rm { opacity: 1; }
  .igpb-applybar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 3; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: var(--v2-surface, #fff); border-top: 1px solid var(--v2-line, #E7E5E0); }
  .igpb-card .igpb-foot { display: none; }
  /* 16 px on everything typed into, or iOS zooms on focus; the highlight labels grow with them */
  .igp [contenteditable] { font-size: 16px; }
  .igp-name { font-size: 16px; }
  .igp-hl { width: 72px; }
  .igp-hl .t { font-size: 16px; line-height: 19px; max-width: 76px; }
  .igpb .hdr-popup .hdr-title { min-width: 0; }
}
@media (min-width: 821px) { .igpb-applybar { display: none; } }
