.dev-toggle-btn {
  position: fixed;
  top: 16px;
  z-index: 9998;
  padding: 8px 16px;
  color: #fff;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-family: Roboto, sans-serif;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.dev-toggle-btn.game {
  right: 16px;
  background: #1890ff;
}

.dev-toggle-btn.push {
  right: 176px;
  background: #fa8c16;
}

.dev-panel {
  display: none;
  position: fixed;
  bottom: 76px;
  z-index: 9999;
  background: #fff;
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.13);
  font-family: Roboto, sans-serif;
  font-size: 14px;
  max-height: calc(100vh - 120px);
  overflow: auto;
}

.dev-panel.game {
  right: 24px;
  min-width: 280px;
  max-width: 420px;
  border: 1.5px solid #1890ff;
}

.dev-panel.push {
  left: 24px;
  min-width: 320px;
  max-width: 360px;
  border: 1.5px solid #fa8c16;
}

.dev-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.dev-panel-title {
  font-weight: 700;
}

.dev-panel-title.game {
  color: #1890ff;
}

.dev-panel-title.push {
  color: #d46b08;
}

.dev-close-btn {
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.dev-close-btn.game {
  background: #f0f7ff;
  color: #1890ff;
  border: 1px solid #91caff;
}

.dev-close-btn.push {
  background: #fff7e6;
  color: #d46b08;
  border: 1px solid #ffd591;
}

.dev-note {
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 10px;
  font-size: 12px;
  line-height: 1.6;
}

.dev-note.game-primary {
  background: #f0f7ff;
  color: #555;
  line-height: 1.7;
}

.dev-note.game-warning {
  background: #fff7e6;
  border: 1px solid #ffe58f;
  color: #8c6d1f;
}

.dev-note.push-warning {
  background: #fff7e6;
  border: 1px solid #ffd591;
  color: #8c6d1f;
}

.dev-inline-code {
  background: #e6f4ff;
  padding: 1px 5px;
  border-radius: 4px;
  color: #1890ff;
}

.dev-field {
  margin-bottom: 8px;
}

.dev-field.wide {
  margin-bottom: 10px;
}

.dev-label {
  display: block;
  font-size: 12px;
  color: #888;
  margin-bottom: 3px;
}

.dev-input,
.dev-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 5px 8px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 13px;
}

.dev-input.readonly {
  background: #fafafa;
  color: #555;
}

.dev-textarea {
  resize: vertical;
}

.dev-status {
  font-size: 12px;
  background: #fafafa;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  padding: 7px 8px;
  color: #a8071a;
}

.dev-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.dev-row.wrap {
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.dev-btn {
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: #fff;
  font-weight: 600;
}

.dev-btn.small {
  padding: 7px 0;
  font-size: 12px;
  flex: 1;
}

.dev-btn.medium {
  padding: 6px 0;
  font-size: 13px;
  flex: 1;
}

.dev-btn.full {
  width: 100%;
  padding: 7px 0;
  font-size: 13px;
}

.dev-btn.primary {
  background: #1890ff;
}

.dev-btn.danger {
  background: #ff4d4f;
}

.dev-btn.success {
  background: #52c41a;
}

.dev-btn.purple {
  background: #722ed1;
}

.dev-btn.cyan {
  background: #13c2c2;
  margin-bottom: 8px;
}

.dev-btn.orange {
  background: #fa8c16;
}

.dev-btn.indigo {
  background: #2f54eb;
}

.dev-btn.helper {
  flex: 1 1 100%;
}

.dev-log {
  background: #f5f5f5;
  border-radius: 6px;
  padding: 8px;
  font-size: 12px;
  color: #333;
  white-space: pre-wrap;
  overflow-y: auto;
}

.dev-log.game {
  min-height: 40px;
  max-height: 120px;
}

.game-compact-panel {
  width: 340px;
  padding: 12px 14px;
}

.game-compact-header {
  margin-bottom: 6px;
}

.game-status-strip {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  margin-bottom: 8px;
  border: 1px solid #e6f4ff;
  border-radius: 8px;
  background: #f7fcff;
}

.game-status-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.game-status-label {
  font-size: 11px;
  color: #666;
}

.game-status-pill {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid #91caff;
  color: #0958d9;
  background: #e6f4ff;
}

.game-status-pill.success {
  border-color: #b7eb8f;
  color: #237804;
  background: #f6ffed;
}

.game-status-pill.error {
  border-color: #ffccc7;
  color: #a8071a;
  background: #fff2f0;
}

.game-status-pill.pending {
  border-color: #d9d9d9;
  color: #595959;
  background: #fafafa;
}

.game-status-value {
  font-size: 12px;
  font-weight: 700;
  color: #0050b3;
}

.game-primary-compact {
  margin-bottom: 8px;
  padding: 6px 8px;
  font-size: 11px;
  line-height: 1.5;
}

.game-note-collapsible {
  margin-bottom: 8px;
}

.game-note-collapsible > summary {
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  color: #666;
}

.game-warning-compact {
  margin-top: 6px;
  margin-bottom: 0;
  padding: 6px 8px;
  font-size: 11px;
}

.game-input-row {
  margin-bottom: 8px;
}

.game-input-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}

