/* Site Editor — v3.0
   Universal in-place editor overlay. Injectable into any HTML site.
   Loaded only when ?edit is in the URL.
   v3.0 (2026-04-29) — Baseline forks v2.2 forward. New work lands here. */

/* -------- Toolbar -------- */

#eyos-edit-toolbar {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 99999;
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(36, 33, 33, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(162, 216, 232, 0.25);
  border-radius: 999px;
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

#eyos-edit-toolbar button {
  all: unset;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
#eyos-edit-toolbar button:hover { background: rgba(162, 216, 232, 0.15); }
#eyos-edit-toolbar button.active {
  background: #A2D8E8;
  color: #242121;
  font-weight: 600;
}
#eyos-edit-toolbar .eyos-edit-divider {
  width: 1px;
  background: rgba(255, 255, 255, 0.15);
  margin: 2px 4px;
}
#eyos-edit-toolbar .eyos-edit-status {
  padding: 6px 10px;
  opacity: 0.6;
  font-size: 11px;
}

/* -------- Edit-mode-on — highlights editable elements -------- */

/* In edit mode, overlay/vignette divs must not eat clicks — let them pass
   through to the text labels sitting underneath. */
body.eyos-edit-mode .itin-photo-overlay,
body.eyos-edit-mode .ls-overlay,
body.eyos-edit-mode .hero-vignette,
body.eyos-edit-mode .cta-veil,
body.eyos-edit-mode [class*="-overlay"],
body.eyos-edit-mode [class*="-vignette"],
body.eyos-edit-mode [class*="-veil"] {
  pointer-events: none;
}

/* Any text element decorated by the editor (has data-eyos-text-decorated) gets
   an edit affordance — not just h1-h6/p/blockquote. */
body.eyos-edit-mode [data-eyos-text-decorated],
body.eyos-edit-mode [contenteditable="true"] {
  outline: 1px dashed rgba(162, 216, 232, 0.35);
  outline-offset: 2px;
  cursor: text;
  transition: outline-color 0.15s, background 0.15s;
}

body.eyos-edit-mode [data-eyos-text-decorated]:hover,
body.eyos-edit-mode [contenteditable="true"]:hover {
  outline-color: #A2D8E8;
  background: rgba(162, 216, 232, 0.06);
}

body.eyos-edit-mode [contenteditable="true"]:focus {
  outline: 2px solid #A2D8E8;
  outline-offset: 2px;
  background: rgba(162, 216, 232, 0.12);
}

/* -------- Swap chip (corner-only; non-blocking) -------- */

.eyos-edit-image-wrap {
  position: relative;
  display: inline-block;
}

/* Small corner chip — does NOT cover the photo. Rest of the element stays
   interactive so text on top of hero/parallax photos stays editable. */
.eyos-edit-swap-chip {
  position: absolute;
  bottom: 14px;
  right: 14px;
  z-index: 9998;
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(36, 33, 33, 0.82);
  color: #A2D8E8;
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid rgba(162, 216, 232, 0.4);
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  opacity: 0.65;
  transition: opacity 0.15s, transform 0.15s;
  pointer-events: auto;
  user-select: none;
}
body.eyos-edit-mode .eyos-edit-swap-chip { display: inline-flex; }
.eyos-edit-swap-chip:hover {
  opacity: 1;
  transform: translateY(-1px);
}
/* v2.2 — for tall background-image sections (parallax breaks, hero sections,
   quote backgrounds), pin chip at TOP-right instead of bottom. The bottom of a
   600px+ section often sits below the user's viewport while they're reading the
   section's text, so they never see a bottom chip. Top-right enters view as the
   section scrolls in. */
body.eyos-edit-mode [data-eyos-bg-target] > .eyos-edit-swap-chip,
body.eyos-edit-mode [data-eyos-chrome-host] > .eyos-edit-swap-chip {
  top: 14px;
  bottom: auto;
}
body.eyos-edit-mode [data-eyos-bg-target] > .eyos-edit-swap-chip.compact,
body.eyos-edit-mode [data-eyos-chrome-host] > .eyos-edit-swap-chip.compact {
  top: 2px;
  bottom: auto;
}
/* v2.2 — REMOVED z-index lifts on [data-eyos-bg-target] and parent :has() sections.
   They were lifting bg photos ABOVE their own overlay text/veils (quote text vanished
   behind the photo). The real fix for clipped chips on parallax bg-images was the
   chrome-host JS pattern in attachOverlayInPlace — chip moves to the parent which
   isn't subject to the bg-target's negative inset clipping. No z-index hacks needed. */
