
/* Inline add-editor: name + address + save/cancel, revealed under the favorites row. */
.browser-fav-editor {
  display: flex;
  align-items: center;
  gap: 6px;
}
.browser-fav-editor[hidden] { display: none; }
.browser-fav-input {
  min-width: 0;
  height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--text, #e8eaf0);
  font-size: 12px;
  outline: none;
}
.browser-fav-input:focus { border-color: rgba(var(--accent-rgb, 90 130 255), 0.7); }
.browser-fav-name { flex: 0 1 34%; }
.browser-fav-url { flex: 1 1 auto; }
.browser-fav-editor .browser-btn { width: 28px; height: 28px; }

/* Chrome hidden — a maximized-video mode: drop the tab strip, address bar and
   favorites so the page fills the whole tile. A floating button brings them back. */
.browser-wrap.is-chrome-hidden .browser-tabs,
.browser-wrap.is-chrome-hidden .browser-bar,
.browser-wrap.is-chrome-hidden .browser-favorites { display: none; }

/* Stage + canvas */
.browser-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: #14161c;
}

/* Toolbar hidden: Reload, Full screen and Show toolbar in one small group over
   the page's top-right corner (js/browser-tile/browser-tile.js, GitHub #149). Quiet until
   used, so a page shown on its own is not covered by controls, and fully
   opaque under a pointer or the keyboard. */
.browser-float {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;                            /* above the tab canvases and the loading overlay */
  display: flex;
  gap: 2px;
  padding: 2px;
  border-radius: 10px;
  background: rgba(20, 22, 28, 0.55);
  backdrop-filter: blur(6px);
  opacity: 0.55;
  transition: opacity 0.15s ease, background 0.15s ease;
}
.browser-float:hover,
.browser-float:focus-within { opacity: 1; background: rgba(20, 22, 28, 0.82); }
.browser-float[hidden] { display: none; }
.browser-float .browser-btn {
  width: 30px;
  height: 26px;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.86);
}
.browser-float .browser-btn:hover { background: rgba(255, 255, 255, 0.14); }
.browser-float .browser-btn svg { width: 15px; height: 15px; }
.browser-canvas {
  position: absolute;          /* tab canvases stack in the stage; only the active shows */
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  /* Stretch the frame to fill the box (the page is rendered at the tile's own
     aspect ratio, so there's no distortion) — this keeps the displayed area
     equal to the canvas box so pointer coordinates map 1:1 to the page. */
  object-fit: fill;
  touch-action: none;          /* we forward gestures to the page ourselves */
  outline: none;
  cursor: default;
}
.browser-canvas[hidden] { display: none; }   /* background tabs — outrank display:block */

.browser-loading {
  position: absolute;
  inset: 0;
  z-index: 2;                            /* above the (absolute) tab canvases */
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  pointer-events: none;
  background: rgba(20, 22, 28, 0.55);   /* dim the stale/blank canvas while loading */
}
.browser-loading[hidden] { display: none; }   /* outrank the flex display above */

/* The Xenon loader runs while a page is loading (no frame yet), so the tile
   never looks frozen during the connect/first-paint window. */
.browser-loading.is-error .xloader { display: none; }   /* error = message only */

/* Error state: a readable, padded message over the tile instead of a silent black canvas. */
.browser-loading.is-error {
  padding: 16px;
  text-align: center;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(0, 0, 0, 0.35);
}

/* Paused by performance mode: a message plus a "Show anyway" button. The overlay
   is click-through by default, so the paused state turns pointer events back on. */
.browser-loading.is-paused {
  padding: 16px;
  text-align: center;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(0, 0, 0, 0.45);
  pointer-events: auto;
}
.browser-paused-resume {
  min-height: 36px;
  padding: 7px 16px;
  border: 1px solid rgba(var(--accent-rgb, 90 130 255), 0.5);
  border-radius: 8px;
  background: rgba(var(--accent-rgb, 90 130 255), 0.14);
  color: inherit;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.browser-paused-resume:hover { background: rgba(var(--accent-rgb, 90 130 255), 0.24); }

/* Was a single centred line. It now carries an action button under the text
   where Xenon can install a browser itself, so it stacks. */
.browser-unavailable {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 100%;
  padding: 16px;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
}

.browser-unavailable p { margin: 0; max-width: 46ch; }

.browser-unavailable-install {
  padding: 7px 16px;
  /* Neutral: green is Bit saying all is well, not a button. */
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #ededed;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.browser-unavailable-install:hover:not(:disabled) { background: rgba(255, 255, 255, 0.16); }
.browser-unavailable-install:disabled { opacity: 0.6; cursor: default; }

/* Expanded: the wrap is portaled to <body> and pinned to fill the viewport. Use
   bare `inset: 0` (not 100vw/100vh) so it stays correct under the Xeneon Edge's
   root `zoom` compensation — the same pattern the lock screen overlay uses. The
   `:fullscreen` selector keeps the native OS-fullscreen element laid out too. */
.browser-wrap.browser-overlay,
.browser-wrap:fullscreen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  border-radius: 0;
  background: #14161c;
}
