* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.tor-window-body {
  width: 100vw;
  height: 100vh;
  background-color: #030305;
  background-image: radial-gradient(circle at 50% 50%, #150d26 0%, #030305 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", sans-serif;
  color: #f1f5f9;
  overflow: hidden;
}

.tor-browser-window {
  width: 1120px;
  height: 720px;
  max-width: 96vw;
  max-height: 94vh;
  background: #0f0c18;
  border: 1px solid rgba(157, 78, 221, 0.35);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.95), 0 0 35px rgba(123, 44, 191, 0.25);
  overflow: hidden;
  position: relative;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tor-browser-window.maximized {
  width: 98vw;
  height: 96vh;
}

/* TITLEBAR */
.tor-titlebar {
  height: 38px;
  background: #181326;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  gap: 1.25rem;
}

.traffic-lights {
  display: flex;
  gap: 8px;
}

.light {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  cursor: pointer;
}

.light.close { background: #ff5f56; }
.light.minimize { background: #ffbd2e; }
.light.zoom { background: #27c93f; }

.tor-tab-strip {
  display: flex;
  align-items: center;
  flex: 1;
}

.tor-tab {
  background: #231b38;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 0.4rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  max-width: 260px;
}

.tab-close { color: #a1a1aa; margin-left: auto; }

/* TOOLBAR */
.tor-toolbar {
  background: #1d1630;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-controls {
  display: flex;
  gap: 0.4rem;
}

.tool-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.tool-btn:hover { background: rgba(255, 255, 255, 0.12); }

.address-bar-form {
  flex: 1;
  background: #0f0a1d;
  border: 1px solid rgba(157, 78, 221, 0.45);
  border-radius: 20px;
  height: 36px;
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  gap: 0.6rem;
  transition: all 0.2s ease;
}

.address-bar-form:focus-within {
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.onion-circuit-indicator {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-family: 'JetBrains Mono', monospace;
  color: #38bdf8;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
  padding-right: 0.6rem;
}

.tor-address-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  outline: none;
}

.tor-address-input::placeholder { color: #64748b; }

.tor-go-btn {
  background: #7b2cbf;
  border: none;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  transition: background 0.2s ease;
}

.tor-go-btn:hover { background: #9d4edd; }
.tor-security-badge { cursor: pointer; font-size: 1.1rem; }

/* BOOKMARKS */
.tor-bookmarks-bar {
  background: #161124;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0.4rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
}

.bm-label { color: #94a3b8; }

.bm-chip {
  background: rgba(123, 44, 191, 0.2);
  border: 1px solid rgba(157, 78, 221, 0.4);
  color: #38bdf8;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.bm-chip:hover {
  background: rgba(123, 44, 191, 0.45);
  color: #ffffff;
}

.bm-chip.purple {
  border-color: #c77dff;
  color: #c77dff;
}

/* VIEWPORT */
.tor-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 2.5rem 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.onion-home-hero {
  max-width: 650px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.giant-onion-logo {
  margin-bottom: 1.25rem;
  filter: drop-shadow(0 0 25px rgba(157, 78, 221, 0.5));
}

.onion-hero-title {
  font-size: 2.2rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.6rem;
}

.onion-hero-sub {
  font-size: 0.95rem;
  color: #94a3b8;
  margin-bottom: 2rem;
  line-height: 1.5;
}

.central-search-box {
  width: 100%;
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.central-input {
  flex: 1;
  background: #171126;
  border: 1px solid rgba(157, 78, 221, 0.4);
  border-radius: 12px;
  padding: 0.8rem 1.25rem;
  color: #fff;
  font-size: 0.95rem;
  font-family: 'JetBrains Mono', monospace;
  outline: none;
}

.central-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.3);
}

.central-search-btn {
  background: linear-gradient(135deg, #7b2cbf, #0077b6);
  border: none;
  color: #fff;
  font-weight: 600;
  padding: 0 1.5rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.central-search-btn:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.onion-tip-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: left;
  width: 100%;
}

.tip-title {
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  color: #38bdf8;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.tip-text {
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.5;
}

/* MODAL */
.tor-modal-backdrop {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 5, 10, 0.9);
  backdrop-filter: blur(16px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.circuit-modal-card {
  width: 480px;
  background: #140e24;
  border: 1px solid #7b2cbf;
  border-radius: 18px;
  padding: 2.25rem 2rem;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 30px rgba(123, 44, 191, 0.35);
}

.circuit-spinner {
  font-size: 3rem;
  margin-bottom: 1rem;
  animation: spinOnion 2s linear infinite;
  display: inline-block;
}

@keyframes spinOnion {
  0% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.1) rotate(180deg); }
  100% { transform: scale(1) rotate(360deg); }
}

.circuit-title {
  font-size: 1.15rem;
  color: #fff;
  margin-bottom: 0.4rem;
}

.circuit-route {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: #38bdf8;
  margin-bottom: 1.5rem;
  min-height: 24px;
}

.circuit-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.circuit-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #7b2cbf, #38bdf8);
  transition: width 0.3s ease;
}

.nodes-diagram {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: #64748b;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
}

.node-item { color: #cbd5e1; }
