:root {
  color-scheme: dark light;
  --bg: #0b0f14;
  --panel: #131a22;
  --line: #243040;
  --text: #e8eef4;
  --muted: #93a3b5;
  --accent: #2ee6a6;
  --accent-2: #27c4f5;
  --on-accent: #06221a;
  --danger: #ff6b6b;
  --radius: 14px;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f7f9;
    --panel: #ffffff;
    --line: #dbe3ea;
    --text: #0f1a24;
    --muted: #55677a;
    --accent: #0a9f6e;
    --accent-2: #0a86b8;
    --on-accent: #ffffff;
    --danger: #c9302c;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 16px;
}
main { width: 100%; max-width: 420px; }
.brand { display: block; margin: 0 auto 16px; width: 72px; height: 28px; }
#app {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
h1 { font-size: 22px; line-height: 1.25; margin: 0; outline: none; }
h1.site { font-size: 26px; overflow-wrap: anywhere; }
p { margin: 0; }
.eyebrow { color: var(--muted); font-size: 14px; }
.note { color: var(--muted); font-size: 14px; border-left: 2px solid var(--accent-2); padding-left: 10px; }
.center { text-align: center; }
.error { color: var(--danger); font-size: 14px; }
.error:empty { display: none; }
button {
  font: inherit;
  font-weight: 600;
  min-height: 46px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
}
button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}
button:disabled { opacity: 0.45; cursor: not-allowed; }
.primary { background: var(--accent); color: var(--on-accent); }
.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.row { display: flex; gap: 8px; }
.row button { flex: 1; font-size: 14px; font-weight: 500; }
input[type="text"], textarea {
  font: inherit;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
}
textarea { resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }
form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
.check { display: flex; align-items: center; gap: 8px; font-size: 15px; min-height: 32px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.words {
  list-style-position: inside;
  padding: 12px;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 12px;
  grid-auto-flow: row;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  font: 15px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.words li::marker { color: var(--muted); }
.id {
  font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow-wrap: anywhere;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
details { font-size: 14px; color: var(--muted); }
details ul { margin: 8px 0 0; padding-left: 18px; overflow-wrap: anywhere; }
.busy { display: flex; align-items: center; gap: 12px; min-height: 80px; }
.spinner {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
footer { margin-top: 12px; text-align: center; font-size: 12px; color: var(--muted); }
/* Inside a site's frame: no page chrome, the frame grows to fit, the site keeps its own look around it. */
[data-mode="frame"] body { display: block; min-height: 0; padding: 0; background: transparent; }
[data-mode="frame"] main { max-width: none; }
[data-mode="frame"] .brand, [data-mode="frame"] footer { display: none; }
[data-mode="frame"] #app { padding: 16px; }


/* The confirm step: one fixed height, so its buttons can move without the frame's height changing. */
.confirm-area { position: relative; height: 208px; }
.confirm-area button { width: 100%; }
