.phone-tool-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 50vh;
  padding: 20px;
  box-sizing: border-box;
}

/* Help box */
.phone-help-box {
  margin-top: 0;
  margin-left: 430px;
  padding: 24px;
  background: #e3f2fd;
  border-radius: 16px;
  font-size: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.phone-help-title {
  font-size: 24px;
  margin-bottom: 16px;
  color: #1976d2;
}

.phone-help-text {
  max-width: 1000px;
  text-align: left;
  line-height: 1.6;
}

.phone-help-local {
  display: block;
}

.phone-help-global {
  display: none;
}

.phone-container {
  position: relative;
  width: 280px;
  height: 560px;
  background: linear-gradient(145deg, #ccc, #999);
  border-radius: 20px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  box-sizing: border-box;
  overflow: visible;
}

.resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: #666;
  cursor: nw-resize;
  border-radius: 0 0 20px 0;
}

.phone-close-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 12px;
  height: 14px;
  background: rgb(255 255 255 / 0);
  color: #ddd;
  cursor: pointer;
  padding: 0;
}
.phone-close-btn:hover {
  background: #000;
  color: #fff;
}

.phone-screen {
  width: 100%;
  height: 100%;
  border-radius: 15px;
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.screen-content {
  width: 90%;
  height: 90%;
  background: #fff;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
  color: #333;
  padding: 10px;
  box-sizing: border-box;
}

/* Mode selector */
.phone-mode-selector {
  margin: 15px 0;
  padding: 10px;
  background: #f5f5f5;
  border-radius: 8px;
  width: 100%;
}

.phone-mode-label {
  font-weight: bold;
  font-size: 13px;
}

.phone-mode-options {
  margin-top: 8px;
}

.phone-mode-option {
  cursor: pointer;
  margin-right: 20px;
}

/* Forms */
.phone-form {
  display: none;
  width: 100%;
}

.phone-form-local {
  display: block;
}

.phone-form-note {
  font-size: 12px;
  color: #666;
}

.phone-form-hint {
  font-size: 11px;
  color: #888;
  margin-bottom: 10px;
}

.phone-global-wrapper {
  position: relative;
}

.phone-input-url, .phone-input-global {
  width: 100%;
  max-width: 300px;
  padding: 8px 50px 12px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: monospace;
  box-sizing: border-box;
  margin-bottom: 10px;
}

.phone-btn-start {
  padding: 10px 20px;
  background: #4CAF50;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
}

.phone-btn-start:hover {
  background: #43a047;
}

.phone-status-message {
  color: blue;
  font-size: 12px;
  margin-top: 10px;
}

.phone-stream-status {
  font-size: 11px;
  margin-top: 4px;
}

.phone-stream-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
}

.phone-stream-img,
.phone-stream-iframe {
  width: 100%;
  height: 100%;
  border: none;
  object-fit: contain;
  background: #000;
}

.phone-badge-global {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(33,150,243,0.9);
  color: #fff;
  padding: 5px 10px;
  border-radius: 15px;
  font-size: 11px;
  font-weight: bold;
}

.phone-badge-status {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255,193,7,0.9);
  color: #000;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 11px;
}

.phone-btn-open,
.phone-btn-stop {
  position: absolute;
  bottom: 10px;
  padding: 6px 12px;
  border: none;
  border-radius: 15px;
  cursor: pointer;
  font-size: 12px;
  opacity: 0.8;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.phone-btn-open {
  left: 10px;
  background: rgba(33,150,243,0.9);
  color: #fff;
}

.phone-btn-stop {
  right: 10px;
  background: rgba(255,68,68,0.9);
  color: #fff;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phone-stream-wrapper:hover .phone-btn-stop,
.phone-stream-wrapper:hover .phone-btn-open {
  opacity: 1;
  transform: scale(1.05);
}

.phone-tool-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 50vh; 
  padding: 20px; 
  box-sizing: border-box;
  width: 100%; 
}

.phone-container {
  position: absolute;
  z-index: 2147483647; 
  width: 280px;
  height: auto;
  aspect-ratio: 5/10;
  background: linear-gradient(145deg, #ccc, #999);
  border-radius: 20px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  padding: 10px;
  box-sizing: border-box;
  cursor: move;
}

.resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 5px;
  height: 5px;
  background: #666;
  cursor: nw-resize; 
  border-radius: 0 0 20px 0; 
}

.phone-screen {
  width: 100%;
  height: 100%;
  background: #000;
  border-radius: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.screen-content {
  width: 90%;
  height: 90%;
  background: #fff;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: #333;
}

.phone-notch {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  background: #bbb;
  border-radius: 50%;
  z-index: 1;
}

.phone-speaker {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: #bbb;
  border-radius: 2px;
}

.phone-camera {
  position: absolute;
  top: 15px;
  right: 40px;
  width: 8px;
  height: 8px;
  background: #666;
  border-radius: 50%;
}

.phone-home-button {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  background: #ccc;
  border-radius: 50%;
  border: 1px solid #999;
}

button {
  margin-top: 0px;
  padding: 8px 16px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
}

button:hover {
  background: #5321f3;
}

@keyframes phoneOverlayFadeIn {
  from {opacity:0;}
  to {opacity:0.97;}
}
@media (min-width: 1200px) {
  .phone-container {
	max-width: 1200px;
  }
}
@media (max-width: 768px) {
  .phone-container {
	width: 95vw; 
	padding: 8px; 
  }
  .phone-notch {
	width: 18px; 
	height: 18px;
  }
  .phone-speaker {
	width: 60px;
  }
  .phone-home-button {
	width: 35px;
	height: 35px;
  }
}
