:root {
  color-scheme: light;
  --bg-top: #ece6d6;
  --bg-bottom: #d6dde7;
  --card: rgba(255, 250, 240, 0.88);
  --card-border: rgba(51, 63, 72, 0.16);
  --text: #162029;
  --muted: #5e6d78;
  --accent: #8a4b2d;
  --accent-dark: #66361f;
  --code-bg: #182129;
  --code-text: #d8e2eb;
  --shadow: 0 24px 70px rgba(28, 43, 53, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.75), transparent 28%),
    linear-gradient(160deg, var(--bg-top), var(--bg-bottom));
}

.page-shell {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0;
  display: grid;
  gap: 20px;
}

.hero-card,
.result-card {
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.hero-card {
  padding: 32px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
  font-weight: 700;
}

h1 {
  font-size: clamp(2rem, 4.4vw, 3.75rem);
  line-height: 0.96;
  max-width: none;
  white-space: nowrap;
}

.subtitle,
.result-header p,
.hint {
  margin: 14px 0 0;
  color: var(--muted);
  max-width: 60ch;
  line-height: 1.6;
}

.preview-form {
  margin-top: 18px;
}

.feed-group {
  margin-top: 26px;
}

.feed-label {
  margin: 0 0 12px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

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

.feed-chip {
  min-width: 0;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  border: 1px solid rgba(22, 32, 41, 0.1);
  padding: 10px 14px;
}

.feed-chip:hover {
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
}

.secondary-button {
  margin-top: 20px;
  background: rgba(255, 255, 255, 0.56);
  color: var(--text);
  border: 1px solid rgba(22, 32, 41, 0.1);
}

.secondary-button:hover {
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
}

.custom-source-panel {
  padding: 16px 18px 0;
  border-top: 1px solid rgba(22, 32, 41, 0.08);
}

.preview-form label {
  display: block;
  margin-bottom: 10px;
  font-weight: 700;
}

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

input,
button {
  border-radius: 14px;
  border: 1px solid rgba(22, 32, 41, 0.14);
  padding: 14px 16px;
  font: inherit;
}

input {
  background: rgba(255, 255, 255, 0.82);
}

button {
  background: var(--accent);
  color: #fff8f2;
  cursor: pointer;
  border-color: transparent;
  min-width: 130px;
}

button:hover {
  background: var(--accent-dark);
}

.result-card {
  padding: 24px;
  overflow: hidden;
}

.result-header {
  margin-bottom: 18px;
}

.response-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.meta-pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  max-width: 100%;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(22, 32, 41, 0.06);
  color: var(--muted);
  font-size: 0.9rem;
}

.meta-pill span {
  color: var(--text);
  overflow-wrap: anywhere;
}

.response-output {
  min-height: 320px;
}

.raw-output {
  margin: 0;
  max-width: 100%;
  padding: 20px;
  border-radius: 18px;
  background: var(--code-bg);
  color: var(--code-text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
  line-height: 1.5;
  overflow: auto;
}

.json-grid,
.json-list {
  display: grid;
  gap: 12px;
}

.json-row,
.json-card,
.json-list-item,
.json-scalar,
.json-empty {
  border: 1px solid rgba(22, 32, 41, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.json-row {
  display: grid;
  grid-template-columns: minmax(140px, 220px) minmax(0, 1fr);
  overflow: hidden;
}

.json-key {
  padding: 14px 16px;
  background: rgba(22, 32, 41, 0.05);
  border-right: 1px solid rgba(22, 32, 41, 0.08);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.json-value {
  min-width: 0;
  padding: 14px 16px;
  overflow-wrap: anywhere;
}

.json-card {
  padding: 14px;
}

.json-card-title {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.json-list-item,
.json-scalar,
.json-empty {
  padding: 14px 16px;
}

.json-string {
  color: #0f5f49;
}

.json-number {
  color: #9a4a1b;
}

.json-boolean {
  color: #7c3265;
}

.json-null {
  color: #6e7780;
}

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

  .json-key {
    border-right: 0;
    border-bottom: 1px solid rgba(22, 32, 41, 0.08);
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 28px 0;
  }

  .hero-card,
  .result-card {
    padding: 20px;
    border-radius: 18px;
  }

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

  h1 {
    white-space: normal;
  }

  button {
    width: 100%;
  }
}
