:root {
  color-scheme: light dark;
  --bg: #faf9f5;
  --panel: #f3f1ea;
  --panel-2: #ebe8e0;
  --line: #e4e1d8;
  --ink: #1c1b18;
  --muted: #55524a;
  --subtle: #7f7b6e;
  --accent: #2d342e;
  --danger: #a43e2a;
  --success: #38684e;
  --sans: "Inter Variable", system-ui, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --serif: "Iowan Old Style", Charter, Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131211;
    --panel: #1b1d1a;
    --panel-2: #181715;
    --line: #2a2925;
    --ink: #f6f4ee;
    --muted: #a9a599;
    --subtle: #7d7a6e;
    --accent: #d7d0c0;
    --danger: #e08065;
    --success: #82c29b;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

main {
  width: 100%;
  max-width: 26rem;
  padding: 1.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.brand {
  margin: 0 0 1.25rem;
  font-family: var(--serif);
  font-size: 15px;
  color: var(--subtle);
}

 .server { overflow-wrap: anywhere; font-size: 12px; }

h1 {
  margin: 0 0 0.5rem;
  font-size: 18px;
  font-weight: 600;
}

p { margin: 0 0 1rem; color: var(--muted); }

.field { margin-bottom: 0.875rem; }

label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 12px;
  color: var(--muted);
}

input {
  width: 100%;
  padding: 0.5rem 0.625rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
}

input:focus { border-color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

button {
  width: 100%;
  padding: 0.5625rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 100ms ease-out;
}

button:hover { opacity: 0.9; }
button:disabled { opacity: 0.5; cursor: default; }

button.secondary {
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
}

button.secondary:hover { background: var(--panel-2); color: var(--ink); }

.actions { display: flex; gap: 0.5rem; }

.status {
  margin-top: 0.875rem;
  padding: 0.5rem 0.625rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  color: var(--muted);
}

.status:empty { display: none; }

.status.error {
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
  color: var(--danger);
}

.status.done {
  border-color: color-mix(in srgb, var(--success) 45%, transparent);
  color: var(--success);
}

.code {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  background: var(--panel-2);
  font-family: var(--mono);
  font-size: 20px;
  letter-spacing: 0.18em;
  word-break: break-all;
}

.meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}

dl { margin: 0 0 1rem; }
dt { font-size: 12px; color: var(--subtle); }
dd { margin: 0 0 0.75rem; font-family: var(--mono); word-break: break-all; }

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
  font-size: 12px;
}

a { color: var(--muted); text-underline-offset: 2px; }
a:hover { color: var(--ink); }

[hidden] { display: none !important; }

@media (max-width: 30rem) {
  main { padding: 1.25rem; border: none; background: var(--bg); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.001ms !important; }
}
