/* =============================================================
   906eh — VISUAL LAYOUT EDIT MODE  (development tool only)
   Delete the /editmode folder and the two lines in index.html
   marked "EDIT MODE" to remove this completely.
   Nothing in here styles the real website.
   ============================================================= */

#em-root, #em-root *, .em-overlay, .em-overlay * { box-sizing: border-box; }
#em-root, .em-overlay, .em-drop-indicator {
  --em-bg: #1e1f1d;
  --em-bg-2: #2a2b28;
  --em-line: #3b3c38;
  --em-text: #f0ebe0;
  --em-muted: #a9a496;
  --em-accent: #e8603f;
  --em-accent-2: #7fc4a8;
  font: 13px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--em-text);
}

/* ---------- Toolbar (bottom-right corner) ---------- */
.em-toolbar {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 2147483000;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: calc(100vw - 28px);
}
.em-btn {
  font: 700 12px/1 system-ui, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--em-line);
  background: var(--em-bg);
  color: var(--em-text);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}
.em-btn:hover { background: var(--em-bg-2); }
.em-btn:focus-visible { outline: 2px solid var(--em-accent); outline-offset: 2px; }
.em-btn--main { background: var(--em-accent); border-color: var(--em-accent); color: #fff; }
.em-btn--main:hover { background: #d04f30; }
.em-btn[hidden] { display: none; }
.em-btn .em-dot {
  display: inline-block; width: 8px; height: 8px; margin-left: 6px;
  border-radius: 50%; background: #ffd35c; vertical-align: middle;
}

/* ---------- Toast ---------- */
.em-toast {
  position: fixed;
  left: 50%;
  bottom: 70px;
  transform: translateX(-50%);
  z-index: 2147483001;
  background: var(--em-bg);
  color: var(--em-text);
  padding: 10px 16px;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.em-toast.is-on { opacity: 1; }

/* ---------- Panel ---------- */
.em-panel {
  position: fixed;
  top: 76px;
  right: 14px;
  width: 340px;
  max-height: calc(100vh - 150px);
  z-index: 2147482999;
  display: flex;
  flex-direction: column;
  background: var(--em-bg);
  border: 1px solid var(--em-line);
  border-radius: 12px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}
.em-panel[hidden] { display: none; }
.em-panel.is-collapsed .em-panel__body,
.em-panel.is-collapsed .em-tabs { display: none; }

.em-panel__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--em-bg-2);
  cursor: grab;
  user-select: none;
}
.em-panel__title { flex: none; font-weight: 700; font-size: 13px; }
.em-page-select { flex: 1; min-width: 0; cursor: pointer; }
.em-icon-btn {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: 1px solid var(--em-line);
  background: transparent;
  color: var(--em-text);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.em-icon-btn:hover { background: var(--em-line); }

.em-tabs { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--em-line); }
.em-tab {
  flex: 1;
  padding: 9px 4px;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--em-muted);
  font: 600 12px system-ui, sans-serif;
  cursor: pointer;
}
.em-tab.is-active { color: var(--em-text); border-bottom-color: var(--em-accent); }

.em-panel__body { overflow-y: auto; padding: 10px 12px 16px; }

.em-empty { color: var(--em-muted); padding: 14px 4px; }
.em-empty strong { color: var(--em-text); }

.em-sel-head { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.em-sel-name { flex: 1; font-size: 15px; font-weight: 700; line-height: 1.25; }
.em-sel-kind { display: block; font-size: 11px; font-weight: 500; color: var(--em-muted); }
.em-hint { font-size: 12px; color: var(--em-muted); margin: 0 0 8px; }

.em-group { border-top: 1px solid var(--em-line); padding-top: 8px; margin-top: 10px; }
.em-group__title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--em-accent-2); margin-bottom: 6px;
}

