:root {
  color-scheme: dark;
  --text: #f7fbff;
  --muted: #afc0dc;
  --line: rgba(135, 184, 255, .22);
  --panel: rgba(13, 30, 62, .88);
  --accent: #38c8ef;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 16px/1.65 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at 12% 8%, rgba(25, 156, 255, .22), transparent 30rem),
    radial-gradient(circle at 88% 92%, rgba(131, 41, 255, .2), transparent 28rem),
    linear-gradient(145deg, #061225, #11184a);
}
.wrap { width: min(920px, calc(100% - 48px)); margin-inline: auto; }
a { color: var(--accent); text-underline-offset: 5px; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }
.skip { position: absolute; top: -80px; left: 24px; padding: 12px; background: #061225; }
.skip:focus { top: 12px; }
header { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding-block: 28px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 20px; font-weight: 750; letter-spacing: -.5px; text-decoration: none; }
.brand img { width: 42px; height: 42px; object-fit: contain; }
.pilot-label { color: var(--muted); font-size: 12px; }
.intro { max-width: 790px; padding-block: 50px 36px; }
.eyebrow { color: var(--accent); font-size: 11px; font-weight: 750; letter-spacing: 1.6px; text-transform: uppercase; margin: 0 0 18px; }
h1 { font-size: clamp(36px, 4.4vw, 54px); font-weight: 730; letter-spacing: -1.8px; line-height: 1.12; margin: 0 0 23px; }
.lead { max-width: 680px; color: var(--muted); font-size: 18px; margin: 0; }
.keep-together { white-space: nowrap; }
.protection { padding: 30px 34px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.protection .eyebrow { margin-bottom: 12px; }
.protection h2 { margin: 0 0 17px; font-size: 30px; line-height: 1.2; letter-spacing: -.7px; }
.protection p { max-width: 710px; margin: 0 0 16px; color: var(--muted); font-size: 15px; }
.protection a { font-size: 13px; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 38px; padding-block: 36px; }
.features h2 { font-size: 16px; letter-spacing: -.2px; margin: 0 0 8px; }
.features p { font-size: 14px; color: var(--muted); margin: 0; }
.join { display: flex; justify-content: space-between; align-items: center; gap: 30px; padding-block: 26px; border-block: 1px solid var(--line); }
.join h2 { font-size: 18px; margin: 0 0 5px; }
.join p { color: var(--muted); font-size: 13px; margin: 0; }
button { border: 1px solid var(--line); border-radius: 12px; padding: 14px 20px; color: var(--text); font: inherit; font-size: 14px; font-weight: 700; background: linear-gradient(110deg, #11bde7, #387bf1 55%, #852ce8); }
button:disabled { background: #243656; color: #b3c1d9; cursor: not-allowed; }
footer { padding-block: 22px 30px; color: var(--muted); font-size: 12px; }
.owner-account { width: 100%; margin-top: 1rem; }
.owner-actions { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.owner-actions h3 { margin: 0; }
#owner-installations { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .7rem; }
#owner-installations li { padding: .9rem 1rem; border: 1px solid rgba(255,255,255,.16); border-radius: .7rem; }
#owner-installations small { display: block; margin-top: .2rem; opacity: .72; }
#installations { padding: 0; }
.installation-details { display: grid; min-width: 0; gap: .15rem; }
.installation-details code, .credential-value { overflow-wrap: anywhere; word-break: break-word; font: 14px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.installation-details small { color: var(--muted); }
.setup-credential { margin-top: 1.25rem; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: rgba(4, 15, 36, .55); }
.setup-credential p { margin: .35rem 0 .65rem; }
.credential-value { display: block; padding: .75rem; border-radius: 8px; color: var(--text); background: #061225; user-select: all; }
.credential-actions { display: flex; align-items: center; gap: .8rem; margin-top: .8rem; }
.copy-feedback { color: var(--muted); font-size: 13px; }
.owner-entry-help { color: var(--muted); font-size: 13px; margin: .65rem 0 0; }
.connections-heading { display: flex; align-items: center; justify-content: space-between; gap: 2rem; margin-bottom: 1.4rem; }
.connections-heading h2 { margin-bottom: .2rem; }
.connections-heading p, .empty-state, .connection-message { color: var(--muted); margin: 0; }
.connections h3 { margin: 1.8rem 0 .8rem; font-size: 18px; }
.connection-list { display: grid; gap: .8rem; list-style: none; margin: 0; padding: 0; }
#installations.connection-list li, .history-list li { margin: 0; }
.connection-card { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 12px; background: rgba(4, 15, 36, .42); }
.connection-content { display: grid; min-width: 0; gap: .3rem; }
.connection-content > strong { font-size: 17px; }
.status-badge { justify-self: start; padding: .15rem .55rem; border-radius: 999px; color: var(--muted); background: rgba(175,192,220,.12); font-size: 12px; font-weight: 700; }
.status-connected { color: #9ff3c2; background: rgba(39,174,96,.18); }
.status-issuing, .status-enrollment-ready { color: #a9e9ff; background: rgba(56,200,239,.15); }
.technical-details { margin-top: .25rem; color: var(--muted); font-size: 12px; }
.technical-details summary { cursor: pointer; }
.technical-details code { display: block; max-width: 100%; margin-top: .35rem; overflow-wrap: anywhere; color: var(--muted); }
.past-connections { margin-top: 1.5rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.past-connections > summary { cursor: pointer; color: var(--muted); font-weight: 700; }
.history-list { margin-top: .8rem; }
.history-list .connection-card { opacity: .82; }
@media (max-width: 620px) {
  .wrap { width: calc(100% - 36px); }
  header { padding-block: 20px; }
  .brand { font-size: 18px; }
  .pilot-label { max-width: 95px; text-align: right; font-size: 11px; }
  .intro { padding-block: 28px; }
  h1 { font-size: 38px; letter-spacing: -1.2px; }
  .lead { font-size: 16px; }
  .protection { padding: 25px 22px; }
  .protection h2 { font-size: 27px; }
  .features { grid-template-columns: 1fr; gap: 20px; padding-block: 28px; }
  .join { align-items: flex-start; flex-direction: column; gap: 18px; }
  #installations li, .credential-actions, .connection-card, .connections-heading { align-items: stretch; flex-direction: column; }
}

.connection-rename { justify-self: start; padding: .3rem 0; background: none; border: none; color: var(--accent, #8de2fa); }
.connection-content > strong { overflow-wrap: anywhere; }
#name-dialog { width: min(440px, calc(100vw - 40px)); box-sizing: border-box; padding: 1.5rem; border: 1px solid var(--line); border-radius: 16px; color: var(--text, #eaf2ff); background: #102139; }
#name-dialog::backdrop { background: rgba(0,0,0,.65); }
#name-dialog label { display: block; margin: 1rem 0 .5rem; }
#installation-name { width: 100%; box-sizing: border-box; padding: .8rem; border: 1px solid var(--line); border-radius: 8px; background: #071322; color: #eaf2ff; font: inherit; }
.name-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .8rem; margin-top: 1rem; }
#name-error { color: #ffb8b8; }