.eyos-edit-swap-chip::before {
  content: "⇄";
  font-size: 13px;
  letter-spacing: 0;
}

/* Compact swap chip — icon-only, for tiny images (logos, icons) */
.eyos-edit-swap-chip.compact {
  padding: 0;
  width: 22px;
  height: 22px;
  bottom: 2px;
  right: 2px;
  border-radius: 50%;
  justify-content: center;
}
.eyos-edit-swap-chip.compact::before {
  content: "⇄";
  font-size: 11px;
}

/* Pan cursor on photos — indicates drag-to-reposition */
body.eyos-edit-mode .eyos-edit-image-wrap > img,
body.eyos-edit-mode [data-eyos-bg-target] {
  cursor: grab;
}
body.eyos-edit-mode .eyos-edit-image-wrap > img.eyos-panning,
body.eyos-edit-mode [data-eyos-bg-target].eyos-panning {
  cursor: grabbing;
}

/* -------- Text-box move + resize (v3) -------- */
/* v2.2 — REMOVED min-height + box-sizing override on text leaves. Those rules
   accumulated vertical drift across the page on edit-mode toggle (cumulative ~70-105px
   downward shift of every img below the first text leaf). If tiny labels need bigger
   click targets, handle via outline-offset or scoped padding — don't blanket-touch
   layout-affecting properties on every decorated text element. */

.eyos-edit-drag-handle {
  position: absolute;
  top: 50%;
  left: -26px;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  background: #A2D8E8;
  color: #242121;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  line-height: 1;
  cursor: grab;
  z-index: 9997;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  user-select: none;
}
.eyos-edit-drag-handle:active { cursor: grabbing; }
body.eyos-edit-mode .eyos-edit-drag-handle { display: flex; opacity: 0; transition: opacity 0.15s; }
body.eyos-edit-mode [data-eyos-text-decorated]:hover > .eyos-edit-drag-handle,
body.eyos-edit-mode .eyos-edit-image-wrap:hover > .eyos-edit-drag-handle,
body.eyos-edit-mode .eyos-edit-drag-handle:hover { opacity: 1; }

body.eyos-edit-moving { cursor: grabbing !important; user-select: none; }

/* Resize edges on text boxes */
.eyos-edit-resize-edge {
  position: absolute;
  z-index: 9997;
  display: none;
  background: transparent;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
}
body.eyos-edit-mode .eyos-edit-resize-edge { display: block; }
body.eyos-edit-mode [data-eyos-text-decorated]:hover > .eyos-edit-resize-edge,
body.eyos-edit-mode .eyos-edit-resize-edge:hover { opacity: 1; background: rgba(162, 216, 232, 0.4); }

.eyos-edit-resize-edge.right {
  top: 0;
  right: -3px;
  width: 6px;
  height: 100%;
  cursor: ew-resize;
}
.eyos-edit-resize-edge.bottom {
  bottom: -3px;
  left: 0;
  height: 6px;
  width: 100%;
  cursor: ns-resize;
}
.eyos-edit-resize-edge.corner {
  bottom: -4px;
  right: -4px;
  width: 10px;
  height: 10px;
  cursor: nwse-resize;
  background: #A2D8E8;
  border-radius: 2px;
  opacity: 0.6;
}
body.eyos-edit-mode [data-eyos-text-decorated]:hover > .eyos-edit-resize-edge.corner,
body.eyos-edit-mode .eyos-edit-resize-edge.corner:hover { opacity: 1; }

