:root {
  --bg: #f7f6f3;
  --bg-card: #ffffff;
  --text: #1c1b19;
  --text-muted: #6b6963;
  --border: #e4e1da;
  --accent: #d64545;
  --accent-hover: #b83636;
  --accent-text: #ffffff;
  --success: #2f7a4f;
  --error: #c0392b;
  --code-bg: #f1efe9;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161513;
    --bg-card: #201f1c;
    --text: #efece5;
    --text-muted: #a29e93;
    --border: #34322c;
    --accent: #e2604f;
    --accent-hover: #ef7a6a;
    --accent-text: #161513;
    --success: #4fbd7c;
    --error: #ff6b5b;
    --code-bg: #262420;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  }
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

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

.logo {
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.logo span {
  color: var(--accent);
}

.tagline {
  color: var(--text-muted);
  font-size: 0.95rem;
}

h1 {
  font-size: 1.8rem;
  line-height: 1.25;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.2rem;
  margin: 32px 0 12px;
}

p.lede {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0 0 28px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.card + .card {
  margin-top: 20px;
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin: 18px 0 6px;
}

label:first-child {
  margin-top: 0;
}

.hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 6px;
}

input[type="text"],
textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.98rem;
  padding: 11px 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  resize: vertical;
}

textarea {
  min-height: 260px;
  line-height: 1.5;
}

input[type="text"]:focus,
textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: var(--accent-text);
  border: none;
  padding: 13px 22px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn:hover {
  background: var(--accent-hover);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn.secondary:hover {
  background: var(--code-bg);
}

.btn.small {
  padding: 6px 12px;
  font-size: 0.82rem;
  border-radius: 7px;
}

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

.error-box {
  background: rgba(192, 57, 43, 0.1);
  border: 1px solid var(--error);
  color: var(--error);
  padding: 12px 14px;
  border-radius: 9px;
  font-size: 0.92rem;
  margin-top: 16px;
  display: none;
}

.error-box.visible {
  display: block;
}

.clip {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
  background: var(--code-bg);
}

.clip .meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 8px;
  font-weight: 700;
}

.clip blockquote {
  margin: 0 0 10px;
  padding-left: 14px;
  border-left: 3px solid var(--accent);
  font-style: italic;
  color: var(--text);
}

.clip .caption {
  font-weight: 600;
}

.copy-row {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

.post-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
  background: var(--code-bg);
  white-space: pre-wrap;
  font-size: 0.95rem;
}

.locked {
  position: relative;
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 28px 20px;
  text-align: center;
  background: var(--code-bg);
  margin-top: 20px;
}

.locked h3 {
  margin: 0 0 6px;
}

.locked p {
  color: var(--text-muted);
  margin: 0 0 16px;
}

.price-tag {
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--accent);
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

footer.disclaimer {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--code-bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.badge.paid {
  color: var(--success);
  border-color: var(--success);
}

.skeleton {
  color: var(--text-muted);
  padding: 20px 0;
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.5rem;
  }
  .card {
    padding: 18px;
  }
}
