/* ---- Live — the editor topbar's Editor / Live switch, its drop-down, and
   the published site over the canvas (liveview.js). The switch is the one
   big control on the right: a glass pill with two segments and a chevron;
   Live wears the green dot of a site that is up. ---- */
.lv-switch {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px;
  background: var(--glass-2); border: 1px solid var(--line); border-radius: 999px;
  box-shadow: var(--shadow-rest);
}
.lv-switch[hidden] { display: none; }
.lv-seg, .lv-more {
  font: 700 13.5px var(--sans); color: var(--muted); background: transparent; border: 0; border-radius: 999px;
  padding: 7px 16px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
  transition: background .16s var(--ease-out), color .16s var(--ease-out), box-shadow .2s var(--ease-out);
}
.lv-seg:hover, .lv-more:hover { color: var(--ink); background: rgba(255, 255, 255, .9); }
.lv-seg[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-deep); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 0 14px rgba(123, 30, 46, .14); }
.lv-seg[data-lv="live"][aria-pressed="true"] { background: var(--cta-grad); color: var(--on-cta); box-shadow: var(--bloom); }
.lv-seg:focus-visible, .lv-more:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.lv-more { padding: 7px 9px; margin-left: 2px; border-left: 1px solid var(--line-soft); border-radius: 0 999px 999px 0; }
.lv-more svg { width: 13px; height: 13px; transition: transform .2s var(--ease-out); }
.lv-switch.on .lv-more { color: var(--accent-deep); }
.lv-switch.on .lv-more svg { transform: rotate(180deg); }
.lv-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--ok); box-shadow: 0 0 0 3px rgba(14, 138, 95, .18);
}
.lv-seg[aria-pressed="true"] .lv-dot { background: #3EE0A4; box-shadow: 0 0 0 3px rgba(62, 224, 164, .3); animation: lv-pulse 2s ease-in-out infinite; }
@keyframes lv-pulse { 50% { box-shadow: 0 0 0 5px rgba(62, 224, 164, .08); } }

/* ---- the published site, over the stage ---- */
.live-view {
  position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column;
  animation: lv-in .24s var(--ease-out);
}
.live-view[hidden] { display: none; }
@keyframes lv-in { from { opacity: 0; } }
.lv-bar {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; flex: none;
  background: var(--glass-2); border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3);
}
.lv-tag {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  font: 700 10.5px var(--sans); letter-spacing: .11em; text-transform: uppercase; color: var(--ok);
}
.lv-addr { font: 400 12px var(--mono); color: var(--muted); min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-bar .btn { flex: none; padding: 5px 11px; font-size: 12.5px; }
.lv-bar .btn svg { width: 12px; height: 12px; }
.lv-stage { flex: 1 1 auto; min-height: 0; display: flex; justify-content: center; padding: 14px; }
.lv-stage iframe {
  width: var(--lv-w, 100%); max-width: 100%; height: 100%; border: 0; border-radius: 14px;
  background: #FFFFFF; box-shadow: 0 10px 40px rgba(26, 26, 26, .16);
  transition: width .3s var(--ease-out);
}
.lv-stage iframe[hidden] { display: none; }
.lv-blocked {
  align-self: center; width: min(460px, 100%); padding: 22px 24px; display: flex; flex-direction: column; gap: 8px;
  background: var(--glass-2); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-rest);
}
.lv-blocked[hidden] { display: none; }
.lv-blocked b { font: 700 16px var(--sans); }
.lv-blocked p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.lv-blocked-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.lv-blocked-acts .btn svg { width: 12px; height: 12px; }
/* the canvas steps out of sight under it, and the editing tools have nothing to work on */
#view-editor.is-live-view .stage > :is(.stage-inner, .stage-tools) { visibility: hidden; }
#view-editor.is-live-view #mode-group, #view-editor.is-live-view .mode-group:has([data-mode="off"]) { opacity: .4; pointer-events: none; }

/* ---- the drop-down — the same glass as Share ---- */
.live-pop {
  position: fixed; z-index: 89; width: min(380px, calc(100vw - 16px)); max-height: min(78vh, 680px); overflow-y: auto;
  padding: 12px 14px;
  background: rgba(255, 255, 255, .93); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 18px 50px rgba(26, 26, 26, .18), 0 4px 14px rgba(26, 26, 26, .1);
  backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4);
  display: none; flex-direction: column; gap: 10px;
}
.live-pop.open { display: flex; animation: dd-in .22s var(--ease-out); }
.live-pop.closing { display: flex; animation: dd-out .16s var(--ease-out) forwards; pointer-events: none; }
.live-pop-head { display: flex; flex-direction: column; gap: 2px; padding-bottom: 10px; border-bottom: 1px solid var(--line-soft); }
.live-pop-head b { font: 700 10.5px var(--sans); letter-spacing: .11em; text-transform: uppercase; color: var(--muted); }
.live-pop-head a { font: 700 14px var(--sans); color: var(--accent-deep); text-decoration: none; overflow-wrap: anywhere; }
.live-pop-head a:hover { text-decoration: underline; }
.live-pop-head span { font-size: 12px; color: var(--muted); }
.lp-sec { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 14px; background: rgba(255, 255, 255, .6); }
.lp-top { display: flex; align-items: center; gap: 8px; }
.lp-top b { font: 700 13.5px var(--sans); }
.lp-ic { width: 26px; height: 26px; border-radius: 8px; display: inline-grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent-deep); }
.lp-ic svg { width: 15px; height: 15px; }
.lp-st {
  margin-left: auto; font: 600 11.5px var(--sans); color: var(--muted); text-align: right;
  padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line-soft); background: rgba(255, 255, 255, .55);
  max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lp-st:empty { display: none; }
.lp-st.is-ok { color: var(--ok); border-color: rgba(14, 138, 95, .4); }
.lp-st.is-off { color: var(--warn); border-color: rgba(154, 106, 18, .35); }
.lp-st.is-bad { color: var(--danger-ink); border-color: var(--danger-line); background: var(--danger-bg); }
.lp-body:empty { display: none; }
.lp-body p { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.lp-body .lp-warn { color: var(--danger-ink); margin-top: 4px; }
.lp-figs { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted); }
.lp-fig b { font: 800 17px var(--sans); color: var(--ink); margin-right: 2px; }
.lp-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.lp-acts:empty { display: none; }
.lp-acts .btn { padding: 5px 11px; font-size: 12px; }
@media (prefers-reduced-motion: reduce) {
  .live-pop.open, .live-pop.closing, .live-view { animation: none; }
  .lv-seg[aria-pressed="true"] .lv-dot { animation: none; }
}
@media (max-width: 1600px) {
  .lv-seg { padding: 7px 13px; }
}

/* the Developer labs keep the site's own top bar, without publishing */
body.dev-lab #ed-live, body.dev-3d #ed-live, body.lab-elements #ed-live { display: none !important; }
/* where the uptime figures come from: UptimeRobot's mark and name */
.lp-src { font: 600 11px var(--sans); color: var(--muted); }
.lp-acts .btn img { width: 14px; height: 14px; flex-shrink: 0; }
