/* The connect pages' one stylesheet, served at /app.css (CSP style-src 'self': no inline styles anywhere).
   Steel and brass: a safe-deposit room, not a web app. System fonts only; nothing is fetched from elsewhere. */
:root {
	--page: #e8ecf1;
	--panel: #ffffff;
	--sunk: #f3f5f8;
	--ink: #142030;
	--muted: #556378;
	--line: #d2d9e3;
	--steel: #23476a;
	--steel-ink: #ffffff;
	--brass: #9a6c16;
	--brass-line: #c9a24e;
	--brass-soft: #f6eedb;
	--ok: #24684a;
	--ok-soft: #e3f1ea;
	--danger: #a2321f;
	--danger-soft: #fbe9e5;
	--focus: #c08a1e;
	--shadow: 0 1px 2px rgba(20, 32, 48, 0.06), 0 8px 28px rgba(20, 32, 48, 0.08);
	--mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
	--sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
	:root {
		--page: #0b1017;
		--panel: #131a24;
		--sunk: #0f151d;
		--ink: #e3e9f1;
		--muted: #93a1b4;
		--line: #253042;
		--steel: #8fb7dc;
		--steel-ink: #0b1017;
		--brass: #dcb366;
		--brass-line: #b38c3f;
		--brass-soft: #2a2316;
		--ok: #7fcaa4;
		--ok-soft: #13271e;
		--danger: #f29482;
		--danger-soft: #2c1714;
		--focus: #e2b766;
		--shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.35);
	}
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	min-height: 100vh;
	background: var(--page);
	color: var(--ink);
	font: 16px/1.55 var(--sans);
	-webkit-font-smoothing: antialiased;
}
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
a { color: var(--steel); text-underline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only {
	position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
	clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* frame */
.top {
	display: flex; align-items: center; justify-content: space-between; gap: 1rem;
	max-width: 62rem; margin: 0 auto; padding: 1.1rem 1rem 0.4rem;
}
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; }
.brand svg { flex: none; }
.brand b { display: block; font-size: 1rem; letter-spacing: 0.01em; line-height: 1.1; }
.brand small { display: block; color: var(--muted); font-size: 0.78rem; line-height: 1.1; }
.secure-tag {
	display: inline-flex; align-items: center; gap: 0.4rem;
	font-size: 0.8rem; color: var(--muted); white-space: nowrap;
}
.secure-tag svg { color: var(--ok); }
main { max-width: 62rem; margin: 0 auto; padding: 0.75rem 1rem 2.5rem; }
.foot { max-width: 62rem; margin: 0 auto; padding: 0 1rem 2.5rem; color: var(--muted); font-size: 0.88rem; }
.domain {
	font-family: var(--mono); font-size: 0.9em; font-weight: 600; color: var(--ink);
	background: var(--sunk); border: 1px solid var(--line); border-radius: 6px;
	padding: 0.08rem 0.4rem; display: inline-block; max-width: 100%; white-space: nowrap; overflow-x: auto; vertical-align: bottom; line-height: 1.35;
}
@media (max-width: 30rem) { .fact .domain { font-size: 0.8em; }
}

/* the opening (page.ts request): the twin's face, whom it was made for, what it asks for, the promise */
.brand .ai { color: var(--steel); }
.hero { display: flex; align-items: center; gap: 1.1rem; margin: 0.5rem 0 1.4rem; }
.request { display: flex; align-items: flex-start; gap: 1rem; margin: 0.5rem 0 1.4rem; }
.face {
	flex: none; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
	background: var(--sunk); border: 1px solid var(--line); color: var(--steel); font-size: 1.5rem; font-weight: 700;
}
.who { margin: 0 0 0.25rem; color: var(--muted); font-size: 0.92rem; font-weight: 600; }
.promise { display: flex; gap: 0.5rem; align-items: flex-start; margin: 0.6rem 0 0; font-size: 0.95rem; }
.promise svg { flex: none; margin-top: 0.2rem; color: var(--ok); }
.eyebrow { margin: 0 0 0.2rem; color: var(--muted); font-size: 0.86rem; font-weight: 600; letter-spacing: 0.02em; }
h1 { font-size: clamp(1.45rem, 1.1rem + 1.6vw, 2.05rem); line-height: 1.18; letter-spacing: -0.015em; margin: 0; font-weight: 700; }
h1 em { font-style: normal; color: var(--steel); }
.timer-line { margin: 0.35rem 0 0; font-size: 0.92rem; color: var(--muted); }
.clock { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); }
.clock.low { color: var(--danger); }

