:root {
  --bg: #f3e4b8;
  --panel: #fff9ea;
  --panel-strong: #fffdf7;
  --border: #3f3421;
  --border-soft: #b8a47a;
  --text: #17130d;
  --muted: #5a4d39;
  --accent: #8f5f00;
  --good-bg: #e5f6df;
  --good-border: #4a7b34;
  --error-bg: #fde2dd;
  --error-border: #b14b3e;
  --shadow: 0 10px 30px rgba(63, 52, 33, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0 auto;
  max-width: 1080px;
  padding: 28px 20px 48px;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.55), transparent 28%),
    linear-gradient(180deg, #edd47f 0%, var(--bg) 18%, #efe6cf 100%);
  color: var(--text);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  line-height: 1.45;
}

a {
  color: inherit;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

img {
  max-width: 100%;
  display: block;
}

.header {
  margin-bottom: 28px;
}

.header p {
  max-width: 760px;
  color: var(--muted);
  font-size: 16px;
}

.nav {
  margin-top: 12px;
  font-size: 15px;
}

.nav a {
  margin-right: 14px;
}

.panel {
  margin-bottom: 20px;
  padding: 22px;
  background: var(--panel);
  border: 3px solid var(--border);
  box-shadow: var(--shadow);
}

.panel h2 {
  margin-bottom: 8px;
  font-size: 24px;
}

.panel-intro {
  margin-bottom: 16px;
  color: var(--muted);
}

.row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

label {
  display: block;
  font-weight: bold;
  margin-bottom: 10px;
  color: var(--text);
}

.field-note {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: normal;
}

input,
select,
textarea,
button {
  width: 100%;
  padding: 10px 12px;
  margin-top: 6px;
  border: 2px solid var(--border-soft);
  background: var(--panel-strong);
  color: var(--text);
  font: inherit;
  border-radius: 0;
}

textarea {
  min-height: 220px;
  resize: vertical;
  font-family: monospace;
}

button {
  width: auto;
  cursor: pointer;
  font-weight: bold;
  margin-right: 10px;
  margin-top: 0;
  border-color: var(--border);
  background: #f0d694;
}

.actions {
  margin-top: 14px;
}

.notice {
  margin-top: 12px;
  padding: 12px;
  border: 2px solid var(--border-soft);
  background: #fff8df;
  line-height: 1.5;
}

.notice.error {
  background: var(--error-bg);
  border-color: var(--error-border);
}

.notice.good {
  background: var(--good-bg);
  border-color: var(--good-border);
}

.load-panel {
  margin-top: 14px;
  padding: 12px;
  border: 2px solid var(--border-soft);
  background: rgba(255, 253, 247, 0.92);
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.load-copy {
  min-width: 0;
}

.load-progress-track {
  margin-top: 8px;
  height: 10px;
  border: 2px solid var(--border-soft);
  background: #f6edd7;
}

.load-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #c08a21 0%, #f0d694 100%);
  transition: width 120ms ease-out;
}

.turnstile {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-soft);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: turnstile-spin 0.9s linear infinite;
}

@keyframes turnstile-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.mono {
  font-family: monospace;
}

.centered {
  text-align: center;
}

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

.stack-list {
  margin: 0;
  padding-left: 20px;
}

.stack-list li + li {
  margin-top: 8px;
}

.codebox {
  padding: 12px;
  border: 2px solid var(--border-soft);
  background: var(--panel-strong);
  font-family: monospace;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.footnote {
  font-size: 14px;
  line-height: 1.5;
}

.hidden {
  display: none;
}

.site-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 20px;
  align-items: start;
}

.feature-list,
.plain-list {
  margin: 0;
  padding-left: 20px;
}

.feature-list li + li,
.plain-list li + li {
  margin-top: 8px;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.pill-list li {
  padding: 8px 12px;
  border: 2px solid var(--border-soft);
  background: var(--panel-strong);
  font-family: monospace;
}

.split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.summary-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 8px 12px;
}

.summary-grid div:nth-child(odd) {
  font-weight: bold;
}

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

.market-card-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.market-meta {
  text-align: right;
  font-family: monospace;
  font-size: 13px;
  color: var(--muted);
}

.market-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.banner-frame {
  padding: 16px;
  background: rgba(255, 255, 255, 0.4);
  border: 2px solid var(--border-soft);
}

@media (max-width: 720px) {
  body {
    padding-left: 12px;
    padding-right: 12px;
  }

  .row,
  .split-grid,
  .site-hero,
  .summary-grid,
  .market-columns {
    grid-template-columns: 1fr;
  }

  .market-card-header {
    flex-direction: column;
  }

  .market-meta {
    text-align: left;
  }
}
