.gc-server-card {
  background: linear-gradient(155deg, var(--bg-card) 0%, var(--bg-card-soft) 100%);
  width: 100%;
  border-radius: 18px;
  box-shadow: 0 18px 42px rgba(3, 7, 18, 0.3);
  color: var(--text-main);
  border-left: 3px solid var(--accent-primary);
  border-top: 1px solid var(--card-border);
  border-right: 1px solid var(--card-border);
  border-bottom: 1px solid var(--card-border);
  position: relative;
  overflow: hidden;
  transition: transform 160ms ease, border-color 160ms ease;
}

.gc-server-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 8%;
  right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.4), transparent);
  pointer-events: none;
}

.gc-server-card:hover {
  transform: translateY(-1px);
}

.gc-card-header {
  padding: 1rem 1.1rem;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--gc-border-dark);
  gap: 16px;
}

.gc-server-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: var(--gc-icon-bg);
  border: 1px solid var(--gc-input-border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  text-transform: uppercase;
}

.gc-server-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gc-server-details {
  flex: 1;
}

.gc-server-name {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.gc-card-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  padding: 1rem 1.1rem 1.1rem;
}

.gc-col {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: rgba(12, 16, 22, 0.48);
  padding: 1.1rem;
  border-radius: 14px;
  border: 1px solid var(--card-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.gc-meter-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-weight: 600;
}

.gc-progress-track {
  width: 100%;
  height: 8px;
  background-color: rgba(17, 21, 27, 0.72);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 15px;
}

.gc-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #b45309 0%, var(--accent-primary) 55%, #f59e0b 100%);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.4);
  transition: width 0.3s ease;
  width: 0;
}

.gc-progress-fill.progress-0 {
  width: 0;
}

.gc-progress-fill.progress-5 {
  width: 5%;
}

.gc-progress-fill.progress-10 {
  width: 10%;
}

.gc-progress-fill.progress-15 {
  width: 15%;
}

.gc-progress-fill.progress-20 {
  width: 20%;
}

.gc-progress-fill.progress-25 {
  width: 25%;
}

.gc-progress-fill.progress-30 {
  width: 30%;
}

.gc-progress-fill.progress-35 {
  width: 35%;
}

.gc-progress-fill.progress-40 {
  width: 40%;
}

.gc-progress-fill.progress-45 {
  width: 45%;
}

.gc-progress-fill.progress-50 {
  width: 50%;
}

.gc-progress-fill.progress-55 {
  width: 55%;
}

.gc-progress-fill.progress-60 {
  width: 60%;
}

.gc-progress-fill.progress-65 {
  width: 65%;
}

.gc-progress-fill.progress-70 {
  width: 70%;
}

.gc-progress-fill.progress-75 {
  width: 75%;
}

.gc-progress-fill.progress-80 {
  width: 80%;
}

.gc-progress-fill.progress-85 {
  width: 85%;
}

.gc-progress-fill.progress-90 {
  width: 90%;
}

.gc-progress-fill.progress-95 {
  width: 95%;
}

.gc-progress-fill.progress-100 {
  width: 100%;
}

.gc-col .actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gc-funding-meta {
  margin-top: 15px;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gc-credits-display {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-weight: 600;
}

.gc-rules-form {
  margin-top: 12px;
}

.gc-rule-section {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--card-border);
}

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

.gc-rule-row {
  margin-bottom: 12px;
}

.gc-rule-row:last-child {
  margin-bottom: 0;
}

.gc-rule-label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-main);
  margin-bottom: 8px;
  font-weight: 600;
}

.gc-label-small {
  font-size: 0.85rem;
  font-weight: normal;
  margin-top: 12px;
}

.gc-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-main);
}

.gc-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.gc-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  padding: 6px 12px;
  background: rgba(138, 154, 177, 0.08);
  border-radius: 999px;
  border: 1px solid var(--gc-input-border);
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.gc-radio-label:has(.gc-radio:checked) {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.14);
  color: var(--color-amber);
}