/* Resize handle — bottom-LEFT so it doesn't overlap the swap chip */
.eyos-edit-resize-handle {
  position: absolute;
  bottom: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #A2D8E8;
  border-radius: 3px;
  cursor: nesw-resize;
  z-index: 11;
  display: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  opacity: 0.55;
  transition: opacity 0.15s;
}
body.eyos-edit-mode .eyos-edit-resize-handle { display: block; }
.eyos-edit-resize-handle:hover { opacity: 1; }
.eyos-edit-resize-handle::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 4px;
  width: 10px;
  height: 10px;
  background: linear-gradient(45deg, transparent 50%, #242121 50%);
  clip-path: polygon(0 0, 0 100%, 100% 100%);
}
/* Compact resize handle — for small images (logos, icons) */
.eyos-edit-resize-handle.compact {
  width: 12px;
  height: 12px;
}
.eyos-edit-resize-handle.compact::after {
  width: 6px;
  height: 6px;
  bottom: 2px;
  left: 2px;
}
/* v3.1 — logos: resize handle inner corner kisses the content bottom-right
   corner, sits OUTSIDE the content so it doesn't cover letters. Width 20px
   for the non-compact resize handle. */
.eyos-edit-resize-handle.inside-br {
  bottom: calc(var(--logo-pad-bottom, 0px) - 20px);
  left: auto;
  right: calc(var(--logo-pad-right, 0px) - 20px);
  cursor: nwse-resize;
}
.eyos-edit-resize-handle.inside-br::after {
  bottom: 2px;
  left: auto;
  right: 2px;
  background: linear-gradient(225deg, transparent 50%, #242121 50%);
  clip-path: polygon(100% 0, 0 100%, 100% 100%);
}

/* -------- Per-element delete button -------- */

.eyos-edit-delete-btn {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 20px;
  height: 20px;
  background: rgba(36, 33, 33, 0.92);
  color: #ff6b6b;
  border: 1px solid rgba(255, 107, 107, 0.55);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  z-index: 9997;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.15s, background 0.15s, color 0.15s, transform 0.15s;
  user-select: none;
}
body.eyos-edit-mode .eyos-edit-delete-btn { display: flex; }
body.eyos-edit-mode [data-eyos-text-decorated]:hover > .eyos-edit-delete-btn,
body.eyos-edit-mode [data-eyos-bg-target]:hover > .eyos-edit-delete-btn,
body.eyos-edit-mode .eyos-edit-image-wrap:hover > .eyos-edit-delete-btn,
body.eyos-edit-mode *:hover > .eyos-edit-delete-btn,
body.eyos-edit-mode .eyos-edit-delete-btn:hover {
  opacity: 1;
}
.eyos-edit-delete-btn:hover {
  background: #ff6b6b;
  color: #fff;
  transform: scale(1.1);
}

/* -------- Block-level controls (footer, header, nav, aside) -------- */
/* Labeled pill so it's visually distinct from the × per-element delete. */

.eyos-edit-block-delete {
  position: absolute;
  top: 10px;
  left: 10px;
  display: none;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(36, 33, 33, 0.92);
  color: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 107, 107, 0.5);
  border-radius: 999px;
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  z-index: 9996;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
  user-select: none;
  pointer-events: auto;
}
.eyos-edit-block-delete > span { color: #ff6b6b; font-size: 13px; }
body.eyos-edit-mode .eyos-edit-block-delete { display: inline-flex; }
body.eyos-edit-mode [data-eyos-block-decorated]:hover > .eyos-edit-block-delete,
body.eyos-edit-mode .eyos-edit-block-delete:hover {
  opacity: 1;
}
.eyos-edit-block-delete:hover {
  background: #ff6b6b;
  border-color: #ff6b6b;
}
.eyos-edit-block-delete:hover > span { color: #fff; }

/* Bottom-edge resize strip — grab + drag to change bar height */
.eyos-edit-block-resize {
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 8px;
  cursor: ns-resize;
  background: transparent;
  display: none;
  z-index: 9996;
  transition: background 0.15s;
}
/* v3.1 — top-edge variant for footers (page-bottom-anchored bars). Drag down
   from the top to shrink. Same striped tint, same grip pill. */
.eyos-edit-block-resize.top-edge {
  bottom: auto;
  top: -4px;
}
/* v3.1 — always-on diagonal-stripe tint in edit mode so the strip is visible
   on any parent background (the previous teal tint blended into the EYOS
   teal footer and disappeared). Also a centered grip pill (≡) so the
   resize affordance is unambiguous. */
body.eyos-edit-mode .eyos-edit-block-resize {
  display: block;
  background: repeating-linear-gradient(
    45deg,
    rgba(36, 33, 33, 0.22) 0 4px,
    rgba(255, 255, 255, 0.22) 4px 8px
  );
}
body.eyos-edit-mode .eyos-edit-block-resize::before {
  content: '≡';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(36, 33, 33, 0.85);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 1px 8px;
  border-radius: 3px;
  pointer-events: none;
  white-space: nowrap;
  line-height: 1;
}
body.eyos-edit-mode .eyos-edit-block-resize:hover,
body.eyos-edit-mode [data-eyos-block-decorated]:hover > .eyos-edit-block-resize {
  background: rgba(162, 216, 232, 0.75);
}

/* Strip the bar's visual chrome but keep children interactive */
.eyos-bar-stripped {
  background: transparent !important;
  background-image: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  min-height: 0 !important;
  height: auto !important;
}

/* Image-wrap drag handle — matches text drag handle, positioned top-left */
.eyos-edit-image-wrap > .eyos-edit-drag-handle {
  top: -10px;
  left: -10px;
  transform: none;
}
/* v3.1 — logos: drag handle's INNER corner kisses the content top-right
   corner. Handle sits OUTSIDE the content (in the image's empty padding area)
   so it doesn't cover the letterforms. --logo-pad-* (set in JS via canvas
   alpha sampling) gives the content bbox; subtract handle size (18px) so the
   handle's inner corner aligns with the content corner. Falls back to
   wrap-corner when no sample is available. */
.eyos-edit-image-wrap > .eyos-edit-drag-handle.inside-tl {
  top: calc(var(--logo-pad-top, 0px) - 18px);
  left: auto;
  right: calc(var(--logo-pad-right, 0px) - 18px);
  transform: none;
}

/* -------- Modal (image swap) -------- */

#eyos-edit-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(36, 33, 33, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
}
#eyos-edit-modal-backdrop.open { display: flex; }

#eyos-edit-modal {
  width: 520px;
  max-width: 92vw;
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
}
#eyos-edit-modal h3 {
  margin: 0 0 16px;
  font-size: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #242121;
}
#eyos-edit-modal .eyos-edit-modal-section {
  margin-bottom: 18px;
}
#eyos-edit-modal label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 6px;
}
#eyos-edit-modal input[type="text"],
#eyos-edit-modal input[type="file"] {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}
#eyos-edit-modal .eyos-edit-modal-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}
#eyos-edit-modal button {
  all: unset;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s;
}
#eyos-edit-modal button.primary {
  background: #242121;
  color: #fff;
}
#eyos-edit-modal button.primary:hover { background: #A2D8E8; color: #242121; }
#eyos-edit-modal button.secondary {
  background: transparent;
  color: #888;
}
#eyos-edit-modal button.secondary:hover { color: #242121; }

