/* URL Connection browser — Apple/Finder-flavoured chrome that mirrors the SFTP
   file-explorer design language (token-driven surface, hairline borders,
   rounded translucent icon buttons). The unframed connection icon takes the
   place of the file-explorer sidebar toggle; there is no sidebar here. */

.webview-workspace {
  box-sizing: border-box;
  min-width: 0;
  overflow: hidden;
  /* Grey field so the white pane / toolbar read as the Default-scheme design
     language, matching the SFTP/File Explorer surface. */
  background: var(--app-bg);
}

/* Token-driven light surface in place of the dark terminal gradient. */
.webview-pane {
  grid-template-rows: 44px minmax(0, 1fr);
  width: 100%;
  height: 100%;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.webview-pane > header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 10px;
  align-items: center;
  padding: 0 8px 0 10px;
  color: var(--text);
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
  overflow: hidden;
}

.webview-nav-group {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  flex-shrink: 1;
  font-weight: 500;
}

/* Connection identity — sits where the File Explorer sidebar toggle would. */
.webview-conn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  color: var(--accent);
  background: transparent;
  box-shadow: none;
}

.webview-conn-icon img {
  border-radius: 0;
}

.webview-nav-cluster {
  display: flex;
  gap: 2px;
  align-items: center;
  flex: 0 0 auto;
}

/* Apple-esque icon buttons, matching .sftp-icon-btn. */
.webview-pane .terminal-pane-action {
  width: 28px;
  height: 28px;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
  transition: background 0.12s, color 0.12s;
}

.webview-pane .terminal-pane-action:hover {
  color: var(--text);
  background: var(--hover);
}

.webview-pane .terminal-pane-action:active {
  background: var(--press);
}

.webview-pane .terminal-pane-action:disabled {
  color: var(--text-faint);
  background: transparent;
  opacity: 0.55;
  cursor: default;
}

/* Address bar styled like the File Explorer path field. */
.webview-address-bar {
  display: flex;
  flex: 1 1 auto;
  gap: 7px;
  align-items: center;
  min-width: 0;
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--surface-muted);
  box-shadow: inset 0 0 0 0.5px var(--border);
  transition: background 0.14s, box-shadow 0.14s;
}

.webview-address-bar:hover {
  background: color-mix(in srgb, var(--surface-muted) 70%, var(--surface));
}

.webview-address-bar:focus-within {
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--accent), var(--ring);
}

.webview-address-lock {
  display: inline-flex;
  flex: 0 0 auto;
  color: var(--green);
}

.webview-address-lock.insecure {
  color: var(--text-faint);
}

.webview-address-bar.is-http .webview-address-lock,
.webview-address-bar.is-http .webview-address-input {
  color: var(--red);
}

.webview-pane .webview-address-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  padding: 0;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  letter-spacing: -0.005em;
  background: transparent;
  border: 0;
  outline: none;
}

.webview-pane .webview-address-input::placeholder {
  color: var(--text-faint);
}

.webview-pane .terminal-pane-actions {
  flex-shrink: 0;
  gap: 4px;
  min-width: max-content;
}

.webview-auto-refresh-select {
  height: 28px;
  max-width: 132px;
  padding: 0 22px 0 9px;
  color: var(--text-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 560;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 8px;
  outline: none;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.webview-auto-refresh-select:hover {
  color: var(--text);
  background: var(--hover);
}

.webview-auto-refresh-select option {
  color: var(--text);
  background: var(--surface);
}

.webview-auto-refresh-select:focus {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

.webview-pane .terminal-pane-action.webview-close-action:hover {
  color: var(--red);
  background: color-mix(in srgb, var(--red) 14%, transparent);
}

.webview-pane .webview-toolbar-status {
  max-width: 220px;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Surface behind the native overlay (visible while loading / suppressed). */
.webview-placeholder {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  place-items: center;
  color: var(--text-muted);
  background: var(--surface-muted);
}

.webview-placeholder-message {
  position: relative;
  z-index: 1;
  padding: 24px;
  text-align: center;
}

.webview-placeholder-error {
  position: relative;
  z-index: 1;
  justify-self: stretch;
  padding: 12px;
}

.webview-suppression-snapshot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}