.gc-radio {
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.gc-personality-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.gc-rule-textarea {
  resize: vertical;
  min-height: 70px;
}

.gc-limit-input-row {
  margin-left: 28px;
}

.gc-hidden {
  display: none !important;
}

.gc-rule-input-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gc-rule-input {
  width: 100px;
  font-family: var(--font-mono);
}

.gc-rule-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Bot name input with [Sonance] suffix indicator */
.gc-name-group {
  flex-wrap: nowrap;
}

.gc-name-input {
  width: 180px;
  font-family: var(--font-mono);
}

.gc-name-suffix {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Icon upload area */
.gc-icon-upload {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.gc-icon-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(138, 154, 177, 0.14);
  border: 2px dashed var(--gc-input-border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.gc-icon-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.gc-icon-placeholder {
  font-size: 1.5rem;
  color: var(--text-muted);
}

.gc-icon-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gc-upload-btn {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.gc-file-input {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  opacity: 0;
  cursor: pointer;
}

.btn-text {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0;
  text-align: left;
}
.btn-text:hover {
  color: var(--accent-primary);
}

.gc-full-width {
  width: 100%;
}

/* ---------------------------------------------------------------
   Minute-credit slider & breakdown (Add Minutes dialog)
   --------------------------------------------------------------- */
.credits-slider-wrap {
  display: grid;
  grid-template-rows: auto auto;
  position: relative;         /* anchor for label positioning */
  padding-bottom: 1rem;
}

/* Stack the range input and coloured track in the same grid cell */
.credits-slider,
.credits-hotzone-track {
  grid-row: 1;
  grid-column: 1;
  align-self: center;
}

.credits-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: transparent;
  outline: none;
  z-index: 2;
  cursor: pointer;
  margin: 0;
  padding: 0;
}

.credits-slider::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: transparent;
}

.credits-slider::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: transparent;
  border: none;
}

.credits-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--slider-thumb-color, #64748b);
  border: 2.5px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  cursor: grab;
  margin-top: -7px; /* centres 22px thumb on 8px track (webkit-specific) */
  transition: background 0.2s ease;
}

.credits-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--slider-thumb-color, #64748b);
  border: 2.5px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  cursor: grab;
  transition: background 0.2s ease;
}

.credits-hotzone-track {
  position: relative;         /* anchor for absolutely-positioned zone spans */
  width: 100%;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
}

.credits-hotzone {
  position: absolute;
  top: 0;
  height: 100%;
  transition: opacity 0.15s ease;
  opacity: 0.45;
}

.credits-hotzone.active {
  opacity: 1;
}

