.psg-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

.psg-panel {
  border: 1px solid var(--border, #d0d7de);
  border-radius: 16px;
  padding: 16px;
  background: linear-gradient(150deg, #f7fbff, #eef4ff);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
  min-width: 0;
}

.psg-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}

@media (max-width: 720px) {
  .psg-grid-2 {
    grid-template-columns: 1fr;
  }
}

.psg-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  font-weight: 600;
}

.psg-field input,
.psg-field select,
.psg-field textarea {
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border, #d0d7de);
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 10px 24px rgba(15, 23, 42, 0.06);
  font-size: 15px;
  line-height: 1.5;
}

.psg-field textarea {
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
}

.psg-inline-error:empty {
  display: none;
}

.psg-inline-error {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(220, 38, 38, 0.35);
  background: rgba(254, 226, 226, 0.6);
  color: #7f1d1d;
  font-size: 13px;
  line-height: 1.4;
}

.psg-field input:focus-visible,
.psg-field select:focus-visible,
.psg-field textarea:focus-visible {
  outline: 2px solid #0ea5e9;
  outline-offset: 2px;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.18);
}

.psg-checkline {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 600;
  margin: 6px 0 12px;
}

.psg-checkline input[type='checkbox'] {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.psg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 12px 0 0;
}

.psg-actions .button {
  flex: 1 1 180px;
}

.psg-actions .button.psg-copied {
  border-color: #34d399;
  background: #d1fae5;
  color: #065f46;
}

@media (max-width: 520px) {
  .psg-actions .button {
    flex: 1 1 100%;
  }
}

.psg-preview {
  margin: 10px 0 0;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: rgba(226, 232, 240, 0.55);
  max-height: 300px;
  overflow: auto;
  white-space: pre;
  max-width: 100%;
  min-width: 0;
}

.psg-preview.psg-preview-wrap {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.psg-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.psg-pill {
  border: 1px solid rgba(148, 163, 184, 0.55);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

.psg-token-table {
  width: 100%;
  border-collapse: collapse;
}

.psg-token-table th,
.psg-token-table td {
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
  padding: 10px;
  vertical-align: top;
}

.psg-token-table th {
  text-align: left;
  font-weight: 700;
  font-size: 14px;
  background: rgba(248, 251, 255, 0.95);
}

.psg-token-table code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

.psg-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.psg-presets .button {
  flex: 0 1 auto;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}
