/* Edit mode. Loaded only for a signed in visitor (functions/_middleware.js)
   and by the sign in page. Every class starts lxe- so nothing here can touch
   the site's own styles. */

:root {
  --lxe-ink: #14181f;
  --lxe-paper: #ffffff;
  --lxe-muted: #59626f;
  --lxe-line: #d5dae1;
  --lxe-accent: #1f6feb;
  --lxe-changed: #f2b705;
  --lxe-bad: #b42318;
  --lxe-good: #1a7f37;
}

/* Room so the toolbar never covers the end of the page. --lxe-bar-h is the
   bar's real height, kept current by editor.js (a ResizeObserver), because the
   bar wraps on a phone and grows when the publish tray opens: a fixed 96px
   left the end of the page under a 168px bar at 390px wide. */
body.lxe-has-bar { padding-bottom: calc(var(--lxe-bar-h, 96px) + 16px); }

/* A soft blue glow around the whole window while editing is on, so it is
   obvious which mode the page is in; gone when editing is off. Fixed and
   click-through, so it never covers or blocks anything. */
body.lxe-on::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 2147482999;
  box-shadow: inset 0 0 0 3px rgba(31, 111, 235, .85), inset 0 0 22px rgba(31, 111, 235, .35);
}

.lxe-on .lxe-block {
  outline: 2px dashed rgba(31, 111, 235, .55);
  outline-offset: 3px;
  cursor: text;
  border-radius: 2px;
}
.lxe-on .lxe-block:focus { outline: 2px solid var(--lxe-accent); background: rgba(31, 111, 235, .06); }
.lxe-on .lxe-changed { outline-color: var(--lxe-changed); background: rgba(242, 183, 5, .12); }
.lxe-on [data-lxe-lock] { outline: 1px dotted rgba(89, 98, 111, .6); outline-offset: 3px; cursor: help; }

#lxe, #lxe * { box-sizing: border-box; font-family: Inter, system-ui, sans-serif; }
#lxe {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 2147483000;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--lxe-ink); color: var(--lxe-paper);
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  box-shadow: 0 -4px 18px rgba(0, 0, 0, .18);
}
#lxe button, .lxe-button {
  min-height: 44px; padding: 0 16px; border-radius: 8px; border: 1px solid transparent;
  font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
}
/* Edit is yellow while off so it stands out on the dark bar (Michael: the dark
   grey blended in), blue while on, matching the glow. Review and publish is
   white, so the bar never shows two yellow buttons. */
#lxe .lxe-toggle { background: var(--lxe-changed); color: var(--lxe-ink); }
#lxe .lxe-toggle[aria-pressed="true"] { background: var(--lxe-accent); color: #fff; }
#lxe .lxe-count { font-size: 14px; color: #c9d1d9; flex: 1 1 auto; }
#lxe .lxe-publish { background: #fff; color: var(--lxe-ink); }
#lxe .lxe-publish:disabled { opacity: .45; cursor: default; }
#lxe .lxe-menu { background: transparent; color: #c9d1d9; border-color: #3b4454; }
/* On a phone the bar is two rows, not three: Edit beside the hint (which
   wraps onto two lines rather than taking a row of its own), then the buttons. */
@media (max-width: 520px) {
  #lxe { padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); gap: 6px; }
  #lxe button { padding: 0 10px; font-size: 14px; }
  #lxe .lxe-count { flex: 1 1 180px; min-width: 0; font-size: 13px; line-height: 1.3; }
}