/* -------- Toast -------- */

#eyos-edit-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #242121;
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px;
  letter-spacing: 0.04em;
  z-index: 100001;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}
#eyos-edit-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* -------- Font-size panel (v2.2) --------
   Top-LEFT (toolbar is top-RIGHT). Shows when a text element gets focus, lets you
   bump font-size of any text on any element. Hides on blur (with debounce so clicks
   on the panel don't dismiss). */

#eyos-edit-fontsize {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 99999;
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(36, 33, 33, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(162, 216, 232, 0.3);
  border-radius: 999px;
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  font-size: 12px;
  color: #fff;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  user-select: none;
}
#eyos-edit-fontsize.open { display: flex; }

#eyos-edit-fontsize button {
  all: unset;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(162, 216, 232, 0.12);
  color: #A2D8E8;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
}
#eyos-edit-fontsize button:hover { background: rgba(162, 216, 232, 0.25); }

#eyos-fs-input {
  all: unset;
  width: 42px;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: #fff;
  border: 1px solid rgba(162, 216, 232, 0.2);
  border-radius: 4px;
  padding: 2px 4px;
  background: rgba(255, 255, 255, 0.04);
}
#eyos-fs-input:focus {
  border-color: #A2D8E8;
  background: rgba(162, 216, 232, 0.1);
}
#eyos-edit-fontsize input::-webkit-outer-spin-button,
#eyos-edit-fontsize input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.eyos-fs-unit {
  font-size: 11px;
  opacity: 0.55;
  letter-spacing: 0.05em;
}
.eyos-fs-label {
  margin-left: 8px;
  padding-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.55;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* -------- Entity badge (Wiki-Link substrate hook, v2.2) --------
   Default: 14px dot, doesn't block content. Expands to full text on hover.
   Text leaves: badge sits OUTSIDE bottom edge so it never overlaps words. */

.eyos-edit-entity-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  z-index: 7;
  width: 14px;
  height: 14px;
  padding: 0;
  border-radius: 50%;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0;       /* hide text by default — pseudo-element shows icon */
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(28, 28, 30, 0.55);
  color: rgba(162, 216, 232, 0.85);
  border: 1px solid rgba(162, 216, 232, 0.3);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.15s, width 0.15s, height 0.15s, padding 0.15s,
              border-radius 0.15s, font-size 0.1s 0.05s, background 0.15s,
              border-color 0.15s;
}
/* Tiny icon visible by default (doesn't depend on textContent) */
.eyos-edit-entity-badge::before {
  content: "+";
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.eyos-edit-entity-badge.tagged::before { content: "•"; font-size: 16px; }

body.eyos-edit-mode .eyos-edit-entity-badge {
  opacity: 0.5;
  pointer-events: auto;
}
/* Text leaves: position OUTSIDE the bottom-right corner so it never blocks text */
body.eyos-edit-mode [data-eyos-text-decorated] > .eyos-edit-entity-badge {
  bottom: -10px;
  right: 0;
}
body.eyos-edit-mode .eyos-edit-entity-badge:hover {
  width: auto;
  height: auto;
  min-width: 60px;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 10px;
  opacity: 1;
  background: rgba(28, 28, 30, 0.95);
  z-index: 12;
}
body.eyos-edit-mode .eyos-edit-entity-badge:hover::before {
  display: none;       /* expanded shows real text content */
}
.eyos-edit-entity-badge.tagged {
  background: rgba(162, 216, 232, 0.22);
  color: #A2D8E8;
  border-color: rgba(162, 216, 232, 0.7);
}
.eyos-edit-entity-badge.tagged.red-link {
  background: rgba(212, 168, 83, 0.22);
  color: #D4A853;
  border-color: rgba(212, 168, 83, 0.75);
}

/* -------- Entity modal (mirrors swap modal) -------- */

#eyos-edit-entity-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
}
#eyos-edit-entity-modal-backdrop.open { display: flex; }