.em-row { display: grid; grid-template-columns: 96px 1fr auto; align-items: center; gap: 6px; margin: 6px 0; }
.em-row__label { font-size: 12px; color: var(--em-muted); }
.em-row__ctl { display: flex; align-items: center; gap: 6px; min-width: 0; }
.em-row__ctl input[type="range"] { flex: 1; min-width: 0; accent-color: var(--em-accent); }
.em-num {
  width: 62px; padding: 4px 5px;
  background: var(--em-bg-2); color: var(--em-text);
  border: 1px solid var(--em-line); border-radius: 5px;
  font: 12px system-ui, sans-serif;
}
.em-unit { font-size: 11px; color: var(--em-muted); width: 22px; }
.em-reset {
  border: 0; background: none; color: var(--em-muted);
  cursor: pointer; font-size: 13px; padding: 2px 4px; border-radius: 4px;
}
.em-reset:hover { color: var(--em-text); background: var(--em-line); }
.em-reset.is-changed { color: #ffd35c; }

.em-color { width: 34px; height: 26px; padding: 0; border: 1px solid var(--em-line); border-radius: 5px; background: none; cursor: pointer; }
.em-hex { width: 84px; padding: 4px 6px; background: var(--em-bg-2); color: var(--em-text); border: 1px solid var(--em-line); border-radius: 5px; font: 12px ui-monospace, Menlo, monospace; }

.em-select { flex: 1; padding: 5px; background: var(--em-bg-2); color: var(--em-text); border: 1px solid var(--em-line); border-radius: 5px; font: 12px system-ui, sans-serif; }

.em-seg { display: flex; flex-wrap: wrap; gap: 4px; }
.em-seg button,
.em-small-btn {
  padding: 5px 9px;
  background: var(--em-bg-2);
  color: var(--em-text);
  border: 1px solid var(--em-line);
  border-radius: 5px;
  font: 600 12px system-ui, sans-serif;
  cursor: pointer;
}
.em-seg button:hover,
.em-small-btn:hover { background: var(--em-line); }
.em-seg button.is-active { background: var(--em-accent); border-color: var(--em-accent); color: #fff; }
.em-small-btn--wide { width: 100%; margin-top: 6px; padding: 9px; }
.em-small-btn--accent { background: var(--em-accent); border-color: var(--em-accent); color: #fff; }
.em-small-btn--accent:hover { background: #d04f30; }

.em-note { font-size: 12px; background: var(--em-bg-2); border-radius: 6px; padding: 8px; margin: 6px 0; }
.em-note--warn { background: #4a3a17; color: #ffe2a3; }
.em-note strong { display: block; }

.em-changes {
  width: 100%;
  min-height: 260px;
  background: var(--em-bg-2);
  color: var(--em-text);
  border: 1px solid var(--em-line);
  border-radius: 6px;
  padding: 8px;
  font: 12px/1.5 ui-monospace, Menlo, monospace;
  resize: vertical;
}

/* ---------- Layers tab ---------- */
.em-layers { display: flex; flex-direction: column; gap: 1px; margin: 0 -6px; }
.em-layer { display: flex; align-items: center; gap: 2px; border-radius: 5px; min-height: 28px; }
.em-layer:hover { background: var(--em-bg-2); }
.em-layer.is-selected { background: #4a2a20; box-shadow: inset 0 0 0 1px var(--em-accent); }
.em-layer.is-deco .em-layer__name { color: #e9cfae; font-style: italic; }
.em-layer.is-hidden .em-layer__name { opacity: 0.45; text-decoration: line-through; }
.em-layer__twist {
  width: 18px; flex: none; padding: 0;
  background: none; border: 0; color: var(--em-muted);
  font-size: 11px; cursor: pointer; text-align: center;
}
.em-layer__name {
  flex: 1; min-width: 0; padding: 5px 4px;
  background: none; border: 0; color: var(--em-text);
  font: 12px system-ui, sans-serif; text-align: left; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.em-layer__btn {
  width: 24px; height: 24px; flex: none;
  background: none; border: 1px solid transparent; border-radius: 4px;
  color: var(--em-muted); font-size: 12px; cursor: pointer;
}
.em-layer__btn:hover { border-color: var(--em-line); color: var(--em-text); }
.em-deco-link { text-align: left; font-style: italic; color: #e9cfae; }

/* ---------- Page overlays (selection box + handles) ---------- */
.em-overlay {
  position: absolute;
  z-index: 2147482990;
  pointer-events: none;
  border: 2px solid var(--em-accent);
  border-radius: 3px;
}
.em-overlay[hidden] { display: none; }
.em-overlay__label {
  position: absolute;
  left: -2px;
  top: -26px;
  display: flex;
  gap: 4px;
  pointer-events: auto;
}
.em-chip {
  background: var(--em-accent);
  color: #fff;
  font: 700 11px/1 system-ui, sans-serif;
  padding: 6px 8px;
  border-radius: 5px 5px 0 0;
  white-space: nowrap;
}
.em-grip {
  cursor: grab;
  background: #fff;
  color: var(--em-bg);
  border-radius: 5px 5px 0 0;
  font: 700 11px/1 system-ui, sans-serif;
  padding: 6px 8px;
  touch-action: none;
  user-select: none;
  white-space: nowrap;
}
.em-grip:active { cursor: grabbing; }
.em-handle {
  position: absolute;
  pointer-events: auto;
  background: #fff;
  border: 2px solid var(--em-accent);
  border-radius: 3px;
  touch-action: none;
}
.em-handle--e  { right: -8px; top: 50%; width: 12px; height: 34px; margin-top: -17px; cursor: ew-resize; }
.em-handle--s  { bottom: -8px; left: 50%; width: 34px; height: 12px; margin-left: -17px; cursor: ns-resize; }
.em-handle--se { right: -9px; bottom: -9px; width: 16px; height: 16px; cursor: nwse-resize; }
.em-handle[hidden] { display: none; }

.em-drop-indicator {
  position: absolute;
  z-index: 2147482991;
  pointer-events: none;
  border: 3px dashed var(--em-accent-2);
  background: rgba(127, 196, 168, 0.15);
  border-radius: 6px;
}
.em-drop-indicator[hidden] { display: none; }
.em-drop-indicator::after {
  content: attr(data-side);
  position: absolute;
  left: 8px;
  top: 8px;
  background: var(--em-accent-2);
  color: #102;
  font: 700 11px/1 system-ui, sans-serif;
  padding: 5px 7px;
  border-radius: 4px;
}

/* ---------- Page states while Edit Mode is ON ---------- */
html.em-on [data-em-id][data-em-major] {
  outline: 1px dashed rgba(232, 96, 63, 0.45);
  outline-offset: 3px;
}
html.em-on .em-hover { outline: 2px solid rgba(232, 96, 63, 0.75) !important; outline-offset: 3px; }
html.em-on [data-em-free] { cursor: move; }
html.em-on a, html.em-on [data-em-id] { cursor: default; }
html.em-on [data-em-free], html.em-on [data-em-free] * { cursor: move; }
html.em-on [contenteditable] {
  cursor: text !important;
  outline: 2px dotted #e8603f !important;
  outline-offset: 4px;
  background: rgba(255, 255, 255, 0.35);
}
html.em-dragging, html.em-dragging * { user-select: none !important; cursor: grabbing !important; }

/* Image placeholders: make the size labels stand out in Edit Mode */
html.em-on .ph { border-color: #e8603f; color: #3a2a1f; }
html.em-on .ph__size { font-weight: 700; }
html.em-on .slot.em-drop-target { outline: 3px dashed #7fc4a8; outline-offset: -3px; }
html.em-on .slot.em-drop-target::after {
  content: "Drop image here";
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(30, 31, 29, 0.65); color: #fff;
  font: 700 13px system-ui, sans-serif;
  z-index: 5;
}

/* ---------- Small screens: panel becomes a bottom sheet ---------- */
@media (max-width: 700px) {
  .em-panel {
    top: auto;
    left: 8px;
    right: 8px;
    bottom: 108px;            /* clears the two-row toolbar */
    width: auto;
    max-height: 44vh;
  }
  .em-btn { min-height: 36px; padding: 0 10px; font-size: 11px; }
}

.em-small-btn:disabled,
.em-seg button:disabled { opacity: 0.4; cursor: default; }

/* Header image drop target */
html.em-on .hero__inner.em-drop-target { outline: 3px dashed #7fc4a8; outline-offset: -6px; }

/* ---------- Background photo editor ---------- */
.em-devtabs { margin-bottom: 8px; }
.em-devtabs button { flex: 1; }
.em-bgp-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 4px 0 8px; }
.em-bgp {
  position: relative;
  overflow: hidden;
  background: var(--canvas, #e3dbc8);
  outline: 1px solid var(--em-line);
  cursor: grab;
  touch-action: none;
  user-select: none;
  flex: none;
}
.em-bgp:focus-visible { outline: 3px solid var(--em-accent); outline-offset: 2px; }
.em-bgp.is-active { outline: 3px solid var(--em-accent); outline-offset: 2px; }
.em-bgp.is-dragging { cursor: grabbing; }
.em-bgp.is-stretch { cursor: not-allowed; }
.em-bgp.is-drop { outline: 3px dashed var(--em-accent-2); outline-offset: 2px; }
.em-bgp__layer { position: absolute; inset: 0; pointer-events: none; }
.em-bgp__cap { margin: 0; font-size: 11px; color: var(--em-muted); text-align: center; }

.em-fitgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 6px 0 2px; }
.em-fit {
  padding: 8px 6px;
  background: var(--em-bg-2);
  color: var(--em-text);
  border: 1px solid var(--em-line);
  border-radius: 6px;
  font: 600 12px system-ui, sans-serif;
  cursor: pointer;
}
.em-fit:hover { background: var(--em-line); }
.em-fit.is-active { background: var(--em-accent); border-color: var(--em-accent); color: #fff; }

/* Big editor */
.em-bgx {
  position: fixed;
  inset: 0;
  z-index: 2147483002;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(15, 16, 14, 0.66);
}
.em-bgx__card {
  width: min(1200px, 96vw);
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  background: var(--em-bg);
  border: 1px solid var(--em-line);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.em-bgx__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--em-bg-2);
}
.em-bgx__head strong { display: block; font-size: 15px; }
.em-bgx__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 0;
  overflow: hidden;
}
.em-bgx__body.is-stacked { grid-template-columns: minmax(0, 1fr); overflow-y: auto; }
.em-bgx__main { padding: 18px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.em-bgx__previews { display: flex; align-items: flex-start; justify-content: center; gap: 24px; flex-wrap: wrap; }
.em-bgx__side {
  width: min(380px, 30vw);
  padding: 10px 16px 18px;
  border-left: 1px solid var(--em-line);
  overflow-y: auto;
}
.em-bgx__body.is-stacked .em-bgx__side { width: auto; border-left: 0; border-top: 1px solid var(--em-line); overflow: visible; }
.em-bgx__body.is-stacked .em-bgx__main { overflow: visible; }

/* ---------- Site logo tab ---------- */
.em-logo-row { display: flex; gap: 6px; margin: 6px 0 2px; }
.em-logo-sw { flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 10px 6px; border-radius: 6px; border: 1px solid rgba(255,255,255,.12); }
.em-logo-sw img { display: block; max-width: 100%; width: auto; object-fit: contain; }
.em-logo-mock-wrap { margin: 8px 0 4px; }
.em-logo-mock { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 10px; border-radius: 6px; overflow: hidden; border: 1px solid rgba(255,255,255,.12); }
.em-logo-mock img { display: block; flex: none; max-width: none; object-fit: contain; }
.em-logo-mock.is-phone { max-width: 260px; }
.em-logo-mock.is-centered img { position: absolute; left: 50%; top: 50%; margin: 0 !important; transform: translate(-50%, -50%); }
.em-logo-mock.is-centered .em-logo-mock__burger { margin-left: auto; }
.em-logo-mock__menu { display: flex; gap: 6px; }
.em-logo-mock__menu i { display: block; width: 22px; height: 4px; border-radius: 2px; background: currentColor; opacity: .45; }
.em-logo-mock__burger { display: block; width: 18px; height: 12px; flex: none; background: linear-gradient(currentColor 0 0) 0 0 / 100% 2px no-repeat, linear-gradient(currentColor 0 0) 0 50% / 100% 2px no-repeat, linear-gradient(currentColor 0 0) 0 100% / 100% 2px no-repeat; opacity: .7; }

/* ---------- Export check window ---------- */
.em-check { position: fixed; inset: 0; z-index: 2147483600; display: grid; place-items: center; padding: 16px; background: rgba(20, 20, 18, 0.55); }
.em-check__panel { width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 20px; border-radius: 12px; background: var(--em-bg, #222); color: var(--em-text, #f4f1e8); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
.em-check__title { margin: 0 0 6px; font-size: 18px; }
.em-check__sub { margin: 14px 0 6px; font-weight: 600; }
.em-check__list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.em-check__item { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 8px; background: var(--em-bg-2, #2e2e2a); }
.em-check__item.is-done { opacity: 0.6; }
.em-check__file { font: 12px ui-monospace, Menlo, Consolas, monospace; opacity: 0.85; word-break: break-all; }
.em-check__why { font-size: 13px; color: #ffe2a3; }
.em-check__item.is-done .em-check__why { color: inherit; }
.em-check__item .em-seg { margin-top: 4px; }
.em-check__foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.em-check__foot .em-small-btn { width: auto; }

/* ---------- Desktop / phones & tablets banner ---------- */
.em-device { display: flex; flex-direction: column; gap: 2px; margin: 0 0 10px; padding: 8px 10px; border-radius: 8px; background: #2c3a26; border-left: 4px solid #8fb35a; font-size: 12px; line-height: 1.4; }
.em-device strong { font-size: 13px; }
.em-device.is-phone { background: #3d2c1b; border-left-color: #ff8a3d; }

/* ---------- Publish to website ---------- */
/* Hide the page for a moment while published changes are applied (set by the
   loader in each page's <head>, removed by editmode.js; never longer than 1.5s) */
html.em-pub-wait body { opacity: 0 !important; }
.em-btn.em-publish { background: #2f6b4f; border-color: #3f8a66; color: #fff; }
.em-btn.em-publish:hover { background: #3a7d5d; }
.em-btn.em-publish:disabled { opacity: .7; cursor: progress; }
.em-pubpill { align-self: center; font: 600 12px/1.2 system-ui, sans-serif; padding: 6px 10px; border-radius: 999px;
  background: var(--em-bg); border: 1px solid var(--em-line); color: var(--em-muted); white-space: nowrap;   cursor: pointer; }
.em-pubpill:hover { background: var(--em-bg-2); }
.em-pubpill[hidden] { display: none; }
.em-pubpill.is-ok { color: #9be0bd; border-color: #2f6b4f; }
.em-pubpill.is-draft { color: #ffc27a; border-color: #8a5a22; }
.em-pubpill.is-busy { color: var(--em-text); }
.em-pubbox, .em-pubfolder { display: flex; flex-direction: column; gap: 3px; margin: 0 0 10px; padding: 9px 11px; border-radius: 8px;
  font-size: 12px; line-height: 1.45; background: var(--em-bg-2); border-left: 4px solid var(--em-line); }
.em-pubbox strong { font-size: 14px; }
.em-pubbox.is-ok, .em-pubfolder.is-verified { background: #1f3529; border-left-color: #4fb383; }
.em-pubbox.is-draft, .em-pubfolder.is-needs-permission { background: #3a2c17; border-left-color: #ff9a3d; }
.em-pubfolder.is-wrong, .em-pubfolder.is-unreachable { background: #3d1f1a; border-left-color: #e8603f; }
.em-pubfolder strong { word-break: break-word; }
.em-pubbig { font-size: 14px !important; padding: 10px !important; margin-bottom: 8px; }
.em-seg--wrap { flex-wrap: wrap; gap: 6px; }
.em-hint--warn { color: #ffc27a; }
.em-pubres__title.is-ok { color: #9be0bd; }
.em-pubres__title.is-warn { color: #ffc27a; }
.em-pubres__title.is-bad { color: #ff9a85; }
.em-pubres__list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 7px; font-size: 13px; line-height: 1.45; }
.em-pubres__list li { padding-left: 24px; position: relative; }
.em-pubres__list li::before { position: absolute; left: 0; top: 0; font-weight: 700; }
.em-pubres__list li.is-ok::before { content: "✓"; color: #6fd3a2; }
.em-pubres__list li.is-bad::before { content: "!"; color: #ff8a70; }
.em-orphans { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 12px; }
.em-orphans li { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.em-orphans span { color: var(--em-muted); word-break: break-word; }
a.em-small-btn { display: inline-block; text-align: center; text-decoration: none; }

/* Tabs wrap onto a second row instead of being cut off; the Website tab stands out */
.em-tab { flex: 1 0 auto; white-space: nowrap; }
.em-tab[data-tab="website"] { color: #9be0bd; }
.em-tab[data-tab="website"].is-active { color: var(--em-text); border-bottom-color: #4fb383; }
/* Editor browsers viewing the published site */
.em-viewing { align-self: center; font: 600 12px/1.2 system-ui, sans-serif; padding: 6px 10px; border-radius: 999px;
  background: var(--em-bg); border: 1px solid #2f6b4f; color: #9be0bd; white-space: nowrap; }
/* Edit Layout: a playing video can't swallow clicks — clicking it selects the video spot */
html.em-on .slot > .feed-player { pointer-events: none; }
