:root {
  color-scheme: dark;
  --bg: #18191b;
  --panel: #202225;
  --line: #35383c;
  --muted: #a2a7ae;
  --blue: #3aa8fc;
  --text: #f2f3f5;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
header, main { width: min(760px, calc(100% - 40px)); margin: auto; }
header { height: 88px; display: flex; align-items: center; }
main { padding: 24px 0 56px; }
a { color: var(--blue); }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
}
.brand img { display: block; margin-right: 3px; }
.muted { color: var(--muted); font-weight: 400; }
h1 { font-size: 28px; line-height: 1.25; font-weight: 650; margin: 0; }
h2 { font-size: 19px; line-height: 1.4; font-weight: 600; margin: 0 0 12px; }
h3 { margin-top: 0; }
p { color: var(--muted); }
.section-heading { margin-bottom: 24px; }
.section-heading h2 { margin: 0; }
.page-heading { margin-bottom: 24px; }
.page-heading p { margin: 10px 0 0; }
.page-heading .button { margin-top: 24px; }
.plans {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  border: 0;
  padding: 0;
  margin: 0;
}
.plan { cursor: pointer; position: relative; min-width: 0; }
.plan input { position: absolute; opacity: 0; }
.plan-body {
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 16px;
  border-radius: 10px;
}
.plan:hover .plan-body { border-color: var(--muted); }
.plan input:checked + .plan-body { border-color: var(--blue); background: #202a33; }
.plan input:focus-visible + .plan-body { outline: 2px solid var(--blue); outline-offset: 3px; }
.plan-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-weight: 600; }
.radio-dot { width: 15px; height: 15px; flex-shrink: 0; border-radius: 50%; border: 1px solid #707781; }
.plan input:checked + .plan-body .radio-dot { border: 4px solid var(--blue); }
.price { font-size: 26px; line-height: 1.3; font-weight: 600; margin: 20px 0 16px; }
.plan-detail { font-size: 12px; color: var(--muted); margin: 2px 0; }
.checkout-panel {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}
.checkout-panel > div:first-child { flex: 1; max-width: 320px; }
.checkout-panel label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
select, input {
  font: inherit;
  background: var(--panel);
  color: var(--text);
  border: 1px solid #4a4e54;
  border-radius: 8px;
  padding: 11px 12px;
  min-width: 0;
}
select { width: 100%; min-height: 44px; }
button, .button {
  font: inherit;
  border: 0;
  border-radius: 8px;
  min-height: 44px;
  padding: 11px 20px;
  background: var(--blue);
  color: #081c2c;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}
button:hover, .button:hover { filter: brightness(1.1); }
button:disabled { cursor: not-allowed; opacity: .5; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
.checkout-action { display: flex; align-items: center; justify-content: flex-end; gap: 20px; }
#quote { font-size: 14px; }
#buy-button { flex-shrink: 0; min-width: 130px; }
.fine-print { font-size: 12px; line-height: 1.6; margin: 12px 0 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 20px; margin: 24px 0; }
.account { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.copy-row { display: flex; gap: 10px; }
.copy-row input { flex: 1; width: 100%; font-family: monospace; font-size: 14px; }
.copy-row button { flex-shrink: 0; }
.setup-platforms { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0 0 20px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.setup-platforms a { padding: 8px 0; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; }
.setup-platforms a:hover { color: var(--text); }
.setup-platforms a[aria-current] { color: var(--blue); border-color: var(--blue); }
#setup-installation { display: grid; }
#setup-installation > [data-setup-platform] { grid-area: 1 / 1; min-width: 0; }
#setup-installation > [inert] { visibility: hidden; }
.setup-steps { padding-left: 22px; margin: 0; }
.setup-steps > li { padding-left: 6px; margin-bottom: 18px; }
.setup-steps > li::marker { color: var(--muted); }
.setup-steps h3 { font: inherit; font-weight: 600; margin: 0; }
.setup-steps p { margin: 6px 0 12px; }
.setup-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.identity-buttons { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.identity-buttons button, .secondary { background: #33373c; color: var(--text); }
.linked { color: #a4dbbd; padding: 10px 0; }
details { margin-top: 20px; }
.account > details:first-child { margin-top: 0; }
summary { cursor: pointer; color: var(--muted); }
summary:hover { color: var(--text); }
details[open] > summary { color: var(--text); }
#restore-form { margin-top: 24px; }
#restore-form label { display: block; margin-bottom: 8px; font-size: 13px; }
.error { color: #ffb6b6; background: #402626; padding: 12px; border-radius: 8px; }
.back { margin-top: 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
[hidden] { display: none !important; }

@media (max-width: 650px) {
  header, main { width: calc(100% - 32px); }
  header { height: 72px; }
  main { padding-top: 16px; }
  h1 { font-size: 25px; }
  .section-heading { margin-bottom: 20px; }
  .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan-body { padding: 14px; }
  .checkout-panel { flex-direction: column; align-items: stretch; gap: 20px; }
  .checkout-panel > div:first-child { max-width: none; }
  .checkout-action { justify-content: space-between; }
  #buy-button { min-width: 150px; }
  .copy-row { flex-direction: column; }
  .copy-row button { align-self: flex-start; }
  .panel { padding: 16px; }
}

.page-tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.page-tabs a { padding: 0 0 12px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; }
.page-tabs a[aria-current] { color: var(--text); border-color: var(--blue); }
.subscription-card { padding: 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.subscription-status { color: #a4dbbd; font-size: 13px; }
.subscription-facts { display: flex; gap: 64px; margin: 24px 0 28px; }
.subscription-facts dt { color: var(--muted); font-size: 13px; }
.subscription-facts dd { margin: 4px 0 0; font-size: 24px; font-weight: 600; }
.subscription-renew { display: inline-block; margin: 0 0 0 20px; font-size: 13px; }
.restore-link { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.account-identities { border-top: 1px solid var(--line); }
.identity-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 86px; border-bottom: 1px solid var(--line); padding: 16px 0; }
.identity-name { display: block; font-size: 16px; font-weight: 600; }
.identity-status { display: block; color: var(--muted); font-size: 12px; }
.identity-status.linked { padding: 0; color: #a4dbbd; }
.identity-check { color: #a4dbbd; padding: 0 16px; }
.identity-row button { font-size: 13px; }
.recovery-key { margin-top: 28px; }
body:has(#setup-dialog[open]) { overflow: hidden; }
#setup-dialog { width: min(720px, calc(100% - 48px)); max-height: calc(100dvh - 64px); padding: 0; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
#setup-dialog[open] { display: flex; flex-direction: column; position: fixed; inset: 0; margin: auto; }
#setup-dialog::backdrop { background: rgb(0 0 0 / 65%); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px 8px; gap: 12px; flex-shrink: 0; }
.dialog-heading h2 { margin: 0; }
.dialog-close { width: 44px; height: 44px; padding: 0; font-size: 26px; font-weight: 400; color: var(--muted); background: transparent; }
.dialog-content { padding: 0 24px; overflow-y: auto; overscroll-behavior: contain; }
.dialog-footer { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; flex-shrink: 0; }
.dialog-footer button { min-width: 120px; }
@media (max-width: 650px) {
  .page-tabs { gap: 24px; }
  .subscription-card { padding: 20px; }
  .subscription-facts { gap: 40px; }
  .subscription-renew { display: block; margin: 16px 0 0; }
  .identity-row { gap: 8px; }
  #setup-dialog { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
  .dialog-heading { padding: max(12px, env(safe-area-inset-top)) 16px 8px; }
  .dialog-content { padding: 0 16px; flex: 1; }
  .dialog-footer { padding: 12px 16px max(12px, env(safe-area-inset-bottom)); }
  .dialog-footer button { width: 100%; }
}