.lxe-tray {
  flex: 1 0 100%; order: -1; padding: 10px 12px; border-radius: 8px;
  background: #222a36; font-size: 14px; line-height: 1.45;
}
.lxe-tray.lxe-bad { background: #3a1714; }
.lxe-tray.lxe-good { background: #10301b; }
.lxe-steps { display: flex; gap: 6px; margin: 6px 0 2px; flex-wrap: wrap; }
.lxe-steps span { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #2b3240; color: #8b95a3; }
/* A finished step turns green and stays green, so progress reads at a glance
   (Michael's request); the current step is blue. */
.lxe-steps span.lxe-done { background: var(--lxe-good); color: #fff; }
.lxe-steps span.lxe-now { background: var(--lxe-accent); color: #fff; }
.lxe-tray a { color: #9cc4ff; }

.lxe-tip {
  position: absolute; z-index: 2147483001; max-width: min(320px, calc(100vw - 32px));
  padding: 10px 12px; border-radius: 8px; background: var(--lxe-ink); color: var(--lxe-paper);
  font: 500 14px/1.45 Inter, system-ui, sans-serif; box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}

.lxe-toast {
  /* Above the sheets: the roster form's "already on the board" was drawn
     behind its own form, so Add player looked dead (Michael, 2026-10-02). */
  position: fixed; left: 16px; right: 16px; bottom: calc(var(--lxe-bar-h, 80px) + 12px); z-index: 2147483003;
  margin: 0 auto; max-width: 460px; padding: 10px 14px; border-radius: 8px;
  background: #2b3240; color: #fff; font: 500 14px/1.45 Inter, system-ui, sans-serif;
}

.lxe-sheet-back {
  position: fixed; inset: 0; z-index: 2147483002; background: rgba(10, 13, 18, .55);
  display: flex; align-items: flex-end; justify-content: center;
}
.lxe-sheet {
  width: 100%; max-width: 720px; max-height: 88vh; overflow: auto;
  background: var(--lxe-paper); color: var(--lxe-ink); border-radius: 14px 14px 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  font: 400 15px/1.5 Inter, system-ui, sans-serif;
}
@media (min-width: 720px) {
  .lxe-sheet-back { align-items: center; }
  .lxe-sheet { border-radius: 14px; }
}
.lxe-sheet h2 { font-size: 20px; margin: 0 0 4px; }
.lxe-sheet h3 { font-size: 13px; margin: 18px 0 6px; color: var(--lxe-muted); text-transform: uppercase; letter-spacing: .04em; }
.lxe-change { border: 1px solid var(--lxe-line); border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.lxe-before { color: var(--lxe-muted); text-decoration: line-through; margin: 0 0 4px; }
.lxe-after { margin: 0 0 8px; }
.lxe-sheet button {
  min-height: 44px; padding: 0 16px; border-radius: 8px; font: 600 15px Inter, system-ui, sans-serif; cursor: pointer;
  border: 1px solid var(--lxe-line); background: #fff; color: var(--lxe-ink);
}
.lxe-sheet .lxe-go { background: var(--lxe-changed); border-color: var(--lxe-changed); }
.lxe-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }

/* The sign in page. */
.lxe-signin { max-width: 440px; margin: 0 auto; padding: 48px 16px 64px; }
.lxe-signin .logo img { height: 48px; width: auto; }
.lxe-signin h1 { margin: 24px 0 16px; }
.lxe-card { border: 1px solid var(--lxe-line); border-radius: 12px; padding: 20px; display: grid; gap: 10px; background: #fff; }
.lxe-card label { font-weight: 600; }
.lxe-card input { min-height: 48px; padding: 0 12px; font-size: 18px; border: 1px solid var(--lxe-line); border-radius: 8px; }
.lxe-card button, .lxe-card .lxe-button { min-height: 48px; border: 0; border-radius: 8px; background: var(--lxe-accent); color: #fff; font-size: 16px; font-weight: 600; cursor: pointer; }
.lxe-hint { color: var(--lxe-muted); font-size: 14px; margin: 0; }
.lxe-message { margin-top: 14px; padding: 12px 14px; border-radius: 8px; background: #fdecea; color: var(--lxe-bad); }

/* The roster form (roster.js). */
.lxe-form { display: grid; gap: 10px; margin-top: 12px; }
.lxe-field { display: grid; gap: 4px; font-weight: 600; font-size: 14px; }
.lxe-field input, .lxe-field select {
  min-height: 44px; padding: 0 10px; font: 400 16px Inter, system-ui, sans-serif;
  border: 1px solid var(--lxe-line); border-radius: 8px; background: #fff; color: var(--lxe-ink); width: 100%;
}
.lxe-check { display: flex; gap: 10px; align-items: center; min-height: 44px; font-size: 15px; }
.lxe-check input { width: 22px; height: 22px; }
.lxe-sheet .lxe-danger { background: #fff; border-color: var(--lxe-bad); color: var(--lxe-bad); margin-right: auto; }
#lxe .lxe-add { background: #2b3240; color: #fff; border-color: #3b4454; }
#lxe .lxe-add[hidden] { display: none; }
.lxe-on #rows tr { cursor: pointer; }
.lxe-on #rows tr.lxe-changed td { background: rgba(242, 183, 5, .16); }
.lxe-on #rows tr.lxe-removed td { text-decoration: line-through; opacity: .55; }

/* The FAQ and program card forms (forms.js). A question and a card are each
   one tappable unit, outlined like editable text; the lock outline on the
   answer inside would only add a second box. */
.lxe-field textarea {
  padding: 8px 10px; font: 400 16px/1.45 Inter, system-ui, sans-serif; resize: vertical;
  border: 1px solid var(--lxe-line); border-radius: 8px; background: #fff; color: var(--lxe-ink); width: 100%;
}
.lxe-on main .faq details, .lxe-on main .also a {
  outline: 2px dashed rgba(31, 111, 235, .55); outline-offset: 3px; cursor: pointer;
}
.lxe-on main .faq [data-lxe-lock] { outline: none; }
.lxe-on main .faq details.lxe-changed, .lxe-on main .also a.lxe-changed { outline-color: var(--lxe-changed); background: rgba(242, 183, 5, .12); }
.lxe-on main .faq details.lxe-removed { text-decoration: line-through; opacity: .55; }
.lxe-faq-add {
  margin-top: 14px; min-height: 44px; padding: 0 16px; border-radius: 8px; border: 1px solid #3b4454;
  background: #2b3240; color: #fff; font: 600 15px Inter, system-ui, sans-serif; cursor: pointer;
}
.lxe-faq-add[hidden] { display: none; }

/* The publish progress bar (editor.js progressBar): blue while publishing,
   full at Live, red where it stopped on a failure. */
.lxe-progress { height: 6px; margin: 8px 0 2px; border-radius: 999px; background: #2b3240; overflow: hidden; }
.lxe-progress span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--lxe-accent); transition: width .5s linear; }
.lxe-progress.lxe-progress-bad span { background: var(--lxe-bad); }
@media (prefers-reduced-motion: reduce) { .lxe-progress span { transition: none; } }

/* History (history.js). */
#lxe .lxe-history { background: transparent; color: #c9d1d9; border-color: #3b4454; }
.lxe-when { font-weight: 700; margin: 0 0 4px; }
