
:root {
  --bg: #09090b;
  --panel: rgba(255,255,255,0.04);
  --panel-strong: rgba(255,255,255,0.06);
  --border: rgba(255,255,255,0.1);
  --text: #f5f5f5;
  --muted: #a1a1aa;
  --soft: #71717a;
  --accent: #ffffff;
  --success: #34d399;
  --error: #f87171;
  --warn: #fbbf24;
  --shadow: 0 20px 60px rgba(0,0,0,0.35);
  --radius: 24px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top, rgba(245,158,11,0.12), transparent 28%),
    radial-gradient(circle at 75% 20%, rgba(168,85,247,0.10), transparent 24%),
    linear-gradient(to bottom, #09090b, #09090b);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, textarea, select {
  font: inherit;
}

button {
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}

a { color: inherit; }

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
  background: rgba(9,9,11,0.9);
}

.topbar h1 {
  margin: 2px 0 0;
  font-size: 1.7rem;
}

.eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--soft);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.toolbar button,
.toolbar input {
  height: 42px;
  border-radius: 999px;
  padding: 0 16px;
  background: rgba(255,255,255,0.04);
}

.toolbar button.primary {
  background: #34d399;
  border-color: transparent;
  color: #09090b;
  font-weight: 700;
}

.toolbar button.solid {
  background: #ffffff;
  border-color: transparent;
  color: #09090b;
  font-weight: 700;
}

.toolbar button.active {
  background: rgba(255,255,255,0.12);
}

.toolbar input {
  min-width: 180px;
  color: var(--text);
  outline: none;
}

.layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 380px;
  gap: 24px;
  padding: 24px;
  max-width: 1800px;
  margin: 0 auto;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.sidebar,
.inspector {
  padding: 18px;
}

.status-card {
  padding: 18px;
  margin-bottom: 16px;
}

.status-card strong {
  display: block;
  font-size: 2rem;
  margin-top: 8px;
}

.section-card,
.tree-item,
.small-btn,
.inspector button,
.array-item button,
.preview-selectable,
.publish-status,
.link-chip,
.card,
.hero-card,
.token-row button {
  transition: 180ms ease;
}

.section-card {
  width: 100%;
  text-align: left;
  padding: 14px;
  border-radius: 20px;
  background: rgba(255,255,255,0.03);
  margin-bottom: 10px;
}

.section-card.active,
.tree-item.active {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.25);
}

.section-card .meta,
.tree-item .meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}

.tree-list {
  margin: 8px 0 16px 14px;
  display: grid;
  gap: 8px;
}

.tree-item {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.02);
}

.preview-wrap {
  display: grid;
  gap: 14px;
}

.helper-card,
.publish-status {
  padding: 14px 16px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--muted);
}

.publish-status.success {
  background: rgba(52,211,153,0.10);
  border-color: rgba(52,211,153,0.3);
  color: #bbf7d0;
}

.publish-status.error {
  background: rgba(248,113,113,0.10);
  border-color: rgba(248,113,113,0.3);
  color: #fecaca;
}

.publish-status.loading {
  background: rgba(251,191,36,0.10);
  border-color: rgba(251,191,36,0.3);
  color: #fde68a;
}

.preview-frame {
  overflow: hidden;
  border-radius: 32px;
  border: 1px solid var(--border);
  background: var(--bg);
  box-shadow: var(--shadow);
}

.preview-frame.mobile {
  width: 390px;
  max-width: 100%;
  margin: 0 auto;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  background: rgba(9,9,11,0.9);
}

.preview-nav {
  display: none;
  gap: 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

@media (min-width: 860px) {
  .preview-nav { display: flex; }
}

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.hero img.hero-image {
  width: 100%;
  height: 64vh;
  min-height: 420px;
  object-fit: contain;
  background: #09090b;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, #09090b, rgba(9,9,11,0.28), rgba(9,9,11,0.12));
}

.hero-inner {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: 20px;
}

.hero-grid {
  display: grid;
  gap: 18px;
}

@media (min-width: 1100px) {
  .hero-grid {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: end;
  }
}

.hero-card {
  padding: 20px;
  border-radius: 28px;
  background: rgba(0,0,0,0.34);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.10);
}

.hero-card.active-select,
.preview-selectable.active-select {
  outline: 2px solid rgba(255,255,255,0.65);
  outline-offset: -2px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.10);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: #d4d4d8;
}

.hero-profile {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

@media (min-width: 720px) {
  .hero-profile {
    flex-direction: row;
    align-items: center;
  }
}

.hero-profile img {
  width: 96px;
  height: 96px;
  border-radius: 20px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.15);
}

.hero h2,
.hero h3,
.section h2,
.card h3 {
  margin: 0;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 1;
  font-weight: 700;
}

.hero-subtitle {
  margin-top: 12px;
  color: #e4e4e7;
  line-height: 1.7;
  max-width: 720px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.hero-actions button {
  border-radius: 999px;
  padding: 12px 18px;
  background: rgba(255,255,255,0.08);
}

.hero-actions button.primary {
  background: #ffffff;
  border-color: transparent;
  color: #09090b;
  font-weight: 700;
}

.section {
  padding: 48px 20px;
}

@media (min-width: 720px) {
  .section {
    padding: 56px 28px;
  }
}

.section.alt {
  background: rgba(255,255,255,0.03);
  border-block: 1px solid var(--border);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 26px;
}

.section-heading h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-top: 8px;
}

.section-heading p {
  color: var(--muted);
  line-height: 1.8;
}

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

.grid.cols-3 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(1, minmax(0, 1fr)); }

@media (min-width: 760px) {
  .grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1100px) {
  .grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.card {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  border-radius: 26px;
  overflow: hidden;
}

.card-body {
  padding: 18px;
}

.card img.thumb {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: contain;
  background: #09090b;
  display: block;
  padding: 12px;
}

.card .kicker,
.small {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--soft);
}

.card p,
.card .copy {
  color: var(--muted);
  line-height: 1.7;
}

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

.link-chip {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.link-chip span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--text);
}

.inspector-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 18px;
  margin-bottom: 16px;
  border-radius: 26px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
}

.inspector-card {
  border-radius: 26px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  padding: 18px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.field label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--soft);
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: #09090b;
  color: var(--text);
  outline: none;
}

.field textarea {
  min-height: 110px;
  resize: vertical;
}

.array-actions,
.token-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.small-btn,
.array-actions button,
.token-row button {
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.04);
}

.array-list {
  display: grid;
  gap: 10px;
}

.array-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: #09090b;
}

.array-item .title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.array-item .buttons {
  display: flex;
  gap: 8px;
}

.array-item button {
  border-radius: 999px;
  padding: 8px 10px;
}

.icon-inline {
  display: inline-flex;
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  margin-right: 0.5em;
}

.preview-selectable {
  display: block;
}

.preview-selectable:hover .card,
.preview-selectable:hover .hero-card {
  border-color: rgba(255,255,255,0.2);
}

@media (max-width: 1280px) {
  .layout {
    grid-template-columns: 280px minmax(0, 1fr);
  }
  .inspector {
    grid-column: 1 / -1;
  }
}

@media (max-width: 920px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar,
  .inspector {
    order: 2;
  }
  .preview-wrap {
    order: 1;
  }
  .topbar {
    padding: 16px;
  }
  .toolbar {
    width: 100%;
  }
}