.game-action-row,
.game-log-tools-row {
  margin-bottom: 6px;
}

.game-action-row .dev-btn,
.game-log-tools-row .dev-btn {
  min-width: 0;
  padding-left: 6px;
  padding-right: 6px;
}

.dev-log.game {
  min-height: 36px;
  max-height: 86px;
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.4;
}

.dev-log.game.expanded {
  max-height: 180px;
}

.dev-log.push {
  margin-top: 10px;
  min-height: 100px;
  max-height: 260px;
}

/* ── Push Sender Modal ── */
.push-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.45);
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.push-modal-overlay.open {
  display: flex;
}

.push-modal-overlay.open .dev-panel.push.push-modal-dialog {
  display: block;
}

.dev-panel.push.push-modal-dialog {
  position: relative;
  bottom: auto;
  left: auto;
  width: 420px;
  max-width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  border: 1.5px solid #fa8c16;
}

/* Compact mode for WebPush Test Sender */
.push-compact-panel {
  width: 392px;
  max-height: 84vh;
  padding: 12px 14px;
}

.push-compact-panel .dev-panel-header {
  margin-bottom: 6px;
}

.push-compact-panel .push-section {
  margin-bottom: 10px;
  padding-bottom: 8px;
}

.push-compact-panel .push-section-header,
.push-compact-panel .push-section-header-btn {
  margin-bottom: 7px;
  gap: 6px;
  font-size: 12px;
}

.push-compact-panel .push-section-icon {
  font-size: 13px;
}

.push-compact-panel .push-section-title {
  font-size: 12px;
}

.push-compact-panel .dev-field {
  margin-bottom: 6px;
}

.push-compact-panel .dev-label {
  font-size: 12px;
  margin-bottom: 3px;
  line-height: 1.25;
}

.push-compact-panel .dev-input,
.push-compact-panel .dev-textarea,
.push-compact-panel .dev-status {
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.3;
}

.push-compact-panel .dev-textarea {
  min-height: 46px;
}

.push-compact-panel .dev-hint {
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.25;
  color: #a0a0a0;
}

.push-compact-panel .dev-error,
.push-compact-panel .char-count {
  margin-top: 1px;
  font-size: 10px;
  line-height: 1.2;
}

.push-compact-panel .dev-note {
  padding: 6px 8px;
  margin-bottom: 6px;
  font-size: 11px;
  line-height: 1.4;
}

.push-compact-panel .dev-row {
  gap: 6px;
  margin-bottom: 6px;
}

.push-compact-panel .dev-btn.small,
.push-compact-panel .dev-btn.medium,
.push-compact-panel .dev-btn.full {
  padding-top: 6px;
  padding-bottom: 6px;
  font-size: 12px;
}

.push-compact-panel .dev-log.push {
  margin-top: 6px;
  min-height: 66px;
  max-height: 160px;
  padding: 7px 8px;
  font-size: 10px;
  line-height: 1.35;
}

.push-compact-panel .logs-header {
  margin-bottom: 5px;
}

.push-compact-panel .push-logs-section {
  margin-top: 8px;
  padding-top: 8px;
}

.push-compact-panel .delivery-status-bar {
  gap: 8px;
  margin-top: 6px;
  padding: 6px 8px;
  font-size: 11px;
}

/* ── Toast ── */
.push-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-80px);
  z-index: 10001;
  padding: 12px 24px;
  border-radius: 8px;
  font-family: Roboto, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s ease, opacity 0.28s ease;
  white-space: nowrap;
}

.push-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.push-toast.toast-success {
  background: #52c41a;
}

.push-toast.toast-error {
  background: #ff4d4f;
}

