/* ===== BROWSER PAGE (iframe) ===== */
.browser-status-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  padding: 14px 24px 0;
  background: rgb(var(--browser-top-edge-rgb));
}
.browser-page {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: rgb(var(--browser-top-edge-rgb));
  --browser-collapse-progress: 0;
  --browser-safe-area-top: max(env(safe-area-inset-top, 0px), 28px);
  --browser-safe-area-bottom: max(env(safe-area-inset-bottom, 0px), 20px);
  --browser-top-edge-rgb: 246 247 249;
  --browser-bottom-edge-rgb: 246 247 249;
  --browser-top-banner: 0;
  --browser-bottom-banner: 0;
  --browser-bottom-band-height: 0px;
  --browser-current-top-inset: 0px;
  --browser-current-bottom-inset: 0px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.browser-page.visible {
  opacity: 1;
  pointer-events: auto;
}
.browser-iframe-wrap {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}
.browser-top-safe-area {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--browser-safe-area-top) + 34px);
  z-index: 2;
  pointer-events: none;
  opacity: 0;
}
.browser-top-safe-area-fill,
.browser-top-safe-area-mask {
  position: absolute;
  left: 0;
  right: 0;
}
.browser-top-safe-area-fill {
  top: 0;
  height: calc(var(--browser-safe-area-top) + 1px);
  background: rgb(var(--browser-top-edge-rgb));
}
.browser-top-safe-area-mask {
  top: calc(var(--browser-safe-area-top) - 1px);
  height: 36px;
  background: linear-gradient(
    180deg,
    rgb(var(--browser-top-edge-rgb) / 0.18) 0%,
    rgb(var(--browser-top-edge-rgb) / 0.08) 34%,
    rgb(var(--browser-top-edge-rgb) / 0.03) 66%,
    transparent 100%
  );
}
.browser-iframe-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}
.browser-bottom-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding-top: 6px;
  background: rgba(230,230,230,0.85);
  backdrop-filter: blur(50px);
  -webkit-backdrop-filter: blur(50px);
  overflow: visible;
}
.browser-bottom-safe-area-mask {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--browser-current-bottom-inset);
  background-color: rgb(var(--browser-bottom-edge-rgb));
  background-image: none;
  backdrop-filter: blur(22px) saturate(1.12);
  -webkit-backdrop-filter: blur(22px) saturate(1.12);
  opacity: 0;
  pointer-events: none;
}
.browser-bottom-bar .address-row {
  padding: 0 12px 4px;
}
.browser-bottom-bar .omni-box {
  overflow: visible;
}
.browser-bottom-bar .omni-left {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding-left: 0;
}
.browser-bottom-bar .omni-left svg {
  width: 24px;
  height: 24px;
}
.browser-bottom-bar .omni-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-width: 0;
  overflow: hidden;
}
.browser-bottom-bar .omni-center .lock-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-right: 2px;
}
.browser-bottom-bar .omni-center span {
  font-family: var(--font-ui-sans);
  font-size: 17px;
  font-weight: 450;
  color: #242424;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.browser-bottom-bar .omni-right {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding-right: 0;
  position: relative;
}
.browser-bottom-bar .omni-right svg {
  width: 24px;
  height: 24px;
}

/* ===== Summarize morph (long article + Copilot Mode) =====
   Triggered by .summarize-morph on .browser-omni-box. The domain + reload
   cross-fade out while "Summarize this page" + search icon slide in. */

/* center: stack domain (lock+url) and the summarize label in the same slot */
.browser-bottom-bar .omni-center {
  position: relative;
}
.browser-bottom-bar .omni-summarize-label {
  position: absolute;
  left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  opacity: 0;
  transform: translateY(7px);
  pointer-events: none;
  transition: opacity 0.32s cubic-bezier(0.2, 0, 0, 1),
              transform 0.32s cubic-bezier(0.2, 0, 0, 1);
}
/* domain (lock + url) — default visible, fades up on morph */
.browser-bottom-bar .omni-center .lock-icon,
.browser-bottom-bar .omni-center #browserUrlText {
  transition: opacity 0.26s ease, transform 0.32s cubic-bezier(0.2, 0, 0, 1);
}
.browser-bottom-bar.summarize-morph .omni-center .lock-icon,
.browser-bottom-bar.summarize-morph .omni-center #browserUrlText {
  opacity: 0;
  transform: translateY(-7px);
  pointer-events: none;
}
.browser-bottom-bar.summarize-morph .omni-summarize-label {
  opacity: 1;
  transform: translateY(0);
  pointer-events: none;
}

