/* Nexus 7 canvas for the embedded GhostLink proxy. */
html[data-embed-proxy="true"] {
  color-scheme: dark;
  --bg: #08080a !important;
  --sidebar-bg: #08080a !important;
  --accent: #f4f4f5 !important;
  --accent-glow: rgba(255, 255, 255, 0.16) !important;
  --text-primary: #f4f4f5 !important;
  --text-dim: #a1a1aa !important;
  --border: rgba(255, 255, 255, 0.13) !important;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif !important;
  --card-bg: #0e0e12 !important;
  --input-bg: rgba(255, 255, 255, 0.045) !important;
  --bg-image: none !important;
  --bg-blur: 0px !important;
  --bg-brightness: 100% !important;
}

html[data-embed-proxy="true"] body {
  height: 100dvh;
  background: #08080a;
  color: var(--text-primary);
  font-family: var(--font);
}

html[data-embed-proxy="true"] body::before {
  display: none !important;
}

html[data-embed-proxy="true"] #update-overlay {
  display: none !important;
}

html[data-embed-proxy="true"] ::selection {
  background: rgba(255, 255, 255, 0.2);
}

html[data-embed-proxy="true"] * {
  scrollbar-color: rgba(255, 255, 255, 0.24) transparent;
}

html[data-embed-proxy="true"] ::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

html[data-embed-proxy="true"] ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
}

html[data-embed-proxy="true"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.34);
}

html[data-embed-proxy="true"] :focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.42);
  outline-offset: 2px;
}

/* Keep the standalone browser chrome from GhostLink out of the way. */
html[data-embed-proxy="true"] .sidebar,
html[data-embed-proxy="true"] .status-hud,
html[data-embed-proxy="true"] .social-hud,
html[data-embed-proxy="true"] #legal-footer {
  display: none !important;
}

html[data-embed-proxy="true"] .main-view {
  width: 100%;
  height: 100dvh;
  min-height: 0;
  margin-left: 0;
  padding: 0;
}

html[data-embed-proxy="true"] .view-section {
  display: none !important;
  height: 100%;
  padding: 0;
}

html[data-embed-proxy="true"] #proxy-content {
  display: flex !important;
  height: 100dvh;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

html[data-embed-proxy="true"] #proxy-app {
  min-height: 0;
}

html[data-embed-proxy="true"] .browser-container {
  color: var(--text-primary);
  background:
    radial-gradient(ellipse at 12% -14%, rgba(255, 255, 255, 0.07), transparent 42%),
    #08080a;
}

/* Browser tabs */
html[data-embed-proxy="true"] .browser-tabs {
  min-height: 44px;
  padding: 7px 12px 0;
  gap: 6px;
  background: rgba(8, 8, 10, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

html[data-embed-proxy="true"] .tab {
  flex: 1 1 170px;
  max-width: 220px;
  padding: 8px 9px 8px 11px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
  background: transparent;
  color: var(--text-dim);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

html[data-embed-proxy="true"] .tab:hover {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.1);
}

html[data-embed-proxy="true"] .tab.active {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025));
  border-color: rgba(255, 255, 255, 0.17);
  border-bottom-color: #08080a;
}

html[data-embed-proxy="true"] .tab.active::before {
  height: 1px;
  background: rgba(255, 255, 255, 0.55);
}

html[data-embed-proxy="true"] .tab.active::after {
  background: #08080a;
}

html[data-embed-proxy="true"] .tab-favicon {
  width: 15px;
  height: 15px;
  border-radius: 4px;
}

html[data-embed-proxy="true"] .tab-title {
  font-size: 0.78rem;
  letter-spacing: -0.01em;
  color: var(--text-dim);
}

html[data-embed-proxy="true"] .tab.active .tab-title {
  color: var(--text-primary);
  text-shadow: none;
}

html[data-embed-proxy="true"] .tab-close {
  border-radius: 5px;
  font-size: 14px;
}

html[data-embed-proxy="true"] .tab-close:hover {
  background: rgba(248, 113, 113, 0.14);
  color: #fca5a5;
}

html[data-embed-proxy="true"] .new-tab {
  width: 29px;
  height: 29px;
  margin-bottom: 5px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  background: transparent;
  color: var(--text-dim);
  box-shadow: none;
}

