/* QYX Credit Guard v6 — dle Claude Design handoff */

.qyx-cg-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgb(24 24 27 / 45%);
  animation: qyx-cg-fade 150ms ease-out;
}

.qyx-cg-modal {
  width: 100%;
  max-width: 400px;
  max-height: calc(100dvh - 32px);
  overflow: hidden auto;
  box-sizing: border-box;
  padding: 20px;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  background: #fff;
  color: #18181b;
  font-family: ui-sans-serif, -apple-system, "Segoe UI", Helvetica, sans-serif;
  animation: qyx-cg-rise 200ms cubic-bezier(.2,.7,.3,1);
}

.qyx-cg-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.qyx-cg-status {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .01em;
  color: #71717a;
}

.qyx-cg-dot {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #71717a;
}
.qyx-cg-modal--warn .qyx-cg-dot { background: #f59e0b; }
.qyx-cg-modal--crit .qyx-cg-dot { background: #ef4444; }

.qyx-cg-close {
  flex: none;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #71717a;
  cursor: pointer;
}
.qyx-cg-close:hover { background: #f7f7f8; color: #18181b; }
.qyx-cg-close:focus-visible { outline: 2px solid #18181b; outline-offset: 2px; }

.qyx-cg-title {
  margin: 14px 0 0;
  font-size: 19px;
  line-height: 1.25;
  font-weight: 600;
  color: #18181b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qyx-cg-body {
  margin: 6px 0 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: #71717a;
  text-wrap: pretty;
}

.qyx-cg-meter { margin-top: 18px; }

.qyx-cg-meter__track {
  height: 6px;
  border: 1px solid #e4e4e7;
  border-radius: 999px;
  background: #f7f7f8;
  overflow: hidden;
}

.qyx-cg-meter__fill {
  width: 0;
  height: 100%;
  background: #71717a;
  transition: width 500ms cubic-bezier(.2,.7,.3,1);
}
.qyx-cg-modal--warn .qyx-cg-meter__fill { background: #f59e0b; }
.qyx-cg-modal--crit .qyx-cg-meter__fill { background: #ef4444; }

.qyx-cg-meter__label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 0;
  font-size: 12px;
  color: #71717a;
  font-variant-numeric: tabular-nums;
}

.qyx-cg-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 16px 0 0;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  background: #e4e4e7;
  overflow: hidden;
}

.qyx-cg-stat { padding: 12px 14px; background: #f7f7f8; }

.qyx-cg-stat dt {
  margin: 0;
  font-size: 11px;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: #71717a;
}

.qyx-cg-stat dd {
  margin: 3px 0 0;
  font-size: 16px;
  font-weight: 600;
  color: #18181b;
  font-variant-numeric: tabular-nums;
}

.qyx-cg-primary {
  display: block;
  width: 100%;
  height: 42px;
  margin-top: 16px;
  border: 0;
  border-radius: 8px;
  background: #16a34a;
  color: #fff;
  font: 600 14px/42px inherit;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
}
.qyx-cg-primary:hover { background: #15903f; color: #fff; }
.qyx-cg-primary:focus-visible { outline: 2px solid #18181b; outline-offset: 2px; }

.qyx-cg-later-row {
  display: flex;
  justify-content: center;
  margin: 10px 0 0;
}

.qyx-cg-later {
  padding: 2px 6px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #71717a;
  font: 400 13px/1.4 inherit;
  text-decoration: none;
  cursor: pointer;
}
.qyx-cg-later:hover { color: #18181b; }
.qyx-cg-later:focus-visible { outline: 2px solid #18181b; outline-offset: 2px; }

@keyframes qyx-cg-fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes qyx-cg-rise {
  from { opacity: 0; transform: translateY(10px) scale(.98) }
  to   { opacity: 1; transform: none }
}

@media (prefers-reduced-motion: reduce) {
  .qyx-cg-overlay, .qyx-cg-modal { animation: none; }
  .qyx-cg-meter__fill { transition: none; }
}

/* --- v6.1 fix: font shorthand + centrování + focus --- */
.qyx-cg-modal:focus { outline: none; }

.qyx-cg-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
}

.qyx-cg-later {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  line-height: 1;
}
