:root { color-scheme: light dark; }
* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0; padding: 2rem; line-height: 1.5;
  background: Canvas; color: CanvasText;
}
main { max-width: 720px; margin: 0 auto; }
h1 { margin: 0 0 .25rem; }
.sub { margin: 0 0 1.5rem; opacity: .7; font-size: .9rem; }
.card {
  border: 1px solid color-mix(in srgb, CanvasText 15%, transparent);
  border-radius: 12px; padding: 1.25rem 1.5rem; margin-bottom: 1.25rem;
}
.card h2 { margin: 0 0 .5rem; font-size: 1.05rem; }
.card p { margin: .25rem 0 1rem; opacity: .85; font-size: .92rem; }
button {
  background: #4f46e5; color: #fff; border: 0; border-radius: 8px;
  padding: .6rem 1.1rem; font-size: .95rem; cursor: pointer;
}
button:hover { background: #4338ca; }
.row { display: flex; gap: .5rem; align-items: center; }
input[type=text] {
  flex: 1; padding: .55rem .7rem; border-radius: 8px;
  border: 1px solid color-mix(in srgb, CanvasText 25%, transparent);
  background: Field; color: FieldText; font-size: .9rem;
}
.hint { font-size: .85rem; opacity: .8; }
pre {
  background: color-mix(in srgb, CanvasText 8%, transparent);
  padding: 1rem; border-radius: 8px; overflow-x: auto; font-size: .82rem;
  white-space: pre-wrap; word-break: break-word;
}
.warn {
  background: color-mix(in srgb, #f59e0b 20%, transparent);
  border: 1px solid #f59e0b; border-radius: 8px; padding: .85rem 1rem;
  margin-bottom: 1.25rem; font-size: .9rem;
}
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

textarea {
  width: 100%; padding: .55rem .7rem; border-radius: 8px; resize: vertical;
  border: 1px solid color-mix(in srgb, CanvasText 25%, transparent);
  background: Field; color: FieldText; font-family: ui-monospace, Menlo, monospace;
  font-size: .8rem;
}
button:disabled { opacity: .45; cursor: not-allowed; }
button.ghost {
  background: transparent; color: inherit;
  border: 1px solid color-mix(in srgb, CanvasText 30%, transparent);
  padding: .55rem .9rem;
}
button.ghost:hover { background: color-mix(in srgb, CanvasText 8%, transparent); }
input[type=password] {
  padding: .55rem .7rem; border-radius: 8px;
  border: 1px solid color-mix(in srgb, CanvasText 25%, transparent);
  background: Field; color: FieldText; font-family: ui-monospace, Menlo, monospace; font-size: .8rem;
}

/* Pipeline visualization */
.pipe {
  display: flex; align-items: stretch; gap: .5rem; margin: 0 0 1.5rem;
  flex-wrap: wrap;
}
.pipe .node {
  flex: 1; min-width: 110px; text-align: center; padding: .7rem .5rem;
  border-radius: 10px; font-size: .82rem; font-weight: 600;
  border: 1px solid color-mix(in srgb, CanvasText 15%, transparent);
  background: color-mix(in srgb, CanvasText 4%, transparent);
  transition: all .3s ease; position: relative;
}
.pipe .node small { display: block; font-weight: 400; opacity: .65; font-size: .72rem; }
.pipe .node .dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: color-mix(in srgb, CanvasText 30%, transparent); margin-right: .35rem;
  vertical-align: middle;
}
.pipe .node.active { border-color: #f59e0b; background: color-mix(in srgb, #f59e0b 12%, transparent); }
.pipe .node.active .dot { background: #f59e0b; animation: pulse 1s infinite; }
.pipe .node.done { border-color: #10b981; background: color-mix(in srgb, #10b981 12%, transparent); }
.pipe .node.done .dot { background: #10b981; }
.pipe .arrow { align-self: center; opacity: .4; font-size: 1.2rem; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

/* Result + identity card */
.result { margin-top: 1rem; }
.identity-card {
  display: flex; align-items: center; gap: .8rem; margin-bottom: .8rem;
  flex-wrap: wrap;
}
.identity-card img { width: 48px; height: 48px; border-radius: 50%; }
.identity-card .who { font-weight: 700; font-size: 1.05rem; }
.identity-card .email { opacity: .7; font-size: .9rem; }
.identity-card .match {
  width: 100%; padding: .5rem .7rem; border-radius: 8px; font-size: .88rem; font-weight: 600;
}
.identity-card .match.ok { background: color-mix(in srgb, #10b981 18%, transparent); color: #065f46; }
.identity-card .match.warn { background: color-mix(in srgb, #f59e0b 22%, transparent); color: #92400e; }
@media (prefers-color-scheme: dark) {
  .identity-card .match.ok { color: #6ee7b7; }
  .identity-card .match.warn { color: #fcd34d; }
}