/* two columns on a laptop, one on a phone */
.grid { display: grid; gap: 1rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 52rem) {
	.grid { grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: 1.25rem; }
	.grid .form-card { order: 2; }
}
.card {
	background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
	box-shadow: var(--shadow); padding: 1.35rem;
}
@media (max-width: 30rem) { .card { padding: 1.1rem; border-radius: 12px; } }
.stack { display: grid; gap: 1rem; max-width: 40rem; }
.details ul { list-style: none; margin: 0; padding: 0; }
.details li { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.55rem 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.details li:first-child { border-top: 0; padding-top: 0; }
.details li:last-child { padding-bottom: 0; }
.details li > svg { flex: none; margin-top: 0.2rem; color: var(--steel); }
.details .check, .verify.ok > svg { color: var(--ok); }
.details .check { margin-left: auto; }
.card h2 { font-size: 1.05rem; margin: 0 0 0.9rem; letter-spacing: -0.005em; }

/* the trust panel: a slip of facts */
.facts { margin: 0; }
.fact { position: relative; padding: 0.8rem 0 0.8rem 2.2rem; border-top: 1px solid var(--line); }
.fact:first-child { border-top: 0; padding-top: 0; }
.fact dt svg { position: absolute; left: 0; top: 0.95rem; color: var(--steel); }
.fact:first-child dt svg { top: 0.15rem; }
.fact.never svg { color: var(--danger); }
.fact dt { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.fact dd { margin: 0.1rem 0 0; overflow-wrap: anywhere; }
.fact ul { margin: 0.2rem 0 0; padding-left: 1.05rem; }
.fact li + li { margin-top: 0.2rem; }
.meeting { font-family: var(--mono); font-size: 0.92em; white-space: nowrap; }

/* the form */
.form-card { position: relative; }
.field { margin-top: 1.1rem; }
.field:first-of-type { margin-top: 0; }
label { display: block; font-weight: 650; font-size: 0.97rem; margin-bottom: 0.35rem; }
label .opt { font-weight: 400; color: var(--muted); }
.hint { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.86rem; }
.control { position: relative; display: flex; }
input[type="email"], input[type="text"], input[type="password"] {
	width: 100%; min-height: 3rem; font: inherit; font-size: 1rem; color: var(--ink);
	padding: 0.7rem 0.85rem; border: 1px solid var(--line); border-radius: 10px; background: var(--sunk);
	transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
input:hover { border-color: var(--muted); }
input:focus { outline: none; border-color: var(--focus); background: var(--panel); box-shadow: 0 0 0 3px var(--brass-soft); }
input[aria-invalid="true"] { border-color: var(--danger); }
input.secret { font-family: var(--mono); letter-spacing: 0.02em; }
input.masked { -webkit-text-security: disc; }
/* a browser that cannot mask text shows these secrets as typed: no show/hide button that would do nothing */
@supports not (-webkit-text-security: disc) { .maskable ~ .reveal { display: none; } .control input.maskable { padding-right: 0.85rem; } }
.control input.has-reveal { padding-right: 5rem; }
.reveal {
	position: absolute; right: 0.35rem; top: 50%; transform: translateY(-50%);
	min-width: 4.2rem; min-height: 2.4rem; padding: 0 0.6rem; border: 1px solid var(--line); border-radius: 8px;
	background: var(--panel); color: var(--ink); font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.reveal:hover { border-color: var(--muted); }
.field-error { margin: 0.4rem 0 0; color: var(--danger); font-size: 0.88rem; font-weight: 600; }
.problem {
	display: flex; gap: 0.6rem; align-items: flex-start;
	margin: 0 0 1.1rem; padding: 0.8rem 0.9rem; border-radius: 10px;
	background: var(--danger-soft); color: var(--danger); font-weight: 600; font-size: 0.95rem;
}
.problem svg { flex: none; margin-top: 0.15rem; }
.submit {
	display: flex; align-items: center; justify-content: center; gap: 0.55rem;
	width: 100%; min-height: 3.25rem; margin-top: 1.5rem; padding: 0.75rem 1rem;
	border: 0; border-radius: 11px; background: var(--steel); color: var(--steel-ink);
	font: inherit; font-weight: 700; font-size: 1.02rem; cursor: pointer;
	transition: filter 0.15s, transform 0.05s;
}
.submit:hover { filter: brightness(1.08); }
.submit:active { transform: translateY(1px); }
.submit:disabled { cursor: default; filter: saturate(0.4) opacity(0.6); }
.submit.danger { background: var(--danger); color: #fff; }
@media (prefers-color-scheme: dark) { .submit.danger { color: var(--steel-ink); } }
.assure { display: flex; align-items: center; justify-content: center; gap: 0.4rem; margin: 0.6rem 0 0; color: var(--muted); font-size: 0.85rem; }
.assure svg { color: var(--ok); }

/* "How this is protected" */
details.how { margin-top: 1.2rem; border-top: 1px solid var(--line); padding-top: 0.9rem; }
details.how summary {
	cursor: pointer; font-weight: 650; font-size: 0.93rem; color: var(--steel);
	min-height: 2.75rem; display: flex; align-items: center; gap: 0.4rem; list-style: none;
}
details.how summary::-webkit-details-marker { display: none; }
details.how summary::before { content: "+"; font-family: var(--mono); width: 1rem; }
details.how[open] summary::before { content: "\2212"; }
details.how ul { margin: 0.2rem 0 0; padding: 0; list-style: none; }
details.how li { display: grid; grid-template-columns: 1.5rem 1fr; gap: 0.5rem; padding: 0.45rem 0; font-size: 0.92rem; }
details.how li svg { margin-top: 0.15rem; color: var(--brass); }
details.how b { display: block; }

/* the state machine, drawn: ready, sealing, sending, expired (data-state on the form card) */
.status {
	position: absolute; inset: 0; z-index: 2; display: none;
	flex-direction: column; align-items: center; justify-content: center; gap: 0.9rem; text-align: center;
	padding: 1.5rem; border-radius: inherit; background: var(--panel); background: color-mix(in srgb, var(--panel) 94%, transparent);
}
.status p { margin: 0; font-weight: 650; font-size: 1.05rem; }
.status small { color: var(--muted); font-size: 0.88rem; max-width: 22rem; }
.status .say-sending { display: none; }
[data-state="sealing"] .status, [data-state="sending"] .status { display: flex; }
[data-state="sending"] .status .say-sealing { display: none; }
[data-state="sending"] .status .say-sending { display: block; }
[data-state="sealing"] .fields, [data-state="sending"] .fields { filter: blur(2px); }
[data-state="expired"] .fields { opacity: 0.45; }

.lock { width: 64px; height: 64px; }
.lock .body { fill: var(--brass-soft); stroke: var(--brass); }
.lock .shackle { stroke: var(--brass); transform-origin: 32px 30px; }
.lock .bits { fill: var(--brass); }
[data-state="sealing"] .lock .shackle { animation: close 0.6s cubic-bezier(0.5, 0, 0.3, 1.4) forwards; }
[data-state="sealing"] .lock .bits rect { animation: scramble 0.5s steps(2) infinite; }
[data-state="sealing"] .lock .bits rect:nth-child(2) { animation-delay: 0.12s; }
[data-state="sealing"] .lock .bits rect:nth-child(3) { animation-delay: 0.25s; }
[data-state="sending"] .lock .shackle { transform: translateY(5px); }
[data-state="sending"] .lock { animation: lift 0.9s ease-in-out infinite alternate; }
@keyframes close { from { transform: translateY(0); } to { transform: translateY(5px); } }
@keyframes scramble { 0% { opacity: 1; } 50% { opacity: 0.25; } }
@keyframes lift { from { transform: translateY(0); } to { transform: translateY(-4px); } }

/* result pages: saved, removal requested, problems */
.result { max-width: 36rem; margin: 1.5rem auto 0; text-align: left; }
.result .badge { display: flex; margin-bottom: 1rem; }
.result h1 { margin-bottom: 0.6rem; }
.result .lead { font-size: 1.05rem; margin: 0 0 1rem; }
.result p { margin: 0 0 0.9rem; }
.badge svg { width: 72px; height: 72px; }
.badge .disc { fill: var(--ok-soft); stroke: var(--ok); }
.badge .mark { stroke: var(--ok); }
.badge.bad .disc { fill: var(--danger-soft); stroke: var(--danger); }
.badge.bad .mark { stroke: var(--danger); }
.badge.info .disc { fill: var(--brass-soft); stroke: var(--brass); }
.badge.info .mark { stroke: var(--brass); }
.badge svg { animation: stamp 0.45s cubic-bezier(0.3, 0.7, 0.4, 1.3) both; }
@keyframes stamp { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.next { list-style: none; counter-reset: step; margin: 0 0 1.2rem; padding: 0; }
.next li { counter-increment: step; display: grid; grid-template-columns: 2rem 1fr; gap: 0.6rem; padding: 0.55rem 0; border-top: 1px solid var(--line); }
.next li:first-child { border-top: 0; }
.next li::before {
	content: counter(step); display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%;
	background: var(--sunk); border: 1px solid var(--line); font: 700 0.82rem var(--mono); color: var(--muted);
}
.aside { margin: 1.3rem 0 1rem; padding: 1rem 1.1rem; border: 1px dashed var(--line); border-radius: 12px; background: var(--sunk); }
.aside h2 { font-size: 0.98rem; margin: 0 0 0.35rem; }
.aside p { font-size: 0.92rem; color: var(--muted); margin: 0 0 0.8rem; }
.button-secondary {
	display: inline-flex; align-items: center; min-height: 2.9rem; padding: 0.55rem 1rem; border-radius: 10px;
	border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-weight: 650; text-decoration: none;
}
.button-secondary:hover { border-color: var(--muted); }
.small { font-size: 0.88rem; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; }
	[data-state="sealing"] .lock .shackle { transform: translateY(5px); }
}

/* --- the claim pages (pairpage.ts): a new AI employee's identity card, the ring countdown, one action ------------- */
.ringclock { position: relative; flex: none; width: 84px; height: 84px; }
.ringclock svg { display: block; width: 84px; height: 84px; }
.ringclock .track { stroke: var(--line); }
.ringclock .ring { stroke: var(--brass-line); transition: stroke-dashoffset 1s linear; }
.ringclock.low .ring { stroke: var(--danger); }
.ring-time {
	position: absolute; inset: 0; display: grid; place-items: center;
	font: 700 1.02rem var(--mono); font-variant-numeric: tabular-nums; color: var(--ink); letter-spacing: -0.02em;
}
.ringclock.low .ring-time { color: var(--danger); }

.who { display: flex; align-items: center; gap: 0.95rem; padding-bottom: 1.1rem; margin-bottom: 1.1rem; border-bottom: 1px solid var(--line); }
.avatar {
	flex: none; width: 72px; height: 72px; border-radius: 50%; object-fit: cover;
	box-shadow: 0 0 0 3px var(--panel), 0 0 0 4px var(--brass-line);
}
.avatar.initials {
	display: grid; place-items: center; background: var(--steel); color: var(--steel-ink);
	font-size: 1.9rem; font-weight: 700; letter-spacing: -0.02em;
}
.who-text { min-width: 0; }
.who p.who-name, .who p.who-role { margin: 0; }
.who-name { margin: 0; font-size: 1.3rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.who p.who-role { margin-top: 0.1rem; color: var(--muted); font-weight: 600; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.55rem 0 0; padding: 0; }
.chips li {
	font-size: 0.8rem; font-weight: 600; color: var(--ink); line-height: 1.2;
	padding: 0.28rem 0.6rem; border-radius: 999px; background: var(--sunk); border: 1px solid var(--line);
}
.chips li:last-child { background: var(--brass-soft); border-color: var(--brass-line); }
.who.compact { margin: 0.2rem 0 1rem; padding: 0.8rem 0.9rem; border: 1px solid var(--line); border-radius: 12px; background: var(--sunk); }
.who.compact .avatar { width: 52px; height: 52px; }
.who.compact .avatar.initials { font-size: 1.4rem; }
.who.compact .who-name { font-size: 1.08rem; }

.claim-card h2.claim-title { font-size: 1.08rem; margin: 0 0 0.9rem; }
.addr { font-weight: 700; color: var(--steel); overflow-wrap: anywhere; }
.claim-card form + .small { margin-top: 0.85rem; }
.center { text-align: center; }
.or { display: flex; align-items: center; gap: 0.75rem; margin: 1.25rem 0 1rem; color: var(--muted); font-size: 0.85rem; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.google { display: flex; justify-content: center; min-height: 44px; }
.expired-note {
	margin: 1rem 0 0; padding: 0.8rem 0.9rem; border-radius: 10px;
	background: var(--brass-soft); color: var(--ink); font-weight: 600; font-size: 0.95rem;
}
[data-state="expired"] form, [data-state="expired"] .google, [data-state="expired"] .or { opacity: 0.45; }

.next-step {
	display: flex; gap: 0.6rem; align-items: flex-start; margin: 0.4rem 0 0; padding: 0.85rem 1rem;
	border-radius: 10px; background: var(--sunk); border: 1px solid var(--line); font-weight: 650;
}
.next-step svg { flex: none; margin-top: 0.25rem; color: var(--steel); }
.resend { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.1rem; }
.resend .button-secondary { font: inherit; font-weight: 650; cursor: pointer; }
.resend .button-secondary:disabled { cursor: default; color: var(--muted); }
.link { display: inline-flex; align-items: center; min-height: 2.75rem; font-weight: 650; }

/* The connections page (accountspage.ts) */
.accounts { list-style: none; margin: 0 0 1rem; padding: 0; }
.accounts li { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; padding: 0.65rem 0; border-top: 1px solid var(--line); }
.accounts li:first-child { border-top: 0; }
.accounts li div { display: flex; flex-direction: column; gap: 0.15rem; }

/* The security page (securitypage.ts) */
.security h2 { display: flex; align-items: center; gap: 0.5rem; }
.security h2 svg { flex: none; color: var(--brass); }
.claims { list-style: none; margin: 0; padding: 0; }
.claims li { padding: 0.55rem 0; border-top: 1px solid var(--line); font-size: 0.95rem; overflow-wrap: anywhere; }
.claims li:first-child { border-top: 0; padding-top: 0; }
