.qbc-gi-modal {
  position: fixed;
  inset: 0;
  z-index: 88;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
}

.qbc-gi-panel {
  width: min(1180px, 100%);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 18px;
  background: #f8fafc;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.3);
  color: #0f172a;
}

.qbc-gi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  color: #fff;
  background: linear-gradient(120deg, #0f172a 0%, #1e3a8a 55%, #0e7490 100%);
}

.qbc-gi-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.qbc-gi-title h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.qbc-gi-title p {
  margin: 2px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
}

.qbc-gi-logo {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 20px;
}

.qbc-gi-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qbc-gi-bot {
  min-width: 190px;
  max-width: 260px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 13px;
}

.qbc-gi-bot option {
  color: #0f172a;
}

.qbc-gi-close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
}

.qbc-gi-close:hover {
  background: rgba(255, 255, 255, 0.22);
}

.qbc-gi-zonebar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 22px;
  background: #fff;
  border-bottom: 1px solid rgba(148, 163, 184, 0.24);
  font-size: 13px;
}

.qbc-gi-zonebar label {
  font-weight: 600;
  color: #475569;
}

.qbc-gi-zonebar select {
  min-width: 170px;
  padding: 7px 10px;
  border-radius: 9px;
  border: 1px solid #cbd5f5;
  background: #f8fafc;
  font-size: 13px;
}

.qbc-gi-zone-hint {
  margin-left: auto;
  color: #64748b;
  font-size: 12px;
}

.qbc-gi-tabs {
  display: flex;
  gap: 4px;
  padding: 0 18px;
  background: #fff;
  border-bottom: 1px solid rgba(148, 163, 184, 0.24);
}

.qbc-gi-tabs button {
  padding: 12px 16px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.qbc-gi-tabs button.is-active {
  color: #1d4ed8;
  border-bottom-color: #1d4ed8;
}

.qbc-gi-body {
  flex: 1;
  overflow: auto;
  padding: 18px 22px 26px;
}

.qbc-gi-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.qbc-gi-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.24);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.qbc-gi-stat span {
  font-size: 12px;
  color: #64748b;
}

.qbc-gi-stat strong {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
}

.qbc-gi-stat em {
  font-style: normal;
  font-size: 11px;
  color: #94a3b8;
}

.qbc-gi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.qbc-gi-card {
  padding: 14px 16px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.24);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.qbc-gi-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.qbc-gi-card h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
}

.qbc-gi-range {
  display: flex;
  gap: 4px;
}

.qbc-gi-range button {
  padding: 4px 9px;
  border-radius: 8px;
  border: 1px solid #dbeafe;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
  cursor: pointer;
}

.qbc-gi-range button.is-active {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

.qbc-gi-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 140px;
  padding-top: 8px;
}

.qbc-gi-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 4px;
}

.qbc-gi-bar i {
  display: block;
  width: 100%;
  max-width: 26px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #38bdf8, #1d4ed8);
  min-height: 3px;
}

.qbc-gi-bar span {
  font-size: 9px;
  color: #94a3b8;
  white-space: nowrap;
}

.qbc-gi-hours {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 110px;
}

.qbc-gi-hours div {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 3px;
}

.qbc-gi-hours i {
  display: block;
  width: 100%;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, #a78bfa, #6d28d9);
  min-height: 2px;
}

.qbc-gi-hours span {
  font-size: 8px;
  color: #94a3b8;
}

.qbc-gi-list,
.qbc-gi-events {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.qbc-gi-list li,
.qbc-gi-events li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 9px;
  background: #f8fafc;
  font-size: 12px;
}

.qbc-gi-list b {
  color: #1d4ed8;
}

.qbc-gi-events em {
  font-style: normal;
  color: #94a3b8;
  font-size: 11px;
}

.qbc-gi-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.qbc-gi-tags span {
  padding: 5px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
}

.qbc-gi-tags b {
  color: #1e40af;
}

.qbc-gi-empty {
  color: #94a3b8;
  font-size: 12px;
  text-align: center;
  padding: 12px 0;
}

.qbc-gi-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.qbc-gi-test-group {
  min-width: 200px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid #cbd5f5;
  background: #fff;
  font-size: 13px;
}

.qbc-gi-btn {
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid #cbd5f5;
  background: #fff;
  color: #1e293b;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.qbc-gi-btn:hover {
  border-color: #93c5fd;
  background: #f0f7ff;
}

.qbc-gi-btn.is-primary {
  border-color: #1d4ed8;
  background: #1d4ed8;
  color: #fff;
}

.qbc-gi-btn.is-primary:hover {
  background: #1e40af;
}

.qbc-gi-btn.is-danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.qbc-gi-preview {
  margin-top: 14px;
  padding: 14px;
  border-radius: 12px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 40px;
}

.qbc-gi-config {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.qbc-gi-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.qbc-gi-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: #475569;
  min-width: 160px;
}

.qbc-gi-form input[type="text"],
.qbc-gi-form input:not([type]),
.qbc-gi-form input[type="time"],
.qbc-gi-form input[type="number"],
.qbc-gi-form select,
.qbc-gi-block select,
.qbc-gi-block textarea {
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid #cbd5f5;
  background: #fff;
  font-size: 13px;
  color: #0f172a;
}

.qbc-gi-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: #64748b;
}

.qbc-gi-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  font-size: 12px;
  color: #475569;
}

.qbc-gi-block select,
.qbc-gi-block textarea {
  width: 100%;
}

.qbc-gi-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.qbc-gi-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #334155;
  cursor: pointer;
}

.qbc-gi-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.qbc-gi-table th,
.qbc-gi-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.qbc-gi-table th {
  color: #64748b;
  font-weight: 600;
}

.qbc-gi-toast {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translate(-50%, 20px);
  padding: 10px 18px;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s ease;
}

.qbc-gi-panel {
  position: relative;
}

.qbc-gi-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.qbc-gi-toast[data-tone="success"] {
  background: #15803d;
}

.qbc-gi-toast[data-tone="warn"] {
  background: #b45309;
}

.qbc-gi-toast[data-tone="error"] {
  background: #b91c1c;
}

@media (max-width: 860px) {
  .qbc-gi-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .qbc-gi-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .qbc-gi-zone-hint {
    width: 100%;
    margin-left: 0;
  }
}

html[data-theme="dark"] .qbc-gi-panel {
  background: #0f172a;
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.3);
}

html[data-theme="dark"] .qbc-gi-zonebar,
html[data-theme="dark"] .qbc-gi-tabs,
html[data-theme="dark"] .qbc-gi-stat,
html[data-theme="dark"] .qbc-gi-card,
html[data-theme="dark"] .qbc-gi-test-group,
html[data-theme="dark"] .qbc-gi-btn,
html[data-theme="dark"] .qbc-gi-form input,
html[data-theme="dark"] .qbc-gi-form select,
html[data-theme="dark"] .qbc-gi-block select,
html[data-theme="dark"] .qbc-gi-block textarea {
  background: #111c33;
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.3);
}

html[data-theme="dark"] .qbc-gi-stat strong,
html[data-theme="dark"] .qbc-gi-card h3 {
  color: #f1f5f9;
}

html[data-theme="dark"] .qbc-gi-list li,
html[data-theme="dark"] .qbc-gi-events li {
  background: #16233d;
}

html[data-theme="dark"] .qbc-gi-tags span {
  background: #1e3a8a;
  color: #dbeafe;
}

html[data-theme="dark"] .qbc-gi-table th,
html[data-theme="dark"] .qbc-gi-table td {
  border-bottom-color: rgba(148, 163, 184, 0.22);
}
