:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #1b1f24;
  --muted: #5f6b7a;
  --border: #d8dde3;
  --accent: #2f6fed;
  --accent-text: #ffffff;
  --danger: #c93636;
  --error-bg: #fdecec;
  --info-bg: #e8f0fe;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418;
    --card: #1a1f25;
    --text: #e6e9ed;
    --muted: #9aa5b1;
    --border: #2c333b;
    --accent: #5b8ff9;
    --accent-text: #0b0d10;
    --danger: #f06a6a;
    --error-bg: #3a1d1d;
    --info-bg: #1c2a44;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header, main, footer {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  padding-bottom: 12px;
}

.brand { color: var(--text); font-weight: 600; text-decoration: none; }

main { flex: 1; }

section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

h1 { font-size: 1.4rem; margin: 0 0 8px; }

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

form, #created, #view-ready, #view-secret { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
[hidden] { display: none !important; }

label { display: flex; flex-direction: column; gap: 4px; font-size: 0.92rem; color: var(--muted); flex: 1; }

textarea, input, select {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  width: 100%;
}
textarea { resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92rem; }
textarea:focus, input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.row { display: flex; gap: 12px; flex-wrap: wrap; }

.copy { display: flex; gap: 8px; }
.copy input { flex: 1; min-width: 0; }

button {
  font: inherit;
  font-weight: 600;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-text);
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
}
button:disabled { opacity: 0.6; cursor: progress; }
button.secondary { background: transparent; color: var(--accent); }
button.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
button.link { background: none; border: none; color: var(--accent); padding: 4px; font-weight: 500; }

.message { margin-top: 16px; padding: 12px 16px; border-radius: 8px; }
.message.error { background: var(--error-bg); }
.message.info { background: var(--info-bg); }

footer { text-align: center; padding-top: 24px; padding-bottom: 24px; }
