@import url("https://fonts.googleapis.com/css2?family=Fraunces:wght@600;700&family=Space+Grotesk:wght@400;500;600&display=swap");

:root {
  color-scheme: light;
  --bg: #f7f2ea;
  --bg-accent: #e7efe5;
  --ink: #1b1b1b;
  --muted: #5a5348;
  --accent: #ff7a18;
  --accent-2: #1fb59c;
  --card: #fffaf3;
  --shadow: rgba(23, 20, 14, 0.15);
  --border: rgba(27, 27, 27, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #fff4da, transparent 45%),
    radial-gradient(circle at 10% 80%, #d8f4f0, transparent 40%),
    linear-gradient(135deg, var(--bg), var(--bg-accent));
  color: var(--ink);
}

.halo {
  position: fixed;
  top: -180px;
  right: -120px;
  width: 420px;
  height: 420px;
  background: conic-gradient(from 120deg, #ffb15d, #ffd59c, #9be8d8, #ffb15d);
  border-radius: 50%;
  filter: blur(10px);
  opacity: 0.35;
  pointer-events: none;
  z-index: -1;
}

.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 72px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.mast {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.7rem;
  color: var(--muted);
  margin: 0 0 8px;
}

h1 {
  font-family: "Fraunces", serif;
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  margin: 0;
}

.chip {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  box-shadow: 0 6px 18px var(--shadow);
  max-width: 100%;
  word-break: break-all;
  overflow-wrap: anywhere;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 18px 40px var(--shadow);
  animation: float-in 0.6s ease;
}

.panel__intro h2 {
  margin: 0 0 10px;
  font-size: 1.6rem;
  font-family: "Fraunces", serif;
}

.panel__intro p {
  margin: 0 0 26px;
  color: var(--muted);
}

.panel__intro--details {
  display: grid;
  gap: 10px;
}

.panel__intro--details h2 {
  margin: 0;
  line-height: 1.2;
}

.details-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.details-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel__form {
  display: grid;
  gap: 16px;
  max-width: 420px;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 500;
}

input {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 1rem;
  background: #fff;
  width: 100%;
  max-width: 100%;
}

input[readonly] {
  background: #f0ebe4;
  color: #5a5348;
  border-style: dashed;
}

select {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 1rem;
  background: #fff;
  width: 100%;
  max-width: 100%;
}

select:disabled {
  opacity: 0.7;
}

.field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.eye {
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

button {
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  font-size: 1rem;
  font-weight: 600;
  background: var(--accent);
  color: #1b1b1b;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 10px 24px rgba(255, 122, 24, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.icon {
  display: inline-flex;
  width: 16px;
  height: 16px;
}

.icon svg {
  width: 100%;
  height: 100%;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

button.ghost {
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: none;
}

button.danger {
  background: #ff4f4f;
  color: #fff;
  box-shadow: 0 10px 22px rgba(255, 79, 79, 0.3);
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.card {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  background: #fffdf8;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.card--wide {
  grid-column: auto;
}

.card h3 {
  margin: 0 0 14px;
  font-size: 1rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.defaults {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: #fff3df;
  border: 1px solid var(--border);
  margin-bottom: 14px;
}

.defaults strong {
  display: block;
  font-size: 0.95rem;
  margin-top: 4px;
  word-break: break-all;
}

.helper {
  font-size: 0.8rem;
  color: var(--muted);
}

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

.actions--top {
  justify-content: flex-start;
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.title-row h3 {
  margin: 0;
  line-height: 1;
}
.title-row h2 {
  margin: 0;
  line-height: 1;
}

#back-to-list {
  padding: 8px 14px;
  justify-self: start;
}

.card__header button {
  padding: 10px 16px;
}

.pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  background: #f0efe9;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.bots {
  display: grid;
  gap: 16px;
}

.details-grid {
  display: grid;
  gap: 16px;
  width: 100%;
  min-width: 0;
}

.bot {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  background: #fff;
  display: grid;
  gap: 12px;
}

.bot--summary {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bot--summary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 22px rgba(23, 20, 14, 0.12);
}

.bot__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.bot__header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.bot__toggle {
  padding: 8px 14px;
  box-shadow: none;
  border: 1px solid transparent;
}

.bot__toggle.ghost {
  border-color: var(--border);
}

.status {
  font-size: 0.85rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f3f3f3;
}

.status.running {
  background: #def7f2;
  color: #0b6b58;
}

.status.paused {
  background: #f7efe0;
  color: #885f16;
}

.bot__meta {
  font-size: 0.9rem;
  color: var(--muted);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 16px;
}

.bot__meta span {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

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

.note {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.error {
  color: #b62929;
  margin: 0;
}

.panel--hidden {
  display: none;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 16, 12, 0.35);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 10;
}

.overlay.hidden {
  display: none;
}

.modal {
  width: min(720px, 100%);
  max-height: 90vh;
  overflow: hidden;
  background: #fffdf8;
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px rgba(23, 20, 14, 0.25);
  padding: 20px;
  display: grid;
  gap: 16px;
  animation: float-in 0.3s ease;
}

.modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.modal__body {
  display: grid;
  gap: 12px;
  overflow: auto;
  max-height: calc(90vh - 120px);
  padding-right: 4px;
}

.section {
  display: grid;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  min-width: 0;
}


.section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 16px;
  color: var(--muted);
  font-size: 0.9rem;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.wallet-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.wallet-row .mono {
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  .mast {
    flex-direction: column;
    align-items: flex-start;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 24px;
  }

  .chip {
    align-self: stretch;
    border-radius: 16px;
  }

  .bot__meta {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .section label {
    grid-template-columns: 1fr;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .actions button {
    width: 100%;
  }

  #details-actions {
    flex-direction: row;
    align-items: center;
  }

  #details-actions button {
    width: auto;
  }
}
