:root {
  --bg: #f3efe6;
  --ink: #161513;
  --muted: #5c574e;
  --line: #cfc6b6;
  --paper: #faf7f0;
  --accent: #9a3412;
  --accent-ink: #fffaf4;
  --warn: #7a2e0e;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.top {
  padding: 1.5rem 1.5rem 0;
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.mark {
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}

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

main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(16rem, 0.7fr);
  gap: 2rem;
  padding: 1.25rem 1.5rem 2rem;
}

.work textarea {
  width: 100%;
  display: block;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0.85rem 0.9rem;
  font: 0.95rem/1.45 ui-sans-serif, system-ui, -apple-system, sans-serif;
  resize: vertical;
}

.work textarea:focus {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin: 0.55rem 0 0.9rem;
}

.toolbar label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--muted);
}

select, input[type="email"] {
  font: 0.9rem ui-sans-serif, system-ui, sans-serif;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  padding: 0.35rem 0.45rem;
}

.count, .trial {
  font: 0.82rem ui-sans-serif, system-ui, sans-serif;
  color: var(--muted);
}

.go, .packs button, .claim button {
  font: 0.9rem ui-sans-serif, system-ui, sans-serif;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
}

.go:disabled, .packs button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ghost {
  font: 0.85rem ui-sans-serif, system-ui, sans-serif;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 0.35rem 0.7rem;
  cursor: pointer;
}

.ghost:disabled { opacity: 0.4; cursor: not-allowed; }

.status {
  font: 0.85rem/1.4 ui-sans-serif, system-ui, sans-serif;
  color: var(--warn);
  margin: 0 0 0.7rem;
}

.rail h2 {
  font-size: 1rem;
  margin: 0 0 0.4rem;
}

.lede {
  margin: 0 0 0.8rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.rail section + section { margin-top: 1.75rem; }

.packs {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.packs button, .claim button { width: 100%; text-align: left; }

#buy label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.code, #claim-out {
  font: 0.75rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 0.7rem;
  overflow-x: auto;
  white-space: pre-wrap;
}

.claim { margin-top: 0.8rem; }

footer {
  padding: 0 1.5rem 1.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 840px) {
  main { grid-template-columns: 1fr; }
}
