:root {
  --bg: #F2F1EC;
  --surface: #FAF9F5;
  --ink: #26292E;
  --muted: #6C7078;
  --border: #DDD9CF;
  --accent: #4E7D6D;
  --accent-ink: #F4F6F3;
  --danger: #A0554C;
  --danger-soft: #F0E4E1;
  --mono: "SFMono-Regular", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

#app {
  max-width: 620px;
  margin: 0 auto;
  padding: 9vh 24px 12vh;
}

/* Views: crossfade + staggered reveal */
.view { animation: none; }
.view.entering { animation: viewIn 420ms ease both; }
.view.entering > * {
  animation: childIn 420ms ease both;
}
.view.entering > *:nth-child(2) { animation-delay: 60ms; }
.view.entering > *:nth-child(3) { animation-delay: 120ms; }
.view.entering > *:nth-child(4) { animation-delay: 180ms; }
.view.entering > *:nth-child(5) { animation-delay: 240ms; }

@keyframes viewIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes childIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .view.entering, .view.entering > * { animation: none; }
  .pulse { animation: none; }
}

.eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 18px;
}

h1 {
  font-size: clamp(30px, 5.5vw, 42px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 22px;
}

h2 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
}

.lede { color: var(--muted); margin: 0 0 8px; max-width: 52ch; }
.hint { color: var(--muted); font-size: 14px; margin-top: 14px; }

.masthead { margin-bottom: 44px; }
.actions { margin-top: 28px; }

.btn {
  appearance: none;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 22px;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}
.btn:hover { border-color: var(--muted); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #416A5C; }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.slim { padding: 7px 14px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: default; }

/* Session code + share link */
.session-code-label {
  font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 6px;
}
.session-code {
  font-family: var(--mono);
  font-size: 22px;
  letter-spacing: 0.12em;
  margin: 0 0 24px;
}
.linkrow { display: flex; gap: 10px; margin: 18px 0 4px; }
.linkfield {
  flex: 1;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 11px 14px;
  min-width: 0;
}

.pulse {
  margin-top: 40px;
  color: var(--muted);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }

/* SAS — the signature element */
.sas {
  font-family: var(--mono);
  font-size: clamp(40px, 9vw, 56px);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  text-align: center;
  color: var(--ink);
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 34px 0;
  margin: 34px 0 26px;
}

/* Live session */
.session-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--muted);
}
.session-bar #btn-end { margin-left: auto; }
.livedot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}

.warn {
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  padding: 12px 16px;
  margin: 16px 0 4px;
}

.field { padding: 22px 0; border-bottom: 1px solid var(--border); }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.field input[type="text"], .field input[type="password"], .field textarea {
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 11px 14px;
}
.field input:focus-visible, .field textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.field textarea { resize: vertical; min-height: 74px; }

.fieldrow { display: flex; gap: 10px; align-items: center; }
.value {
  flex: 1;
  font-family: var(--mono);
  font-size: 16px;
  min-height: 24px;
  overflow-wrap: anywhere;
  color: var(--ink);
}
.value.masked { letter-spacing: 0.18em; color: var(--muted); }
.value.empty { color: var(--border); }

/* Self-hosted variable font (S2) — no third-party requests on this page. */
@font-face {
  font-family: "Manrope";
  src: url("/manrope-var.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

.gap-left { margin-left: 10px; }

/* S9: security-abort treatment for the ended view. */
.view.danger .eyebrow,
.view.danger h2 { color: var(--danger); }
.view.danger .lede {
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: 6px;
  padding: 14px 16px;
}
