/* Base (kept from your original) */
body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  margin: 0; padding: 0; background: #0b0f14; color: #e8ecf1;
}
.container {
  max-width: 1100px; margin: 40px auto; padding: 0 20px;
}
.page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.page-header h1 { margin: 0; }
h1 { font-size: 1.25rem; margin-bottom: 12px; }
.pr-status {
  font-size: 0.85rem;
  color: #aab7c4;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #2b3a49;
  background: #0f141a;
  font-weight: 500;
}
label { display: block; margin: 20px 0 8px; font-weight: 600; }
textarea {
  width: 100%; min-height: 140px; padding: 12px; border-radius: 8px;
  border: 1px solid #2b3a49; background: #0f141a; color: #e8ecf1; resize: vertical;
}
button {
  margin-top: 12px; padding: 10px 16px; border: 0; border-radius: 8px; cursor: pointer;
  background: #1e88e5; color: white; font-weight: 600;
}
button:disabled { opacity: 0.5; cursor: not-allowed; }
.status { margin-top: 12px; min-height: 20px; font-size: 0.95rem; color: #aab7c4; }
.response {
  background: #0f141a; border: 1px solid #2b3a49; border-radius: 8px; padding: 12px;
  min-height: 120px; white-space: pre-wrap;
}
.note { color: #aab7c4; font-size: 0.95rem; }

/* New: inputs, grid, badges */
input[type="number"], input[type="text"] {
  width: 100%; padding: 10px; border-radius: 8px; border: 1px solid #2b3a49;
  background: #0f141a; color: #e8ecf1;
}

.panel { margin: 16px 0 24px; padding: 12px; border: 1px solid #2b3a49; border-radius: 8px; background: #0f141a; }
.panel h2 { font-size: 1rem; margin: 6px 0 12px; color: #c9d6e2; }

.wallet-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin: 6px 0 12px;
}

.wallet-label {
  font-weight: 600;
  color: #cfe4ff;
}

.wallet-balance {
  font-family: ui-monospace, "SFMono-Regular", SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-variant-numeric: tabular-nums;
  background: #131d29;
  padding: 2px 6px;
  border-radius: 6px;
  color: #d6ecff;
}

.wallet-balance.muted {
  background: transparent;
  color: #7a8da3;
}

.wallet-address {
  font-family: ui-monospace, "SFMono-Regular", SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background: #101822;
  padding: 2px 6px;
  border-radius: 6px;
  color: #8ad4ff;
}

.wallet-address.muted {
  background: transparent;
  padding: 0;
  color: #7a8da3;
}

.wallet-status {
  font-size: 0.85rem;
  font-weight: 500;
}

.wallet-status.connected {
  color: #7dd87d;
}

.wallet-status.error {
  color: #ff9d9d;
}

.wallet-divider {
  width: 1px;
  align-self: stretch;
  background: #1f2b37;
  margin: 0 8px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.pricing-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
}

.pricing-row > div {
  flex: 1 1 240px;
}

.return-button {
  margin-top: 12px;
  width: 100%;
}

.feedback {
  margin-top: 8px;
  font-size: 0.85rem;
  color: #aab7c4;
}

.feedback.error {
  color: #ff9d9d;
}

.feedback.success {
  color: #8ad4ff;
}

.transfer-dialog {
  border: 1px solid #2b3a49;
  border-radius: 12px;
  padding: 20px;
  background: #0f141a;
  color: #e8ecf1;
  max-width: 360px;
}

.transfer-dialog::backdrop {
  background: rgba(8, 13, 19, 0.75);
}

.transfer-dialog__form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
}

.transfer-dialog__helper {
  margin: 0;
  color: #aab7c4;
  font-size: 0.9rem;
}

.transfer-dialog__label {
  margin: 0;
  font-weight: 600;
}

.transfer-dialog__label--secondary {
  font-weight: 500;
  color: #aab7c4;
}

.transfer-dialog__slider {
  width: 100%;
  accent-color: #1e88e5;
}

.transfer-dialog__input {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #2b3a49;
  background: #0f141a;
  color: #e8ecf1;
  font-size: 1rem;
}

.transfer-dialog__input::placeholder {
  color: #566779;
}

.transfer-dialog__input:focus {
  outline: 2px solid #1e88e5;
  outline-offset: 1px;
}

.transfer-dialog__value {
  display: flex;
  gap: 6px;
  align-items: baseline;
  font-family: ui-monospace, "SFMono-Regular", SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-variant-numeric: tabular-nums;
  font-size: 1.1rem;
}

.transfer-dialog__value-unit {
  font-size: 0.85rem;
  color: #aab7c4;
}

.transfer-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.transfer-dialog__actions button {
  margin-top: 0;
}

.muted { color: #aab7c4; font-size: 0.85rem; }

.badges { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  display: inline-block; padding: 6px 10px; border-radius: 999px;
  background: #12202e; color: #cfe4ff; border: 1px solid #2b3a49; font-size: 0.9rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  margin-top: 24px;
  align-items: start;
}

@media (max-width: 960px) {
  .workspace {
    grid-template-columns: 1fr;
  }
}

.prompt-panel {
  min-width: 0;
}

.history-panel {
  border: 1px solid #2b3a49;
  border-radius: 8px;
  background: #0f141a;
  padding: 12px;
}

.history-panel h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  color: #cfe4ff;
}

.usage-log {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 420px;
  overflow-y: auto;
  font-size: 0.9rem;
  border-top: 1px solid #1f2b37;
}

.usage-log li {
  padding: 10px 0;
  border-bottom: 1px solid #1f2b37;
  line-height: 1.4;
}

.usage-log li:last-child {
  border-bottom: 0;
}

.usage-log li.empty {
  color: #73859a;
  font-style: italic;
}

/* Dialog */
dialog {
  border: 1px solid #2b3a49; border-radius: 10px; padding: 16px 16px 10px;
  background: #0f141a; color: #e8ecf1; max-width: 520px;
}
dialog::backdrop { background: rgba(0,0,0,0.5); backdrop-filter: blur(2px); }
dialog h3 { margin: 0 0 8px; font-size: 1rem; }
dialog button { margin-top: 12px; }

/* Align buttons with inputs inside left-rail sections */
.section .panel-row { align-items: flex-end; }
.section .wallet-actions { margin-left: auto; display: flex; align-items: flex-end; gap: 10px; }
.section .wallet-actions button { margin-top: 0; }
.return-button { width: auto; }