/* ════════════════════════════════════════════════════════════ */
/* PHASE 1-4: NEW SECTIONS, RESPONSIVE, LOGGING & ADVANCED     */
/* ════════════════════════════════════════════════════════════ */

/* ── Push Section Container & Header ── */
.push-section {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f0f0f0;
}

.push-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.push-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-weight: 600;
  font-size: 13px;
  color: #d46b08;
}

.push-section-header-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: #d46b08;
  padding: 0;
  margin-bottom: 12px;
  width: 100%;
}

.push-section-header-btn:hover {
  color: #fa8c16;
}

.push-section-icon {
  font-size: 16px;
}

.push-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #d46b08;
}

.toggle-arrow {
  margin-left: auto;
  font-size: 12px;
  transition: transform 0.2s ease;
}

.push-section-header-btn[aria-expanded="true"] .toggle-arrow {
  transform: rotate(180deg);
}

.push-advanced-container {
  transition: max-height 0.3s ease, opacity 0.3s ease;
  overflow: hidden;
}

.push-advanced-container[style*="display: none"] {
  max-height: 0;
  opacity: 0;
}

/* ── Improved Dev Fields ── */
.dev-label {
  display: block;
  font-size: 13px;
  color: #666;
  margin-bottom: 6px;
  font-weight: 500;
}

.dev-input,
.dev-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1.5px solid #d9d9d9;
  border-radius: 6px;
  font-size: 13px;
  font-family: Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dev-input:focus,
.dev-textarea:focus {
  outline: none;
  border-color: #fa8c16;
  box-shadow: 0 0 0 3px rgba(250, 140, 22, 0.1);
}

.dev-input.readonly {
  background: #fafafa;
  color: #888;
  cursor: not-allowed;
}

.dev-textarea {
  resize: vertical;
  min-height: 60px;
}

.dev-input.error,
.dev-textarea.error {
  border-color: #ff4d4f;
  background: #fff2f0;
}

/* ── Hints & Errors ── */
.dev-hint {
  font-size: 11px;
  color: #999;
  margin-top: 4px;
  line-height: 1.4;
}

.dev-error {
  font-size: 12px;
  color: #cf1322;
  margin-top: 4px;
  font-weight: 500;
}

/* ── Character Count ── */
.char-count {
  font-size: 11px;
  color: #ccc;
  text-align: right;
  margin-top: 2px;
  font-weight: 500;
}

.char-count.warning {
  color: #faad14;
}

.char-count.error {
  color: #ff4d4f;
}

/* ── Required Mark ── */
.required-mark {
  color: #ff4d4f;
  font-weight: bold;
}

/* ── Button Improvements ── */
.dev-btn {
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.dev-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.dev-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dev-btn.small {
  padding: 7px 10px;
  font-size: 12px;
  flex: 1;
}

.dev-btn.medium {
  padding: 8px 12px;
  font-size: 13px;
  flex: 1;
}

.dev-btn.full {
  width: 100%;
  padding: 9px 12px;
  font-size: 13px;
  margin-bottom: 8px;
}

.dev-btn.orange {
  background: #fa8c16;
}

.dev-btn.orange:hover:not(:disabled) {
  background: #d48806;
}

.dev-btn.preview {
  background: #13c2c2;
  margin-bottom: 8px;
}

.dev-btn.preview:hover:not(:disabled) {
  background: #0a8080;
}

/* ── Dev Row ── */
.dev-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

/* ── Checkbox Label ── */
.push-label-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #333;
  cursor: pointer;
  user-select: none;
}

.push-label-checkbox input[type="checkbox"] {
  cursor: pointer;
  width: 16px;
  height: 16px;
}

/* ── Logs Section ── */
.push-logs-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 2px solid #fff7e6;
}

.logs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 12px;
  color: #666;
}

.logs-title {
  font-size: 13px;
  font-weight: 600;
  color: #d46b08;
}

.logs-count {
  font-size: 11px;
  color: #999;
}

.dev-log {
  background: #fafafa;
  border-radius: 6px;
  padding: 10px;
  font-size: 11px;
  color: #333;
  white-space: pre-wrap;
  overflow-y: auto;
  word-break: break-word;
  font-family: 'Courier New', monospace;
  line-height: 1.6;
  user-select: text;
  max-height: 260px;
  border: 1px solid #f0f0f0;
  min-height: 80px;
}

.dev-log::-webkit-scrollbar {
  width: 6px;
}

