:root {
  color-scheme: light dark;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  --bg: #f2f2f7;
  --surface: #fff;
  --ink: #111113;
  --muted: #626b79;
  --blue: #0068df;
  --accent: #07f;
  --red: #c72e2e;
  --subtle: #e5e5ea;
  --line: #c6c6c8;
  --glass: #ffffffdf;
  --ring: #168ad523;
  --glow: #b3e6ffab;
  --aqua: #9cf3ed80;
  --sky: #c9dcffad;
  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #1c1c1e;
    --ink: #fff;
    --muted: #ababaf;
    --blue: #66b3ff;
    --accent: #0a73ea;
    --red: #ff7067;
    --subtle: #2c2c2e;
    --line: #454548;
    --glass: #242426d9;
    --ring: #5cbad12e;
    --glow: #064c72b8;
    --aqua: #055a5c66;
    --sky: #14315e9e;
  }
}
* { box-sizing: border-box; }
body, h1, h2, h3, p { margin: 0; }
body { background: var(--bg); color: var(--ink); font-size: 1.0625rem; letter-spacing: -.015em; }
body:has(dialog[open]) { overflow: hidden; }
button, input { color: inherit; font: inherit; letter-spacing: inherit; }
button {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  border: none; background: none; color: var(--blue); cursor: pointer;
  min-height: 44px; padding: 0; touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
button:active { opacity: .65; }
button:disabled { cursor: auto; opacity: .4; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
[hidden], :empty:is(.error, #notice, .version, small) { display: none; }
svg {
  width: 23px; height: 23px; flex: none; fill: none;
  stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
h1 { font-size: clamp(30px, 8.6vw, 36px); font-weight: 730; line-height: 1.12; letter-spacing: -.045em; }
h2 { font-size: 21px; letter-spacing: -.035em; }
h3 { font-size: 20px; letter-spacing: -.03em; }
p { line-height: 1.42; }
.primary, .secondary, .plain {
  width: 100%; border-radius: 16px; min-height: 53px;
  font-size: 17px; font-weight: 600; padding: 11px 14px;
}
.primary { background: var(--accent); color: white; }
.primary.danger { background: #d6322c; }
.secondary { background: var(--surface); }
.plain { font-size: 16px; font-weight: 510; }
.plain svg { width: 20px; height: 20px; }
.destructive, .error { color: var(--red); }
.icon-button { flex: none; width: 44px; height: 44px; background: var(--surface); border-radius: 50%; }
.loading, .welcome {
  position: relative; min-height: 100vh; min-height: 100svh; overflow: hidden;
  display: flex; align-items: center; flex-direction: column; justify-content: center;
}
.welcome {
  background: radial-gradient(ellipse 92% 50% at 72% 13%, var(--aqua), transparent 84%),
    radial-gradient(ellipse 90% 58% at 12% 18%, var(--sky), transparent 90%), var(--bg);
  padding: calc(32px + var(--top)) 24px calc(18px + var(--bottom)); text-align: center;
}
.welcome-content { margin: auto 0; max-width: 410px; padding: 20px 0 48px; }
.hero {
  position: relative; display: grid; place-items: center; isolation: isolate;
  width: clamp(126px, 21svh, 196px); aspect-ratio: 1; margin: 0 auto clamp(34px, 5vh, 54px);
}
.hero::before, .hero::after {
  content: ""; position: absolute; z-index: -1; border-radius: 50%; border: 1px solid var(--ring);
  mask-image: linear-gradient(black 58%, transparent 94%);
}
.hero::before { inset: -49%; background: radial-gradient(closest-side, var(--glow), transparent); }
.hero::after { inset: -95%; opacity: .8; }
.hero img {
  display: block; width: 100%; height: auto; border-radius: 22%;
  filter: drop-shadow(0 16px 19px #0c799630) drop-shadow(0 4px 5px #0b3b5114);
}
.welcome h1 { font-size: clamp(34px, 10vw, 46px); letter-spacing: -.05em; text-wrap: balance; }
.welcome-content p { margin: 14px auto 0; color: var(--muted); max-width: 345px; text-wrap: balance; }
.welcome-actions { width: min(100%, 370px); padding-bottom: 2vh; }
.welcome-actions button + button { margin-top: 6px; }
.code {
  display: block; margin: 22px 0; font-size: 36px; letter-spacing: .08em;
  color: var(--blue); font-variant-numeric: tabular-nums;
}
.spinner {
  margin: 20px auto; width: 28px; height: 28px; border: 3px solid var(--line);
  border-top-color: var(--blue); border-radius: 50%; animation: spin .85s linear infinite;
}
.refreshing svg { animation: spin .7s ease-out; }
@keyframes spin { to { transform: rotate(360deg); } }

#app:has(> nav) {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
  height: 100dvh;
}
.page {
  width: 100%; max-width: 740px; margin: 0 auto;
  padding: 0 16px 12px;
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
}
.page::-webkit-scrollbar { display: none; }
.page-header {
  display: flex; align-items: center; gap: 6px;
  position: sticky; top: 0; z-index: 4;
  width: 100%; max-width: 740px; margin: 0 auto;
  padding: calc(var(--top) + 8px) 16px 8px;
  background: var(--bg);
}
.page-header h1 { flex: 1; letter-spacing: -.035em; }
.page-header > .icon-button + h1 { margin-inline-start: 8px; }
.page-actions {
  display: flex; align-items: center; gap: 1px; background: var(--surface);
  border-radius: 26px; box-shadow: 0 1px 4px #0000000a;
}
.page-actions .icon-button { background: transparent; position: relative; }
.sync-active svg { width: 16px; height: 16px; }
.sync-active::before {
  content: ''; position: absolute; inset: 7px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, currentColor 24%, transparent);
  border-top-color: currentColor; border-right-color: currentColor;
  animation: spin 1s linear infinite;
}
@media (prefers-reduced-motion: reduce) { .sync-active::before { animation: none; } }
.activity-count {
  position: absolute; right: 0; top: 1px; min-width: 17px; height: 17px;
  background: var(--accent); color: white; border-radius: 10px;
  padding: 1px 4px; font: 650 11px/15px -apple-system, sans-serif;
}
.page-header h1 { min-width: 0; }
.current-mac {
  display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font-size: .8125rem; line-height: 1.3; font-weight: 500; letter-spacing: normal; color: var(--muted);
}
.library { --library-tools-height: 58px; }
.library-tools { padding-block: 4px 10px; }
.collection-tools {
  display: grid; grid-template-columns: minmax(0, 1fr) 44px 44px;
  align-items: center; gap: 4px;
}
@media (min-width: 640px) and (min-height: 520px) {
  .library-tools { position: sticky; top: 0; z-index: 3; background: var(--bg); }
}
.collection-tools .icon-button { width: 44px; height: 44px; position: relative; }
.collection-tools label.icon-button { display: grid; place-items: center; color: var(--blue); }
.collection-tools select { position: absolute; inset: 0; width: 100%; opacity: 0; font-size: 16px; }
.collection-tools label:focus-within { outline: 2px solid var(--blue); }
.collection-tools button[aria-pressed=true] { background: var(--blue); color: white; }
.collection-tools .search { min-width: 0; }
.collection-filters { margin-bottom: 12px; }
.collection-filters .mac-option { min-height: 48px; }
.store-options { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 7px 0 8px; }
.store-regions { display: flex; min-width: 0; gap: 4px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
.store-regions button { flex: none; min-width: 44px; min-height: 44px; }
.store-regions button:focus-visible { outline-offset: -3px; }
.store-regions [aria-pressed=false] { color: var(--muted); text-decoration: line-through; }
.store-regions [aria-pressed=false]::before { background: transparent; }
.update-info { flex: 1; min-width: 0; text-align: start; color: var(--ink); }
.update-row { display: flex; align-items: center; padding: 10px 12px; gap: 8px; }
.update-row + .update-row { border-top: .5px solid var(--line); }
.updates-note { text-align: center; margin: 36px 0; color: var(--muted); }
.update-targets { padding-left: 22px; margin: 14px 0 24px; overflow-wrap: anywhere; }
.update-targets li { margin-bottom: 5px; }
.recent-updates { --recent-height: max(48px, 3.125rem); }
.recent-updates .update-account h3 { margin: 0; padding: 10px 5px; overflow-wrap: anywhere; }
@media (min-width: 640px) and (min-height: 520px) {
  .recent-updates > h2 {
    position: sticky; background: var(--bg); top: var(--library-tools-height, 0px); z-index: 2;
  }
  .recent-updates .update-account h3 {
    position: sticky; background: var(--bg); top: calc(var(--library-tools-height, 0px) + var(--recent-height)); z-index: 1;
  }
}
.update-disclosure {
  width: 100%; min-height: var(--recent-height); padding-inline: 4px; gap: 7px;
  color: var(--ink); text-align: start; font-size: 1.0625rem; line-height: 1.2; font-weight: 600;
}
.update-disclosure svg { width: 14px; height: 14px; stroke-width: 2.8; color: var(--muted); }
.update-disclosure[aria-expanded=true] svg { transform: rotate(90deg); }
.update-disclosure span {
  display: flex; flex: 1; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 2px 10px; overflow-wrap: anywhere;
}
.update-disclosure small { font-size: .875rem; font-weight: 400; color: var(--muted); letter-spacing: normal; }
.install-copy { padding-inline: 4px; font-weight: 560; }
.ota-controls { display: grid; justify-items: end; max-width: 48%; text-align: right; }
.ota-controls a { color: var(--blue); text-decoration: none; min-height: 44px; display: flex; align-items: center; }
.ota-controls a:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 5px; }
.ota-controls small { color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
.ota-fallback { font-size: .875rem; text-align: right; padding-inline: 4px; }
.ota-link { min-width: 0; width: 100%; font-size: 16px; }
.copy-row .summary small { white-space: normal; overflow-wrap: anywhere; }
.link-form input { font-size: 16px; }
.loading img { border-radius: 22%; }
.page-header .icon-button { width: 44px; height: 44px; }
.offline {
  font-size: 14px; color: var(--muted); margin-bottom: 16px;
  background: var(--surface); padding: 12px 15px; border-radius: 12px;
}
.search, .link-form input {
  display: flex; align-items: center; background: var(--subtle); border: none;
  color: var(--muted); border-radius: 13px; padding: 0 12px; min-height: 44px; gap: 6px;
}
.search:focus-within { outline: 2px solid var(--blue); outline-offset: -2px; }
.search svg { width: 19px; height: 19px; stroke-width: 2.3; }
.search input {
  flex: 1; min-width: 0; padding: 0; border: 0; height: 44px;
  font-size: 16px; color: var(--ink); background: none; outline: none;
}
input::placeholder { color: var(--muted); opacity: 1; }
.filters {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); position: relative;
  margin: 8px 0 12px; isolation: isolate;
}
.filters::before, .filters button::before {
  content: ""; position: absolute; inset: 4px 0; background: var(--subtle); border-radius: 18px; z-index: -1;
}
.filters button {
  position: relative; font-size: .875rem; font-weight: 550; color: var(--ink);
  min-height: 44px; padding: 8px 4px; overflow-wrap: anywhere;
}
.filters button::before { background: transparent; inset: 7px 3px; }
.filters [aria-pressed="true"]::before { background: var(--segment); box-shadow: 0 1px 4px #0002; }
.filters [aria-pressed="true"] { font-weight: 650; }
.list, .group { border-radius: 18px; background: var(--surface); overflow: hidden; }
.app-row, .download, .copy-row, .metadata {
  position: relative; display: flex; align-items: center; text-align: left; gap: 12px;
  padding: 10px 13px; color: var(--ink); width: 100%;
}
.app-row + .app-row::before, .download + .download::before, .group > * + *::before {
  content: ""; position: absolute; left: 73px; top: 0; right: 0; height: 1px;
  transform: scaleY(.5); background: var(--line);
}
.app-row > svg { width: 14px; height: 14px; stroke-width: 2.6; color: var(--muted); opacity: .7; }
.artwork {
  flex: none; position: relative; overflow: hidden; display: grid; place-items: center;
  width: 48px; height: 48px; border-radius: 23%; font-size: 23px; font-weight: 600;
  background: linear-gradient(135deg, #2486e7, #14b1bf); color: #fff;
}
.artwork img, .artwork canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.artwork::after { content: ""; position: absolute; inset: 0; border: 1px solid #82899522; border-radius: inherit; }
.summary { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.summary strong, .summary small, .version { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.summary strong { font-weight: 550; font-size: 1.0625rem; line-height: 1.22; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.summary small, .version { font-size: .875rem; color: var(--muted); }
.summary .error { color: var(--red); }
.version { max-width: 28%; text-align: right; }
.version svg { color: var(--blue); display: block; width: 17px; height: 17px; margin: 4px 0 0 auto; }
.download .icon-button, .sheet-header .icon-button { background: var(--subtle); }
.download .icon-button svg { stroke-width: 2.8; width: 19px; }
progress { width: 100%; height: 5px; accent-color: var(--accent); margin: 4px 0; border: none; }
progress::-webkit-progress-bar { background: var(--subtle); border-radius: 8px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 8px; }
.empty {
  background: var(--bg); text-align: center; min-height: 44vh;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
}
.empty svg { color: var(--muted); width: 42px; height: 42px; margin: 16px; }
.empty p { max-width: 300px; color: var(--muted); font-size: 15px; margin-top: 8px; }
nav {
  position: relative; z-index: 2; margin: 6px auto max(10px, var(--bottom));
  display: flex; width: min(520px, calc(100% - 24px)); border-radius: 38px; padding: 5px;
  background: var(--glass); border: .5px solid #8e9db042; box-shadow: 0 4px 20px #1526401a;
  -webkit-backdrop-filter: blur(22px) saturate(170%); backdrop-filter: blur(22px) saturate(170%);
}
nav button {
  flex: 1; min-width: 0; font-weight: 540; gap: 3px; flex-direction: column;
  color: var(--muted); font-size: clamp(10px, 2.75vw, 12px); min-height: 52px; border-radius: 30px;
}
nav button[aria-current] { color: var(--blue); background: #0789fa17; }
nav svg { stroke-width: 2; }
dialog {
  width: min(100%, 520px); max-width: 100%; max-height: 90vh; max-height: 90dvh;
  margin: auto auto 0; background: var(--bg); color: var(--ink); padding: 0 20px calc(24px + var(--bottom));
  border: 0; border-radius: 28px 28px 0 0; overscroll-behavior: contain;
}
dialog::backdrop { background: #05111e68; }
dialog .primary + .plain,
dialog :is(.secondary, .plain) + .sheet-dismiss {
  margin-block-start: 12px;
}
.sheet-header {
  position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; gap: 8px; background: var(--bg); z-index: 1;
}
.sheet-header .icon-button { width: 44px; height: 44px; }
.sheet-header .icon-button svg { width: 19px; color: var(--muted); stroke-width: 2.6; }
.sheet-header h2 { flex: 1; }
.help-row { display: flex; align-items: flex-start; gap: 14px; line-height: 1.38; margin: 8px 0 20px; font-size: 16px; }
.help-row svg { width: 26px; height: 26px; color: var(--blue); }
.body { margin-bottom: 20px; }
.footnote, .error { font-size: 14px; margin: 16px 0; }
.footnote { color: var(--muted); }
.link-form input { width: 100%; background: var(--surface); min-height: 52px; color: var(--ink); font-size: 16px; }
.link-form .primary { margin-top: 12px; }
video { width: 100%; border-radius: 18px; max-height: 32vh; object-fit: cover; }
.identity { display: flex; gap: 14px; align-items: center; overflow-wrap: anywhere; margin: 8px 0 24px; }
.identity p { font-size: 15px; color: var(--muted); margin-top: 5px; }
.app-identity-text { flex: 1; }
.app-detail-menu { align-self: flex-start; }
.app-detail-menu svg { width: 17px; height: 17px; transform: rotate(90deg); }
.identity .artwork { width: 76px; height: 76px; font-size: 34px; }
.group { margin-bottom: 18px; }
.group > * + *::before { left: 15px; }
.metadata, .copy-row { justify-content: space-between; font-size: 15px; min-height: 50px; }
.metadata span:first-child { color: var(--muted); flex: none; }
.metadata span:last-child { text-align: right; overflow-wrap: anywhere; }
.section-title { font-size: 18px; margin: 24px 0 12px; }
#notice {
  position: fixed; z-index: 5; bottom: calc(var(--bottom) + 96px); left: 50%; transform: translateX(-50%);
  width: max-content; max-width: min(88%, 450px); background: var(--ink); color: var(--bg);
  padding: 12px 18px; font-size: 15px; border-radius: 16px; text-align: center;
}
@media (min-width: 560px) {
  dialog { margin: auto; border-radius: 26px; padding: 0 24px 24px; }

  .welcome-content { margin: 0; padding-bottom: 48px; }
  .welcome-actions { min-height: 130px; }
}
@media (max-width: 355px) {
  .page { padding-left: 12px; padding-right: 12px; }
  .app-row, .download { gap: 8px; padding-left: 12px; padding-right: 12px; }
  .filters button { font-size: .8125rem; }
  .welcome { padding-inline: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .refreshing svg, .spinner { animation: none; }
}

:root {
  --segment: white;
  --left: env(safe-area-inset-left, 0px);
  --right: env(safe-area-inset-right, 0px);
  --foot: calc(92px + var(--bottom));
}
@media (prefers-color-scheme: dark) { :root { --segment: #636366; } }
body { padding-inline: var(--left) var(--right); }
.page-header h1 { overflow-wrap: anywhere; font-size: clamp(1.75rem, 8.5vw, 2.125rem); }
.primary-pane, #inspector, .identity > div { min-width: 0; }
#inspector { display: none; }
.search { border-radius: 22px; }
.search input { appearance: none; font-size: 1.0625rem; }
.app-row { gap: 10px; }
.app-row:active { background: var(--subtle); opacity: 1; }
.app-row > svg { width: 12px; }
.version svg { margin: 0; }
.metadata span:first-child { flex: 0 1 auto; overflow-wrap: anywhere; }
.metadata span:last-child { min-width: 0; }
.section-title { margin: 21px 0 9px 5px; font-size: 1.13rem; }
.sheet-header h2 { font-size: 1.0625rem; text-align: center; padding-left: 52px; }
.sheet-header h2:only-child { padding-left: 0; padding-block: 12px; overflow-wrap: anywhere; }
dialog { max-width: calc(100% - var(--left) - var(--right)); margin-inline: var(--left) var(--right); }
nav { width: min(520px, calc(100% - 20px)); }
nav button { letter-spacing: -.025em; }
nav button span { text-align: center; line-height: 1.1; max-width: 100%; }
nav button:nth-child(3), nav button:nth-child(4) { flex: 1.15; }
@media (max-width: 370px) {
  .page-header { padding-inline: 12px; }
  .page-header h1 { font-size: 1.58rem; }
  nav { width: calc(100% - 10px); }
  nav button { font-size: 9.5px; }
  nav button:nth-child(4) { flex: 1.22; }
}
@media (min-width: 640px) {
  #app:has(#inspector) .page-header { max-width: 1180px; }
}
nav button[aria-current] { background: color-mix(in srgb, var(--ink) 7%, transparent); }
@media (min-width: 560px) {
  dialog { margin-inline: auto; }
  .welcome { min-height: 100dvh; }
}
@media (min-width: 640px) {
  .page:has(#inspector) {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    max-width: 1180px; gap: clamp(16px, 3vw, 36px); align-items: start;
  }
  #inspector {
    display: block; position: sticky; top: 0;
    max-height: calc(100dvh - 60px - var(--top) - var(--foot)); overflow: auto;
    overscroll-behavior: contain; scrollbar-width: thin;
  }
  #inspector h2 { font-size: 1.0625rem; line-height: 44px; text-align: center; }
  #inspector .identity { margin: 12px 0 18px; }
  .library-entry:has(> .app-row[aria-current="true"]) {
    background: color-mix(in srgb, var(--blue) 15%, var(--surface));
  }
  .app-row[aria-current] > svg { color: var(--blue); }
}
/* WebKit already excludes the Duo system strip from the web viewport. */
@media (max-height: 690px) {
  :root { --foot: calc(80px + var(--bottom)); }
  .page-header h1 { font-size: 1.8rem; }
  nav { padding: 4px; margin-bottom: max(7px, var(--bottom)); }
  nav button { min-height: 48px; gap: 2px; }
  nav svg { width: 21px; height: 21px; }
}
@media (max-width: 370px) {
  .page-header h1 { font-size: 1.5rem; }
  .page-header:has(.page-actions > :nth-child(3)) h1 { font-size: clamp(1.25rem, 6.65vw, 1.5rem); }
}
@media (max-height: 500px) {
  .welcome { flex-direction: row; gap: 22px; padding-block: calc(16px + var(--top)) calc(16px + var(--bottom)); }
  .welcome-content { padding: 0; }
  .hero { width: 82px; margin-bottom: 12px; }
  .welcome-content p { font-size: 15px; }
  .welcome h1 { font-size: 26px; }
  .welcome-actions { min-height: 0; }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  nav { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
.store-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; padding-block-start: 4px; }
.store-options select {
  color: var(--blue); background: transparent; border: none; min-height: 44px;
  flex: none; font: inherit; font-size: 1rem; width: fit-content; max-width: calc(100% - 52px);
}
.get-app { position: relative; padding-inline: 12px; isolation: isolate; font-size: .875rem; font-weight: 650; }
.get-app::before { content: ''; position: absolute; z-index: -1; inset: 5px 0; background: var(--subtle); border-radius: 22px; }
.store-note { text-align: center; color: var(--muted); }
.reason { font-size: .8125rem; color: var(--muted); }
#store-results .app-row:focus-visible { outline-offset: -3px; }
#store-results .reason { overflow-wrap: anywhere; }
#store-results .get-app { flex: none; max-width: 42%; overflow-wrap: anywhere; }
.identity + .secondary { margin: 0 0 16px; }
.library-entry { position: relative; display: flex; align-items: center; gap: 6px; padding-right: 12px; }
.library-entry + .library-entry::before {
  content: ""; position: absolute; left: 73px; top: 0; right: 0; height: 1px;
  transform: scaleY(.5); background: var(--line);
}
.library-entry .app-row { flex: 1; min-width: 0; padding-right: 4px; }
.app-action { background: var(--subtle); }
.app-action svg { width: 20px; height: 20px; }
