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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  background: #0d1117;
  color: #e6edf3;
  height: 100vh;
  overflow: hidden;
  overflow-x: hidden;
}

.screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  width: 100%;
}

#idle {
  flex-direction: column;
  min-height: 100vh;
  height: auto;
  overflow-y: auto;
  padding: 48px 16px;
}

.hidden {
  display: none !important;
}

/* Active instances bar */
.active-instances {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
  max-width: 480px;
  width: 90%;
}

.instance-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 6px 12px;
  color: #e6edf3;
  font-size: 13px;
  font-family: monospace;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
}

.instance-badge:hover {
  border-color: #58a6ff;
  background: #1c2128;
}

.instance-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3fb950;
  flex-shrink: 0;
}

.instance-badge .badge-id {
  color: #58a6ff;
}

.instance-badge .badge-age {
  color: #484f58;
  font-size: 11px;
}

/* Card */
.card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  max-width: 480px;
  width: 100%;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
}

.logo h1 {
  font-size: 24px;
  font-weight: 600;
  color: #e6edf3;
}

.subtitle {
  color: #8b949e;
  font-size: 16px;
  margin-bottom: 8px;
}

.specs {
  color: #58a6ff;
  font-size: 14px;
  margin-bottom: 32px;
  font-weight: 500;
}

/* Session duration hint */
.session-duration {
  color: #8b949e;
  font-size: 14px;
  margin-bottom: 20px;
}

.session-duration strong {
  color: #e6edf3;
}

/* Google Auth */
.google-auth-section {
  text-align: center;
}

.google-signin-btn {
  justify-content: center;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #21262d;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 10px 20px;
  color: #e6edf3;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  max-width: 100%;
}

.google-signin-btn:hover {
  background: #30363d;
  border-color: #484f58;
}

.google-signin-btn strong {
  color: #58a6ff;
}

.google-user-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #e6edf3;
}

.google-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

/* Auth buttons (below card) */
.auth-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  max-width: 480px;
  width: 100%;
}

.auth-group {
  text-align: center;
}


.claude-icon {
  flex-shrink: 0;
}

.auth-hint {
  color: #8b949e;
  font-size: 13px;
  margin-bottom: 10px;
  text-align: left;
}

.auth-code-wrapper {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.auth-code-input {
  flex: 1;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 10px 12px;
  color: #e6edf3;
  font-size: 14px;
  font-family: monospace;
  outline: none;
}

.auth-code-input:focus {
  border-color: #58a6ff;
}

.btn-confirm {
  background: #238636;
  white-space: nowrap;
}

.auth-cancel {
  background: none;
  border: none;
  color: #8b949e;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
}

.auth-cancel:hover {
  color: #e6edf3;
}

.signed-in-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #3fb950;
}

.check-icon {
  font-weight: 700;
}

.auth-signout {
  background: none;
  border: none;
  color: #8b949e;
  font-size: 12px;
  cursor: pointer;
  margin-left: 8px;
}

.auth-signout:hover {
  color: #e6edf3;
}

/* Admin badge (landing page) */
.admin-badge-landing {
  position: fixed;
  top: 16px;
  right: 60px;
  background: #d29922;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 10;
  transition: background 0.15s;
  display: flex;
  align-items: center;
}

.admin-badge-landing:hover {
  background: #b8860b;
}

/* Settings gear */
.settings-gear {
  position: fixed;
  top: 16px;
  right: 16px;
  background: transparent;
  border: 1px solid transparent;
  color: #8b949e;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  -webkit-appearance: none;
  appearance: none;
}

.settings-gear:hover {
  color: #e6edf3;
  background: #21262d;
  border-color: #30363d;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 12px;
  width: 90%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: #8b949e;
  font-size: 24px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.modal-close:hover {
  color: #e6edf3;
}

.modal-body {
  padding: 20px 24px 24px;
}

.settings-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #21262d;
}

.settings-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.settings-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #e6edf3;
}

.settings-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: #e6edf3;
}

.settings-hint {
  color: #8b949e;
  font-size: 12px;
  margin-bottom: 8px;
}

.settings-hint code {
  background: #21262d;
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 11px;
}

.settings-disconnect {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #3fb950;
}

.settings-disconnect .auth-signout {
  color: #f85149;
  font-size: 13px;
}

.ssh-key-input {
  width: 100%;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 10px 12px;
  color: #e6edf3;
  font-size: 12px;
  font-family: monospace;
  outline: none;
  resize: vertical;
}

.ssh-key-input:focus {
  border-color: #58a6ff;
}

.ssh-key-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.btn-save {
  background: #238636;
}

.btn-save:hover {
  background: #2ea043;
}

.btn-remove {
  background: transparent;
  border: 1px solid #da3633;
  color: #f85149;
  font-weight: 500;
}

.btn-remove:hover {
  background: #da3633;
  color: #fff;
}

.ssh-key-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 10px 12px;
}

.ssh-key-masked {
  color: #8b949e;
  font-size: 13px;
  font-family: monospace;
  letter-spacing: 0.5px;
}

/* Button */
.git-url-wrapper {
  width: 100%;
  margin-bottom: 20px;
}

.git-url-input {
  width: 100%;
  padding: 10px 12px;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  color: #e6edf3;
  font-size: 14px;
  font-family: monospace;
  outline: none;
}

.git-url-input:focus {
  border-color: #58a6ff;
}

.git-url-input::placeholder {
  color: #484f58;
}

.btn {
  background: #238636;
  color: #fff;
  border: 1px solid rgba(240, 246, 252, 0.1);
  border-radius: 6px;
  padding: 12px 32px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  width: 100%;
}

.btn:hover {
  background: #2ea043;
}

.btn:active {
  background: #238636;
}

.btn-small {
  width: auto;
  padding: 6px 16px;
  font-size: 13px;
}

.btn-danger {
  background: #da3633;
}

.btn-danger:hover {
  background: #f85149;
}

/* Spinner */
.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid #30363d;
  border-top-color: #58a6ff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 24px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.status-text {
  color: #8b949e;
  font-size: 16px;
  margin-bottom: 24px;
}

/* Progress bar */
.progress-bar {
  background: #21262d;
  border-radius: 4px;
  height: 4px;
  overflow: hidden;
}

.progress-fill {
  background: #58a6ff;
  height: 100%;
  width: 0%;
  transition: width 0.5s ease;
}

/* Ready / iframe */
#ready {
  flex-direction: column;
  padding: 0;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: #161b22;
  border-bottom: 1px solid #30363d;
  width: 100%;
  flex-shrink: 0;
}

.instance-url {
  color: #58a6ff;
  font-size: 13px;
  font-family: monospace;
}

#vscodeFrame {
  width: 100%;
  flex: 1;
  border: none;
  background: #1e1e1e;
}

/* Error */
.error-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #da3633;
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}