.dev-log::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 3px;
}

.dev-log::-webkit-scrollbar-thumb {
  background: #d9d9d9;
  border-radius: 3px;
}

.dev-log::-webkit-scrollbar-thumb:hover {
  background: #bfbfbf;
}

/* ── Color-Coded Log Levels ── */
.log-info {
  color: #666;
}

.log-success {
  color: #52c41a;
  font-weight: 500;
}

.log-error {
  color: #ff4d4f;
  font-weight: 500;
}

.log-warn {
  color: #faad14;
  font-weight: 500;
}

.log-loading {
  color: #1890ff;
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.6; }
}

/* ── Delivery Status Bar ── */
.delivery-status-bar {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  padding: 8px 10px;
  background: #f0f7ff;
  border-radius: 6px;
  border-left: 3px solid #1890ff;
  font-size: 12px;
  font-weight: 500;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #0050b3;
}

/* ── Message Preview Modal ── */
.push-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.push-preview-content {
  background: #fff;
  border-radius: 12px;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
  background: #fafafa;
}

.preview-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.preview-close {
  background: none;
  border: none;
  font-size: 18px;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-close:hover {
  color: #333;
}

.preview-desktop {
  padding: 24px 20px;
}

.notification-mock {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #f0f0f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 12px;
  font-family: Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
}

.mock-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}

.mock-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.mock-info {
  flex: 1;
  min-width: 0;
}

.mock-origin {
  font-size: 12px;
  font-weight: 600;
  color: #666;
}

.mock-time {
  font-size: 11px;
  color: #999;
  margin-top: 2px;
}

.mock-title {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
  line-height: 1.4;
}

.mock-body {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
  margin-bottom: 8px;
}

.mock-image {
  width: 100%;
  max-height: 200px;
  border-radius: 6px;
  object-fit: cover;
  margin-bottom: 8px;
}

.preview-footer {
  padding: 12px 20px;
  border-top: 1px solid #f0f0f0;
  background: #fafafa;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ── Responsive Design ── */
@media (max-width: 768px) {
  .dev-panel.push.push-modal-dialog {
    width: 100%;
    max-width: 100%;
  }

  .dev-field {
    margin-bottom: 10px;
  }

  .dev-row {
    flex-direction: column;
  }

  .dev-row .dev-btn {
    width: 100%;
  }

  .dev-btn.small,
  .dev-btn.medium {
    flex: none;
    width: 100%;
  }

  .push-logs-section {
    margin-top: 10px;
    padding-top: 10px;
  }

  .dev-log.push {
    max-height: 180px;
    min-height: 60px;
  }

  .push-preview-content {
    max-width: 90vw;
  }
}

@media (max-width: 480px) {
  .dev-panel.push.push-modal-dialog {
    width: 100%;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 12px 12px 0 0;
    max-height: 80vh;
  }

  .push-section {
    margin-bottom: 12px;
    padding-bottom: 10px;
  }

  .dev-label {
    font-size: 12px;
  }

  .dev-input,
  .dev-textarea {
    padding: 8px;
    font-size: 16px; /* Prevent zoom on iOS */
  }

  .char-count {
    font-size: 10px;
  }

  .delivery-status-bar {
    flex-direction: column;
    gap: 6px;
  }

  .status-item {
    font-size: 11px;
  }
}

/* ── Loading State ── */
.btn-loading {
  opacity: 0.6;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 6px;
}

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

/* ── Focus Management ── */
.push-modal-overlay:focus-within {
  outline: none;
}

.dev-panel.push.push-modal-dialog:focus-within {
  outline: 3px solid #fa8c16;
  outline-offset: 2px;
}

/* ── Status Indicators ── */
.dev-status {
  font-size: 12px;
  background: #fafafa;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  padding: 8px 10px;
  color: #a8071a;
  font-weight: 500;
}

.dev-status.success {
  color: #237804;
  background: #f6ffed;
  border-color: #b7eb8f;
}

.dev-status.error {
  color: #a8071a;
  background: #fff2f0;
  border-color: #ffccc7;
}

.dev-status.pending {
  color: #0050b3;
  background: #f0f7ff;
  border-color: #91caff;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ── Dev Note ── */
.dev-note {
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: 12px;
  line-height: 1.6;
  border-left: 3px solid #faad14;
}

.dev-note code {
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
}

.dev-note.push-warning {
  background: #fff7e6;
  border-color: #ffd591;
  color: #8c6d1f;
}