html[data-embed-proxy="true"] .new-tab svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
}

html[data-embed-proxy="true"] .new-tab:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-primary);
  box-shadow: none;
}

html[data-embed-proxy="true"] .new-tab:hover svg {
  stroke: currentColor;
}

/* Navigation and address row */
html[data-embed-proxy="true"] .proxy-nav {
  padding: 9px 12px;
  gap: 6px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012)), #0a0a0e;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

html[data-embed-proxy="true"] .proxy-nav button {
  width: 32px;
  height: 32px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  box-shadow: none;
}

html[data-embed-proxy="true"] .proxy-nav button svg {
  stroke: currentColor;
}

html[data-embed-proxy="true"] .proxy-nav button:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-primary);
  box-shadow: none;
}

html[data-embed-proxy="true"] .proxy-nav button:hover svg {
  stroke: currentColor;
}

html[data-embed-proxy="true"] .proxy-nav button.bm-active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg);
  box-shadow: none;
}

html[data-embed-proxy="true"] .proxy-nav button.bm-active svg {
  stroke: var(--bg);
}

html[data-embed-proxy="true"] .address-wrapper {
  min-width: 0;
}

html[data-embed-proxy="true"] input.bar {
  height: 36px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.88rem;
  letter-spacing: -0.01em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

html[data-embed-proxy="true"] input.bar:focus {
  border-color: rgba(255, 255, 255, 0.34);
  background: #0b0b0f;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.055);
}

html[data-embed-proxy="true"] input.bar::placeholder {
  color: #6b6b74;
  opacity: 1;
}

html[data-embed-proxy="true"] .loading-bar {
  background: var(--accent);
  box-shadow: none;
}

/* Bookmarks */
html[data-embed-proxy="true"] .bookmark-bar {
  height: 30px;
  min-height: 30px;
  padding: 4px 12px;
  background: #08080a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

html[data-embed-proxy="true"] .bookmark-chip {
  padding: 2px 8px 2px 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  font-size: 0.62rem;
}

html[data-embed-proxy="true"] .bookmark-chip:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

html[data-embed-proxy="true"] .bm-save-btn {
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

html[data-embed-proxy="true"] .bm-save-btn:hover,
html[data-embed-proxy="true"] .bm-save-btn.saved {
  border-color: rgba(255, 255, 255, 0.36);
  color: var(--text-primary);
}

html[data-embed-proxy="true"] .bm-divider {
  background: var(--border);
}

html[data-embed-proxy="true"] .bm-empty-hint {
  color: #6b6b74;
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  opacity: 1;
}

/* Page frame */
html[data-embed-proxy="true"] .iframe-container {
  background: #0b0b0f;
}

html[data-embed-proxy="true"] .iframe-container iframe {
  background: #fff;
}

/* Connection and error overlays */
html[data-embed-proxy="true"] .message-container {
  background: rgba(8, 8, 10, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

html[data-embed-proxy="true"] .message-content {
  background: #0e0e12;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}

html[data-embed-proxy="true"] .message-content h1 {
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-transform: none;
  text-shadow: none;
}

html[data-embed-proxy="true"] .message-content p {
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 0.8rem;
  line-height: 1.6;
}

html[data-embed-proxy="true"] .spinner {
  border-color: rgba(255, 255, 255, 0.16);
  border-top-color: var(--accent);
  box-shadow: none;
}

html[data-embed-proxy="true"] #skip-btn,
html[data-embed-proxy="true"] #retry-btn {
  border-color: rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
}

html[data-embed-proxy="true"] #skip-btn:hover,
html[data-embed-proxy="true"] #retry-btn:hover {
  border-color: rgba(255, 255, 255, 0.32);
  color: var(--text-primary);
  box-shadow: none;
}

/* Settings and bookmark dialogs */
html[data-embed-proxy="true"] .wisp-settings-modal,
html[data-embed-proxy="true"] .server-select-overlay,
html[data-embed-proxy="true"] .bm-edit-modal-overlay {
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

html[data-embed-proxy="true"] .proxy-wisp-card,
html[data-embed-proxy="true"] .server-select-card {
  background: #0e0e12;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

html[data-embed-proxy="true"] .proxy-wisp-header,
html[data-embed-proxy="true"] .server-select-header {
  padding: 16px 18px;
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

html[data-embed-proxy="true"] .proxy-wisp-header h2,
html[data-embed-proxy="true"] .server-select-header h3 {
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-transform: none;
  text-shadow: none;
}

html[data-embed-proxy="true"] .proxy-settings-tabs {
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: #08080a;
}

html[data-embed-proxy="true"] .proxy-settings-tab {
  border-radius: 5px;
  color: var(--text-dim);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.58rem;
  letter-spacing: 0.06em;
}

html[data-embed-proxy="true"] .proxy-settings-tab:hover {
  color: var(--text-primary);
}

html[data-embed-proxy="true"] .proxy-settings-tab.active {
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
}

html[data-embed-proxy="true"] .proxy-settings-panel {
  padding: 16px 18px;
}

html[data-embed-proxy="true"] .psp-label,
html[data-embed-proxy="true"] .section-title,
html[data-embed-proxy="true"] .settings-footer {
  color: #6b6b74;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.58rem;
  letter-spacing: 0.12em;
}

html[data-embed-proxy="true"] .psp-label i {
  color: var(--text-dim);
}

html[data-embed-proxy="true"] .settings-footer {
  border-top-color: rgba(255, 255, 255, 0.09);
}

html[data-embed-proxy="true"] .wisp-option {
  padding: 12px 13px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-dim);
  font-size: 10.5px;
  line-height: 1.6;
}

html[data-embed-proxy="true"] .wisp-option:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.045);
}

html[data-embed-proxy="true"] .wisp-option.active {
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: none;
}

html[data-embed-proxy="true"] .wisp-option-name {
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
}

html[data-embed-proxy="true"] .wisp-option.active .wisp-option-name {
  color: var(--text-primary);
}

html[data-embed-proxy="true"] .wisp-option-url,
html[data-embed-proxy="true"] .ping-text,
html[data-embed-proxy="true"] .current-server-url {
  color: #6b6b74;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.6rem;
}

html[data-embed-proxy="true"] .current-server-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
}

html[data-embed-proxy="true"] .current-server-name {
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  text-shadow: none;
}

html[data-embed-proxy="true"] .btn-change-server,
html[data-embed-proxy="true"] .sc-save-btn,
html[data-embed-proxy="true"] .custom-input-group button {
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
}

html[data-embed-proxy="true"] .btn-change-server:hover,
html[data-embed-proxy="true"] .sc-save-btn:hover,
html[data-embed-proxy="true"] .custom-input-group button:hover {
  box-shadow: none;
}

html[data-embed-proxy="true"] .sc-edit-row,
html[data-embed-proxy="true"] .bm-edit-modal-overlay input {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.035);
}

html[data-embed-proxy="true"] .sc-edit-row:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

html[data-embed-proxy="true"] .close-btn {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  color: var(--text-dim);
}

html[data-embed-proxy="true"] .close-btn:hover {
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--text-primary);
  box-shadow: none;
}

html[data-embed-proxy="true"] .bm-edit-modal-overlay > div {
  background: #0e0e12 !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  border-radius: 14px !important;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6) !important;
}

html[data-embed-proxy="true"] .bm-edit-modal-overlay h3 {
  color: var(--text-primary) !important;
  font-family: var(--font) !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em !important;
  text-transform: none !important;
  text-shadow: none !important;
}

@media (max-width: 720px) {
  html[data-embed-proxy="true"] .browser-tabs {
    min-height: 42px;
    padding: 6px 8px 0;
  }

  html[data-embed-proxy="true"] .proxy-nav {
    gap: 5px;
    padding: 8px;
  }

  html[data-embed-proxy="true"] .proxy-nav button {
    width: 30px;
    height: 30px;
  }

  html[data-embed-proxy="true"] input.bar {
    height: 34px;
    padding: 0 11px;
    font-size: 0.84rem;
  }

  html[data-embed-proxy="true"] .proxy-wisp-header,
  html[data-embed-proxy="true"] .server-select-header {
    padding: 14px;
  }

  html[data-embed-proxy="true"] .proxy-settings-panel {
    padding: 14px;
  }

  html[data-embed-proxy="true"] #devtools-btn {
    display: none;
  }
}
