/* The Browser page: two rows like Chrome (tabs, then the address bar) over the picture of the screen. */
.br-view {
  height: var(--app-h); min-height: 0;
  display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top);
  overflow: hidden;
}

/* ---- row 1: tabs ---- */
.br-tabs {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 8px 0;
  background: var(--surface-2);
}
.br-home { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; }
.br-home:hover { text-decoration: none; }
.br-tab-list {
  flex: 1; min-width: 0;
  display: flex; gap: 2px; align-items: flex-end;
  overflow-x: auto; scrollbar-width: none;
}
.br-tab-list::-webkit-scrollbar { display: none; }
.br-tab {
  display: flex; align-items: center; gap: 4px;
  flex: 0 1 200px; min-width: 90px;
  padding: 6px 6px 7px 12px;
  border-radius: 9px 9px 0 0;
  font-size: 13px; color: var(--muted); cursor: pointer;
  border: 0; background: transparent;
}
.br-tab:hover { color: var(--text); background: color-mix(in srgb, var(--surface) 50%, transparent); }
.br-tab.active { background: var(--surface); color: var(--text); }
.br-tab .t { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: left; }
.br-tab .x {
  width: 20px; height: 20px; padding: 0; border-radius: 5px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 15px; line-height: 1; color: var(--faint);
}
.br-tab .x:hover { color: var(--text); background: var(--surface-2); }

.br-tool {
  width: 32px; height: 32px; padding: 0; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 8px; color: var(--muted); font-size: 16px; line-height: 1;
  cursor: pointer; list-style: none;
}
.br-tool::-webkit-details-marker { display: none; }
.br-tool:hover:not(:disabled) { color: var(--text); background: color-mix(in srgb, var(--text) 8%, transparent); }

/* the ⋯ menu */
.br-menu { position: relative; }
.br-menu-list {
  position: absolute; right: 0; top: 36px; z-index: 20;
  min-width: 210px; padding: 6px;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
}
.br-menu-list > button, .br-menu-list > a {
  display: block; width: 100%; text-align: left;
  padding: 8px 10px; border-radius: 8px; font-size: 14px; color: var(--text); background: none;
}
.br-menu-list > .danger { color: var(--danger); }
.br-menu-list > button:hover, .br-menu-list > a:hover { background: var(--surface-2); text-decoration: none; }
.br-menu-list hr { border: 0; border-top: 1px solid var(--border); margin: 4px 2px; }

/* ---- row 2: address bar ---- */
.br-bar {
  display: flex; align-items: center; gap: 2px;
  padding: 5px 8px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.br-bar input#address {
  flex: 1; min-width: 0;
  margin: 0 4px; padding: 6px 12px;
  border-radius: 999px; font-size: 14px;
  background: var(--surface-2); border-color: transparent;
}
.br-bar input#address:focus { background: var(--surface); border-color: var(--accent); }
.br-bar .dot { margin: 0 4px; }

.br-warn { margin: 0; padding: 6px 14px; font-size: 13px; background: color-mix(in srgb, var(--warn) 14%, var(--surface)); color: var(--warn); }
.br-confirm {
  padding: 10px 14px; font-size: 14px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
  border-bottom: 1px solid var(--border);
}
.br-confirm p { margin: 0; flex: 1 1 280px; }

/* ---- the screen ---- */
.br-screen {
  position: relative; flex: 1; min-height: 0;
  overflow: hidden;
  background: var(--surface-2);
}
#picture {
  position: absolute; left: 0; top: 0;
  display: block; max-width: 100%; max-height: 100%;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  touch-action: none; cursor: default;
  image-rendering: auto;
}
/* Off-screen but focusable, so keys and pastes land in it and phones show their keyboard. */
.br-keys {
  position: absolute; left: 0; top: 0; width: 1px; height: 1px;
  opacity: 0; padding: 0; border: 0; resize: none; overflow: hidden;
  font-size: 16px; /* 16px stops iPhones zooming in when it gets the focus */
  pointer-events: none;
}
.br-overlay {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 24px; text-align: center;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(2px);
}
.br-overlay p { margin: 0; max-width: 420px; }
#overlay-text { font-size: 16px; font-weight: 600; }

@media (max-width: 560px) {
  .br-tab { min-width: 76px; padding-left: 9px; }
  .br-tool { width: 30px; }
  .br-bar { padding: 4px 4px; }
  .br-bar input#address { margin: 0 2px; padding: 6px 10px; }
}