/* right icon swap: reload <-> search */
.browser-bottom-bar .omni-right .omni-reload-icon,
.browser-bottom-bar .omni-right .omni-search-icon {
  position: absolute;
  transition: opacity 0.26s ease, transform 0.3s cubic-bezier(0.2, 0, 0, 1);
}
.browser-bottom-bar .omni-right .omni-search-icon {
  opacity: 0;
  transform: scale(0.7) rotate(-25deg);
}
.browser-bottom-bar.summarize-morph .omni-right .omni-reload-icon {
  opacity: 0;
  transform: scale(0.7) rotate(25deg);
}
.browser-bottom-bar.summarize-morph .omni-right .omni-search-icon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

/* pill affordance: a soft copilot tint + ring when morphed, interactive */
.browser-bottom-bar.summarize-morph .browser-omni-box {
  cursor: pointer;
  background: linear-gradient(96deg, rgba(255,255,255,0.95), rgba(244,238,255,0.95));
  box-shadow: 0 0 0 1px rgba(124, 58, 191, 0.16),
              0 4px 14px rgba(124, 58, 191, 0.12);
}
/* one-shot shimmer sweep when the morph first applies */
.browser-bottom-bar.summarize-morph.summarize-morph-enter .browser-omni-box::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,0.55) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: omni-summarize-sweep 0.7s ease 1;
  pointer-events: none;
}
@keyframes omni-summarize-sweep {
  to { transform: translateX(100%); }
}
.browser-bottom-bar .navi {
  width: 390px;
}
.browser-bottom-bar .nav-btn {
  height: 44px;
}
.browser-bottom-bar .nav-btn img {
  display: none;
}
.browser-bottom-bar .nav-btn svg {
  width: 100%;
  height: 44px;
}
.browser-bottom-bar #browserTabBtn svg {
  width: 24px;
  height: 24px;
}
.browser-bottom-bar #browserTabBtn .tab-count {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.browser-bottom-bar .home-indicator-bar {
  background: #1a1a1a;
}
.browser-bottom-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0.5px;
  background: rgba(0,0,0,0.06);
}
.nav-btn.disabled {
  opacity: 0.3;
  pointer-events: none;
}
.nav-btn .tab-count {
  position: absolute;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  font-family: var(--font-ui-sans);
  color: white;
  pointer-events: none;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}
.nav-btn .tab-count + img,
.nav-btn img:has(+ .tab-count) {
  /* handled by order */
}
.browser-bottom-bar .nav-btn .tab-count {
  color: rgba(0,0,0,0.86);
}

/* QF mode: input text turns dark when user is typing */
.zip-input-text .qf-typed {
  color: rgba(0,0,0,0.86);
}
.zip-input-text .qf-selected {
  color: rgba(0,0,0,0.86);
  background: rgba(0,120,215,0.15);
  border-radius: 3px;
  padding: 2px 0;
}
.zip-input-text .qf-placeholder {
  color: rgba(0,0,0,0.74);
}

/* Top sites clickable */
.top-site[data-url], .zip-top-site[data-url] {
  cursor: pointer;
}
.top-site[data-url]:active, .zip-top-site[data-url]:active {
  opacity: 0.6;
}

/* QF mode: hide top sites */
.zip-page.qf-mode #zipTopSites {
  display: none;
}

/* ===== Collapsed domain bar (auto-hide on scroll) ===== */
.collapsed-domain-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
.collapsed-domain-bar span {
  font-size: 14px;
  font-weight: 450;
  color: rgba(0, 0, 0, 0.56);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

/* GPU-accelerated collapse via transform */
.browser-bottom-bar {
  will-change: transform;
  transition: transform 0.28s cubic-bezier(0.2, 0, 0, 1);
}
.browser-bottom-bar .address-row,
.browser-bottom-bar .navi {
  transition: opacity 0.18s ease;
}

/* Collapsed state — slide bar down, leaving only top 28px visible */
.browser-bottom-bar.collapsed {
  transform: translateY(calc(100% - 28px));
}
.browser-bottom-bar.collapsed .collapsed-domain-bar {
  opacity: 1;
  pointer-events: auto;
}
.browser-bottom-bar.collapsed .address-row,
.browser-bottom-bar.collapsed .navi {
  opacity: 0;
  pointer-events: none;
}