#eyos-edit-entity-modal {
  background: #1c1c1e;
  color: #fff;
  border: 1px solid rgba(162, 216, 232, 0.25);
  border-radius: 14px;
  padding: 24px;
  width: 460px;
  max-width: 92vw;
  max-height: 80vh;
  overflow-y: auto;
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6);
}
#eyos-edit-entity-modal h3 {
  margin: 0 0 6px;
  font-size: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #A2D8E8;
}
.eyos-edit-entity-help {
  margin: 0 0 16px;
  font-size: 11px;
  opacity: 0.6;
}
#eyos-edit-entity-modal label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.55;
  margin-bottom: 6px;
}
#eyos-edit-entity-modal .eyos-edit-modal-section { margin-bottom: 14px; }
#eyos-edit-entity-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  border: 1px solid rgba(162, 216, 232, 0.2);
  border-radius: 6px;
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  resize: vertical;
  box-sizing: border-box;
}
#eyos-edit-entity-input:focus {
  outline: none;
  border-color: #A2D8E8;
}
.eyos-edit-entity-suggestions {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  max-height: 200px;
  overflow-y: auto;
}
.eyos-edit-entity-suggestion {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.1s;
}
.eyos-edit-entity-suggestion:last-child { border-bottom: none; }
.eyos-edit-entity-suggestion:hover { background: rgba(162, 216, 232, 0.08); }
.eyos-edit-entity-slug {
  color: #A2D8E8;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.eyos-edit-entity-meta {
  opacity: 0.55;
  margin-left: 6px;
}
.eyos-edit-entity-empty {
  padding: 12px;
  font-size: 11px;
  opacity: 0.55;
  font-style: italic;
}
.eyos-edit-entity-empty code {
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10px;
}
#eyos-edit-entity-modal .eyos-edit-modal-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}
#eyos-edit-entity-modal button {
  all: unset;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
}
#eyos-edit-entity-modal button.primary {
  background: #A2D8E8;
  color: #242121;
  font-weight: 600;
}
#eyos-edit-entity-modal button.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
#eyos-edit-entity-modal button:hover { opacity: 0.85; }
