.puter-stats-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid rgba(124, 92, 255, 0.25);
  background: rgba(124, 92, 255, 0.08);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin: 8px 0;
  letter-spacing: 0.02em;
}

.puter-stats-btn:hover {
  border-color: rgba(124, 92, 255, 0.5);
  color: #ffffff;
  background: rgba(124, 92, 255, 0.15);
  box-shadow: 0 0 14px rgba(124, 92, 255, 0.15);
}

.puter-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 4px;
}

.puter-actions .puter-stats-btn {
  justify-content: center;
  margin: 0;
  width: 100%;
  white-space: nowrap;
}

.puter-actions .puter-actions-wide {
  grid-column: 1 / -1;
}

.pstats-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: pstats-fade-in 0.2s ease;
}

@keyframes pstats-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.pstats-modal {
  width: 100%;
  max-width: 540px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid rgba(124, 92, 255, 0.2);
  background: linear-gradient(180deg, rgba(20, 28, 45, 0.99), rgba(10, 16, 28, 0.99));
  box-shadow:
    0 0 60px rgba(124, 92, 255, 0.15),
    0 0 120px rgba(0, 229, 255, 0.06);
  animation: pstats-slide-up 0.25s ease;
  overflow: hidden;
}

.pstats-modal-sm {
  max-width: 420px;
}

.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.confirm-modal-message {
  white-space: pre-line;
}

.pstats-modal-lg {
  height: 90vh;
  max-height: 90vh;
}

@keyframes pstats-slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.pstats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(124, 92, 255, 0.12);
  flex-shrink: 0;
}

.pstats-title {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.01em;
}

.pstats-subtitle {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pstats-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(124, 92, 255, 0.15);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.pstats-close:hover {
  background: rgba(255, 92, 122, 0.1);
  border-color: rgba(255, 92, 122, 0.3);
  color: #ff5c7a;
}

.pstats-body {
  overflow-y: auto;
  flex: 1;
  min-height: 0; 
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.pstats-loading {
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
  padding: 20px 0;
}

.about-tool-intro {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
  text-align: left;
}

.about-tool-card {
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 14px 16px;
}

.about-tool-card-heading {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
}

.about-tool-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  text-align: left;
}

.about-tool-notes {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  text-align: left;
}

.about-tool-card--cyan {
  border-color: rgba(0, 229, 255, 0.25);
  background: rgba(0, 229, 255, 0.05);
}
.about-tool-card--cyan .about-tool-card-heading { color: var(--cyan); }

.about-tool-card--purple {
  border-color: rgba(124, 92, 255, 0.25);
  background: rgba(124, 92, 255, 0.05);
}
.about-tool-card--purple .about-tool-card-heading { color: #a090ff; }

.about-tool-card--success {
  border-color: rgba(0, 229, 160, 0.25);
  background: rgba(0, 229, 160, 0.05);
}
.about-tool-card--success .about-tool-card-heading { color: var(--success); }

.about-tool-card--amber {
  border-color: rgba(255, 176, 32, 0.3);
  background: rgba(255, 176, 32, 0.06);
}
.about-tool-card--amber .about-tool-card-heading { color: #ffb020; }

.pstats-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pstats-section-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.pstats-overview {
  display: flex;
  align-items: center;
  gap: 24px;
}

.pstats-big-num {
  font-size: 42px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  min-width: 90px;
}

.pstats-big-label {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 4px;
}

.pstats-overview-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pstats-overview-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
}

.pstats-overview-row span:last-child {
  font-weight: 500;
  color: #ffffff;
}

.pstats-main-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

.pstats-main-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
  box-shadow: 0 0 10px currentColor;
}

.pstats-models {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pstats-model-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pstats-model-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pstats-model-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #e0e6f0;
  font-family: monospace;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pstats-provider-icon {
  color: var(--purple);
  font-size: 14px;
  flex-shrink: 0;
}

.pstats-model-meta {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.pstats-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(124, 92, 255, 0.15);
  color: #a090ff;
  border: 1px solid rgba(124, 92, 255, 0.2);
  white-space: nowrap;
}

.pstats-model-stats {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  padding: 0 2px;
}

.pstats-model-stats span:last-child {
  color: #00e5a0;
  font-weight: 500;
}

.pstats-footer{font-size: 12px;}


#backToTopBtn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(0, 229, 160, 0.35);
  background: rgba(20, 20, 24, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #00e5a0;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  z-index: 999;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease, border-color 0.2s ease;
}

#backToTopBtn.visible {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

#backToTopBtn:hover {
  background: rgba(0, 229, 160, 0.12);
  border-color: #00e5a0;
}

#backToTopBtn svg {
  width: 20px;
  height: 20px;
  display: block;
}

.media-info-search { padding: 12px 24px 0; flex-shrink: 0; width: 100%; min-width: 0; } 
.media-info-body { gap: 12px; }
#mediaInfoModal .pstats-header-left { flex: 1; min-width: 0; }
#mediaInfoModal .pstats-close { flex-shrink: 0; }
.media-info-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-info-card--plain {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
}
.media-info-card--plain .about-tool-card-heading { color: #ffffff; }
.media-info-row {
  display: grid;
  grid-template-columns: minmax(120px, 38%) 1fr;
  gap: 12px;
  padding: 3px 0;
  font-size: 13px;
  line-height: 1.45;
}
.media-info-row + .media-info-row { border-top: 1px solid rgba(255, 255, 255, 0.04); }
.media-info-row span:first-child { color: var(--text-muted); overflow-wrap: anywhere; } 
.media-info-row span:last-child { color: #ffffff; overflow-wrap: anywhere; }
.media-info-footer {
  padding: 12px 24px 16px;
  border-top: 1px solid rgba(124, 92, 255, 0.12);
  flex-shrink: 0;
}

.export-set-field {
  margin-top: 12px;
}
.about-tool-card-heading + .export-set-field {
  margin-top: 0;
}
.export-set-label {
  font-size: 12px;
  font-weight: 600;
  color: #e6e6e6;
  margin-bottom: 4px;
}
.export-set-radios {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--text-muted);
}
.export-set-radios label {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.export-set-radios input[type="radio"] {
  accent-color: #7c5cff;
  margin: 0;
}
.export-set-warn {
  font-size: 12px;
  color: #ffaa44;
  margin: 4px 0;
}
#exportSettingsModal [hidden] {
  display: none;
}

.import-set-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kr-card {
  margin-bottom: 12px;
}
.kr-card .cp-profile-card-head {
  margin-bottom: 6px;
}
.kr-card .cp-profile-card-head .about-tool-card-heading {
  margin-bottom: 0;
}
.kr-count {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
}
.kr-auto-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kr-list-tools {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 8px;
}
.kr-list-tools .kr-add-defaults {
  margin: 0;
  white-space: nowrap;
}
.kr-list-tools .kr-field {
  flex: 1;
}
.kr-card .kw-chips {
  max-height: 220px;
  overflow-y: auto;
}
.kr-card .kw-chip-input {
  flex: 1 1 100%;
}
.kr-defaults {
  margin: 8px 0 0;
}
