:root {
  --bg: #f7f7f8;
  --fg: #1b1b1f;
  --muted: #6b6b74;
  --border: #d6d6de;
  --panel: #ffffff;
  --accent: #0b7285;
  --accent-hover: #095c6b;
  --accent-fg: #ffffff;
  --error: #c92a2a;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121216;
    --fg: #e8e8ec;
    --muted: #9a9aa5;
    --border: #35353d;
    --panel: #1c1c22;
    --accent: #22b8cf;
    --accent-hover: #3bc9db;
    --accent-fg: #06272d;
    --error: #ff6b6b;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
}

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

.header h1 {
  margin: 0.5rem 0 0;
  font-size: 1.6rem;
}

.header h1 a {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: inherit;
  text-decoration: none;
}

.logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.tagline {
  margin: 0.25rem 0 1.25rem;
  color: var(--muted);
}

.muted {
  color: var(--muted);
  font-size: 0.85rem;
}

textarea {
  width: 100%;
  min-height: 45vh;
  padding: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  color: var(--fg);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  resize: vertical;
}

textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.over {
  color: var(--error);
  font-weight: 600;
}

.turnstile {
  margin: 0.75rem 0;
  min-height: 65px;
}

button.primary {
  padding: 0.6rem 1.4rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-fg);
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

button.primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

button.primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.error {
  color: var(--error);
}

.share-row {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
}

.share-row input {
  flex: 1;
  min-width: 0;
  padding: 0.6rem 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  color: var(--fg);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* White backdrop and quiet zone so the QR scans well in dark mode too. */
.qrcode {
  width: fit-content;
  padding: 12px;
  margin: 1rem 0;
  background: #ffffff;
  border-radius: 8px;
}

.qrcode img,
.qrcode canvas {
  display: block;
}

/* Sublime-style code block: always dark (Base16 Ocean), line numbers gutter. */
.code-wrap {
  display: flex;
  background: #2b303b;
  color: #c0c5ce;
  border-radius: 8px;
  overflow: hidden;
}

.line-numbers {
  flex-shrink: 0;
  padding: 1em 0.75em;
  border-right: 1px solid #343d46;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.45;
  color: #65737e;
  text-align: right;
  white-space: pre;
  user-select: none;
}

pre {
  flex: 1;
  min-width: 0;
  margin: 0;
}

pre code {
  display: block;
  padding: 1em;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.45;
}

a {
  color: var(--accent);
}

/* Landing-page copy below the editor: what the app is, how it works, FAQ.
   Kept quiet on purpose so it never competes with the paste box. */
.about {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.about h2 {
  margin: 2rem 0 0.5rem;
  font-size: 1.15rem;
}

.about h2:first-child {
  margin-top: 0;
}

.about h3 {
  margin: 1.5rem 0 0.25rem;
  font-size: 0.98rem;
}

.about p,
.about li {
  color: var(--muted);
  font-size: 0.95rem;
}

.steps {
  margin: 0;
  padding-left: 1.2rem;
}

.steps li {
  margin-bottom: 0.35rem;
}

.about code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
}

.site-footer {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0;
}
