:root {
  --bg: #f6f6f4;
  --card: #ffffff;
  --fg: #1c1c1a;
  --muted: #6b6b66;
  --line: #deded8;
  --accent: #1c1c1a;
  --accent-fg: #ffffff;
  --err: #b42318;
  --ok: #067647;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111110;
    --card: #1a1a19;
    --fg: #ededea;
    --muted: #9a9a94;
    --line: #2e2e2b;
    --accent: #ededea;
    --accent-fg: #111110;
    --err: #f97066;
    --ok: #47cd89;
  }
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
}
.connect {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: calc(24px + env(safe-area-inset-top, 0px)) calc(16px + env(safe-area-inset-right, 0px))
    calc(24px + env(safe-area-inset-bottom, 0px)) calc(16px + env(safe-area-inset-left, 0px));
}
.card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.01em;
}
h1 span {
  color: var(--muted);
  font-weight: 500;
}
.lede {
  margin: 0 0 8px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 14px;
}
label {
  font-size: 13px;
  font-weight: 600;
}
#code {
  font: 600 16px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.04em;
  padding: 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  width: 100%;
}
#code:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.check {
  font-weight: 400;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
}
button {
  margin-top: 6px;
  padding: 12px;
  border: 0;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-fg);
  font: 600 15px system-ui, sans-serif;
  cursor: pointer;
}
button:disabled {
  opacity: 0.55;
  cursor: progress;
}
.status {
  min-height: 1.4em;
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}
.status.error {
  color: var(--err);
}
.help {
  font-size: 13px;
  color: var(--muted);
}
.help summary {
  cursor: pointer;
}
.help code {
  font-size: 12px;
}
/* Safe-area insets are always 0 inside an iframe, so the shell keeps the opencode UI clear of
   the notch / home indicator when running as an installed app (viewport-fit=cover). */
#app {
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  left: env(safe-area-inset-left, 0px);
  width: calc(100% - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
  height: calc(100% - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  border: 0;
  background: var(--bg);
}
.pill {
  position: fixed;
  z-index: 10;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  font: 500 13px system-ui, sans-serif;
  box-shadow: 0 4px 16px rgb(0 0 0 / 0.2);
}
@media (max-width: 420px) {
  #code {
    font-size: 14px;
    letter-spacing: 0.01em;
  }
}
.embedded {
  margin: 0 0 6px;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.4;
}
.embedded a {
  color: inherit;
  font-weight: 600;
}