.credits-hotzone[data-zone="standard"] { background: #64748b; }
.credits-hotzone[data-zone="bronze"]   { background: #cd7f32; }
.credits-hotzone[data-zone="silver"]   { background: #94a3b8; }
.credits-hotzone[data-zone="gold"]     { background: #eab308; }
.credits-hotzone[data-zone="diamond"]  { background: linear-gradient(90deg, #38bdf8, #a78bfa); }

.credits-hotzone-labels {
  grid-row: 2;
  grid-column: 1;
  position: relative;
  height: 1.2rem;
  pointer-events: none;
}

.credits-hotzone-labels span {
  position: absolute;
  transform: translateX(-50%);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #94a3b8);
  white-space: nowrap;
}

.credits-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.8rem 0 1rem;
  font-size: 0.88rem;
}

.credits-breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.22rem 0;
}

.credits-breakdown-row.bonus {
  color: var(--accent-primary, #f59e0b);
}

.credits-breakdown-row.total {
  font-weight: 700;
  font-size: 0.95rem;
  border-top: 1px solid var(--card-border, rgba(148, 163, 184, 0.18));
  padding-top: 0.4rem;
  margin-top: 0.15rem;
}

.credits-breakdown-row.rate {
  font-size: 0.82rem;
  color: var(--text-muted, #94a3b8);
}

.credits-breakdown-value {
  font-family: var(--font-mono);
  font-weight: 600;
}

.gc-subscription-date {
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.mini-avatar.gc-avatar-self {
  background: var(--accent-primary);
}

.mini-avatar.gc-avatar-red {
  background: var(--color-red);
}

.mini-avatar.gc-avatar-green {
  background: var(--color-green);
}

.mini-avatar.gc-avatar-blue {
  background: var(--color-blue);
}

.mini-avatar.gc-avatar-amber {
  background: var(--color-amber);
}

.mini-avatar.gc-avatar-indigo {
  background: var(--color-indigo);
}

.gc-permission-warning {
  margin: 0;
  color: var(--danger);
  font-weight: 600;
}

/* ---------------------------------------------------------------
   Stripe Payment Element & manage subscription dialogs
   --------------------------------------------------------------- */
.pay-element-wrap {
  min-height: 120px;
  margin: 1rem 0;
  display: grid;
  gap: 14px;
}

.pay-loading {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 0;
  font-size: 0.9rem;
}

.pay-message {
  color: var(--danger, #ef4444);
  font-size: 0.88rem;
  margin: 0.5rem 0;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.08);
}

/* ── Payment Element loading spinner ────────────────────────── */
.pe-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 32px 0;
}
.pe-spinner-ring {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(148, 163, 184, 0.18);
  border-top-color: var(--accent, #6366f1);
  border-radius: 50%;
  animation: pe-spin 0.7s linear infinite;
}
@keyframes pe-spin {
  to { transform: rotate(360deg); }
}

/* ── Subscribe multi-step dialog ─────────────────────────── */
.subscribe-step { min-width: 0; }
.dialog-hint {
  font-size: 0.82rem;
  color: rgba(148, 163, 184, 0.75);
  margin-top: 0.25rem;
}

.gc-billing-address {
  margin: 0 0 16px;
}
.gc-payment-form-grid {
  display: grid;
  gap: 12px;
}
.gc-billing-location-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.gc-billing-field {
  display: grid;
  gap: 6px;
}
.gc-billing-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(226, 232, 240, 0.84);
}
.gc-billing-input {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--gc-input-border, rgba(148, 163, 184, 0.22));
  background: rgba(15, 23, 42, 0.6);
  color: var(--text-main, #f8fafc);
  font: inherit;
}
.gc-billing-input::placeholder {
  color: rgba(148, 163, 184, 0.7);
}
.gc-billing-input:focus {
  outline: none;
  border-color: var(--accent-primary, #6366f1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}
.gc-billing-country {
  text-transform: uppercase;
}
.gc-billing-select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(226, 232, 240, 0.82) 50%),
    linear-gradient(135deg, rgba(226, 232, 240, 0.82) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 34px;
}
.gc-billing-select option {
  color: #0f172a;
}
.gc-billing-hint {
  margin-bottom: 0;
}

@media (max-width: 640px) {
  .gc-billing-location-grid {
    grid-template-columns: 1fr;
  }
}

.gc-payment-panel {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  background:
    linear-gradient(155deg, rgba(15, 23, 42, 0.86), rgba(15, 23, 42, 0.72)),
    linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(168, 85, 247, 0.06));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.gc-payment-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.gc-payment-panel-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f8fafc;
}
.gc-payment-panel-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(245, 158, 11, 0.36);
  background: rgba(245, 158, 11, 0.12);
  color: var(--color-amber);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.gc-payment-panel-copy {
  color: rgba(226, 232, 240, 0.84);
  font-size: 0.9rem;
  line-height: 1.5;
}
.gc-payment-card-element {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.gc-saved-card-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 12px 0 10px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.5);
}
.gc-saved-card-brand {
  min-width: 68px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.98), rgba(49, 46, 129, 0.98));
  color: #f8fafc;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.28);
}
.gc-saved-card-details {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.gc-saved-card-primary {
  color: #f8fafc;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.gc-saved-card-secondary {
  color: rgba(203, 213, 225, 0.82);
  font-size: 0.88rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.manage-sub-status {
  margin: 0;
  line-height: 1.7;
}

.manage-sub-details {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}
.manage-sub-details td {
  padding: 6px 0;
}
.manage-sub-details td:first-child {
  color: var(--text-secondary, #94a3b8);
  padding-right: 16px;
  white-space: nowrap;
}
.manage-sub-details td:last-child {
  text-align: right;
}

.manage-confirm-prompt {
  background: rgba(239, 68, 68, 0.08);
  border-radius: 8px;
  padding: 12px;
  margin-top: 8px;
  text-align: center;
  line-height: 1.8;
}

.btn-danger {
  background: var(--danger-strong, #b91c1c);
  color: #f8fafc;
  border: none;
}
.btn-danger:hover {
  opacity: 0.9;
}

@media (max-width: 640px) {
  .gc-card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .gc-card-body {
    grid-template-columns: 1fr;
  }
}
