:root {
  color-scheme: light;
  --ink: #17233d;
  --muted: #667089;
  --line: #dfe4ee;
  --soft: #f4f6fa;
  --panel: #ffffff;
  --navy: #101a33;
  --blue: #2458e6;
  --aqua: #56d8d3;
  --green: #18784f;
  --danger: #b42318;
  --shadow: 0 20px 60px rgba(23, 35, 61, .12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-height: 100vh; min-height: 100dvh; margin: 0; color: var(--ink); background: radial-gradient(circle at 15% 5%, #dffbf9, transparent 35%), var(--soft); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.topbar { height: 72px; padding: env(safe-area-inset-top) max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left)); background: var(--navy); color: white; display: flex; align-items: center; gap: 16px; }
.brand { color: white; text-decoration: none; font-size: 23px; letter-spacing: -.06em; }
.brand b { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-left: 2px; border-radius: 50%; color: var(--navy); background: var(--aqua); }
.topbar-copy { display: grid; min-width: 0; gap: 2px; }
.topbar-copy small { max-width: 42vw; overflow: hidden; color: #aeb9d2; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.manage-link { margin-left: auto; color: #d8def0; font-size: 13px; font-weight: 700; text-decoration: none; }
main { width: min(100%, 620px); margin: 0 auto; padding: 32px 18px max(44px, env(safe-area-inset-bottom)); }
.card { padding: clamp(24px, 6vw, 38px); border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: var(--shadow); }
.card-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.state-card { text-align: center; }
.state-card > p:not(.eyebrow, .owner, .result-message) { color: var(--muted); line-height: 1.55; }
h1, p { margin-top: 0; }
h1 { margin-bottom: 24px; font-size: clamp(30px, 8vw, 46px); line-height: 1.02; letter-spacing: -.05em; }
.eyebrow { margin-bottom: 9px; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
label { display: grid; gap: 7px; margin-bottom: 17px; font-size: 13px; font-weight: 750; }
label small, .hint { color: var(--muted); font-weight: 500; }
input { width: 100%; min-width: 0; padding: 13px 14px; border: 1px solid #cbd2df; border-radius: 9px; color: var(--ink); background: white; }
input:focus { border-color: var(--blue); outline: 3px solid rgba(36,88,230,.12); }
fieldset { margin: 4px 0 18px; padding: 0; border: 0; }
legend { margin-bottom: 10px; font-size: 13px; font-weight: 750; }
.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { display: flex; align-items: center; gap: 9px; min-height: 46px; margin: 0; padding: 0 13px; border: 1px solid var(--line); border-radius: 9px; font-weight: 650; }
.choice:has(input:checked) { border-color: var(--blue); background: #f2f5ff; }
.choice input { width: auto; margin: 0; }
.code-preview { display: flex; align-items: center; overflow: hidden; border: 1px solid #cbd2df; border-radius: 9px; }
.code-preview:focus-within { border-color: var(--blue); outline: 3px solid rgba(36,88,230,.12); }
.code-preview span { padding-left: 13px; color: var(--muted); white-space: nowrap; }
.code-preview input { border: 0; outline: 0; }
.hint { display: block; margin: -9px 0 18px; font-size: 12px; }
.button, .quiet { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 18px; border-radius: 9px; cursor: pointer; font-weight: 750; text-decoration: none; }
.button { border: 1px solid var(--blue); background: var(--blue); color: white; box-shadow: 0 8px 20px rgba(36,88,230,.20); }
.quiet { border: 1px solid var(--line); background: white; color: var(--ink); }
.button:disabled, .quiet:disabled { cursor: wait; opacity: .6; }
.full-width { width: 100%; }
.message { min-height: 21px; margin: 2px 0 10px; color: var(--danger); font-size: 13px; }
.shared-badge { flex: 0 0 auto; padding: 6px 9px; border-radius: 99px; background: #eaf8f2; color: var(--green); font-size: 11px; font-weight: 800; }
.spinner { display: inline-block; width: 28px; height: 28px; margin-bottom: 14px; border: 3px solid var(--line); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
.success-mark { display: inline-grid; width: 58px; height: 58px; margin-bottom: 18px; place-items: center; border-radius: 50%; background: #eaf8f2; color: var(--green); font-size: 30px; font-weight: 900; }
.owner, .result-message { color: var(--muted); font-size: 13px; }
.created-link { display: block; margin: 20px 0; padding: 15px; overflow-wrap: anywhere; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); color: var(--blue); font-weight: 800; text-decoration: none; }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.result-actions .quiet { grid-column: 1 / -1; }
.install-card { display: flex; align-items: center; gap: 18px; margin-top: 16px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.86); }
.install-card div { min-width: 0; }
.install-card strong { display: block; margin-bottom: 4px; }
.install-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.install-card button { flex: 0 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 430px) {
  .topbar-copy strong { font-size: 14px; }
  .topbar-copy small { display: none; }
  .manage-link { font-size: 12px; }
  .card-heading { display: block; }
  .shared-badge { display: inline-flex; margin: -12px 0 20px; }
  .install-card { align-items: stretch; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
