/* Toolbar and full screen of the "App embed" block (templates/backend/frontend/app-embed/app-embed.xslt).
   The bar follows the application's theme: dark by default, light when the app's div has data-theme="light"
   (the app's own theme switch changes that attribute). A site can set the --app-embed-* variables. */
.app-embed-frame {
  --app-embed-bg: #0e1011; --app-embed-line: #1f2326; --app-embed-text: #d8d8d3; --app-embed-hi: #f2f1ec;
  --app-embed-accent: #e8a735; --app-embed-page: #08090a;
  border: 1px solid var(--app-embed-line); border-radius: 8px; overflow: clip; background: var(--app-embed-page);
}
.app-embed-frame:has(.app-embed[data-theme="light"]) {
  --app-embed-bg: #ffffff; --app-embed-line: #e3e1da; --app-embed-text: #24272a; --app-embed-hi: #0f1112;
  --app-embed-accent: #b8790f; --app-embed-page: #f3f2ee;
}
.app-embed__bar { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 4px 8px 4px 16px;
  background: var(--app-embed-bg); color: var(--app-embed-text); border-bottom: 1px solid var(--app-embed-line);
  /* docks below the site's own sticky header while scrolling (--app-embed-site-top, set by app-embed.js);
     the application's sticky parts dock below it (--app-embed-top on .app-embed__body) */
  position: sticky; top: var(--app-embed-site-top, 0px); z-index: 30; }
.app-embed__title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 600; color: var(--app-embed-hi); }
.app-embed__tools { display: flex; align-items: center; gap: 6px; }
.app-embed__tools [hidden] { display: none; }
.app-embed__tools [data-act=close] .app-embed__lbl { display: none; }   /* the ✕ alone; its name is in title/aria-label */
.app-embed__tools button, .app-embed__tools a { display: inline-flex; align-items: center; gap: 6px; height: 34px;
  min-width: 34px; justify-content: center; padding: 0 10px; margin: 0; border: 1px solid var(--app-embed-line);
  border-radius: 6px; background: transparent; color: var(--app-embed-text); font: inherit; font-size: .875rem;
  line-height: 1; cursor: pointer; text-decoration: none; }
.app-embed__tools button:hover, .app-embed__tools a:hover,
.app-embed__tools button:focus-visible, .app-embed__tools a:focus-visible { border-color: var(--app-embed-accent);
  color: var(--app-embed-accent); }
.app-embed__tools svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; flex: none; }
@media (max-width: 600px) { .app-embed__lbl { display: none; } }

/* full screen: the real Fullscreen API, or a fixed layer over the page where it is missing (iPhone Safari) or
   after a page switch of the app (a reload, which may not open the real full screen by itself) */
.app-embed-frame.app-embed--full { position: fixed; inset: 0; z-index: 9999; margin: 0; border: 0; border-radius: 0;
  width: 100%; height: 100%; display: flex; flex-direction: column; }
.app-embed-frame:fullscreen { display: flex; flex-direction: column; border: 0; border-radius: 0; }
.app-embed--full .app-embed__bar, .app-embed-frame:fullscreen .app-embed__bar { flex: none; }
/* the body scrolls, so the app's own sticky parts stick to the top of it */
.app-embed--full .app-embed__body, .app-embed-frame:fullscreen .app-embed__body { flex: 1; min-height: 0; overflow: auto; }
html.app-embed-full-open, html.app-embed-full-open body { overflow: hidden; }
