* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  color: #111;
  background: #fafafa;
}
.container {
  max-width: 720px;
  margin: 48px auto;
  padding: 0 20px;
}
h1 { margin: 0 0 8px; font-size: 24px; }
.hint { margin: 8px 0 24px; color: #444; line-height: 1.4; }
.form { display: grid; gap: 16px; }

.field { display: grid; gap: 6px; }
label { font-size: 14px; color: #333; }

.ghost-wrap { position: relative; }

input[type="text"], input[type="email"] {
  width: 100%;
  height: 40px;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  outline: none;
  transition: box-shadow 160ms ease, background-color 160ms ease, color 160ms ease;
  font-size: 16px;
  font-variant-ligatures: none;
}

/* Suggestion state (yellow bg, ghost overlay visible) */
input[data-state="suggestion"] {
  background: #FFF9E6;
  color: transparent; /* hide native text while ghost overlay renders */
  caret-color: #111; /* keep caret visible */
  font-style: normal;
}

/* Accepted / Rejected look */
input[data-state="accepted"],
input[data-state="rejected"] {
  background: #fff;
  color: #111;
  font-style: normal;
}

input:focus {
  box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.25);
}

/* Ghost overlay */
.ghost-layer {
  position: absolute;
  pointer-events: none;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 8px 12px;
  font-size: 16px;
  line-height: 24px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  visibility: hidden; /* default hidden; shown in suggestion state via JS */
}

.ghost-prefix { color: #111; }
.ghost-rem { color: #888; font-style: italic; }

.actions { margin-top: 8px; }
.actions button {
  height: 36px;
  padding: 0 14px;
  border: 1px solid #c9c9c9;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}
.actions button:hover { background: #f3f3f3; }

.debug { margin-top: 24px; padding-top: 8px; border-top: 1px solid #eee; }
.debug h2 { font-size: 16px; margin: 0 0 6px; color: #333; }
pre {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 12px;
  min-height: 70px;
  overflow: auto;
}
