/* ReReHome marketing site — rerehome.app
   Type: Inter (SIL Open Font License) via Google Fonts. No proprietary fonts. */

:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --bg-elevated: #ffffff;
  --bg-inverse: #000000;
  --fg: #1d1d1f;
  --fg-secondary: #6e6e73;
  --fg-tertiary: #86868b;
  --fg-inverse: #f5f5f7;
  --hairline: rgba(0, 0, 0, 0.12);
  --hairline-strong: rgba(0, 0, 0, 0.2);
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --link: #0066cc;
  --amber: #ff9f0a;
  --nav-bg: rgba(251, 251, 253, 0.8);
  --localnav-bg: rgba(255, 255, 255, 0.72);
  --card: #ffffff;
  --card-shadow: 0 4px 30px rgba(0, 0, 0, 0.06);
  --chip: #e8e8ed;
  --chip-fg: #1d1d1f;
  --chip-active: #1d1d1f;
  --chip-active-fg: #ffffff;
  --placeholder-a: #e8eef9;
  --placeholder-b: #f4e9f7;
  --placeholder-fg: #6e6e73;
  --hero-glow: radial-gradient(60% 50% at 50% 0%, rgba(255, 175, 64, 0.22), transparent 70%);
  --gradient-text: linear-gradient(90deg, #ff9f0a 0%, #ff6b3d 45%, #bf5af2 100%);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --bg-alt: #101012;
    --bg-elevated: #1c1c1e;
    --bg-inverse: #f5f5f7;
    --fg: #f5f5f7;
    --fg-secondary: #a1a1a6;
    --fg-tertiary: #86868b;
    --fg-inverse: #1d1d1f;
    --hairline: rgba(255, 255, 255, 0.14);
    --hairline-strong: rgba(255, 255, 255, 0.24);
    --accent: #0a84ff;
    --accent-hover: #409cff;
    --link: #2997ff;
    --nav-bg: rgba(22, 22, 23, 0.8);
    --localnav-bg: rgba(22, 22, 23, 0.72);
    --card: #1c1c1e;
    --card-shadow: none;
    --chip: #2c2c2e;
    --chip-fg: #f5f5f7;
    --chip-active: #f5f5f7;
    --chip-active-fg: #1d1d1f;
    --placeholder-a: #1a2233;
    --placeholder-b: #2a1d2e;
    --placeholder-fg: #a1a1a6;
    --hero-glow: radial-gradient(60% 50% at 50% 0%, rgba(255, 159, 10, 0.18), transparent 70%);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #000000;
  --bg-alt: #101012;
  --bg-elevated: #1c1c1e;
  --bg-inverse: #f5f5f7;
  --fg: #f5f5f7;
  --fg-secondary: #a1a1a6;
  --fg-tertiary: #86868b;
  --fg-inverse: #1d1d1f;
  --hairline: rgba(255, 255, 255, 0.14);
  --hairline-strong: rgba(255, 255, 255, 0.24);
  --accent: #0a84ff;
  --accent-hover: #409cff;
  --link: #2997ff;
  --nav-bg: rgba(22, 22, 23, 0.8);
  --localnav-bg: rgba(22, 22, 23, 0.72);
  --card: #1c1c1e;
  --card-shadow: none;
  --chip: #2c2c2e;
  --chip-fg: #f5f5f7;
  --chip-active: #f5f5f7;
  --chip-active-fg: #1d1d1f;
  --placeholder-a: #1a2233;
  --placeholder-b: #2a1d2e;
  --placeholder-fg: #a1a1a6;
  --hero-glow: radial-gradient(60% 50% at 50% 0%, rgba(255, 159, 10, 0.18), transparent 70%);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

/* clip, not hidden: iOS Safari still lets you pan the page sideways past an overflow-x: hidden body. */
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 104px; overflow-x: clip; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.022em;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* clip, not hidden: hidden makes body a scroll container (html isn't overflow: visible), and iOS Safari then
     hands sideways swipes to it instead of the card carousels. */
  overflow-x: clip;
}

img { max-width: 100%; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.wrap { width: min(980px, calc(100% - 44px)); margin-inline: auto; }
.wrap-wide { width: min(1260px, calc(100% - 44px)); margin-inline: auto; }

/* ---------- Global nav ---------- */

.globalnav {
  position: relative;
  z-index: 50;
  height: 44px;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.globalnav .wrap-wide { height: 100%; display: flex; align-items: center; gap: 8px; }
.globalnav-brand { display: flex; align-items: center; gap: 8px; color: var(--fg); font-weight: 600; font-size: 15px; }
.globalnav-brand:hover { text-decoration: none; }
.globalnav-brand img { width: 22px; height: 22px; border-radius: 6px; }
.globalnav-links { display: flex; gap: 4px; margin: 0 0 0 auto; padding: 0; list-style: none; }
.globalnav-links a {
  display: block; padding: 0 10px; line-height: 44px;
  color: var(--fg); opacity: 0.8; font-size: 12px; letter-spacing: -0.01em;
}
.globalnav-links a:hover, .globalnav-links a[aria-current="page"] { opacity: 1; text-decoration: none; }
.theme-toggle {
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 0; background: transparent; border-radius: 50%; cursor: pointer; color: var(--fg); opacity: 0.8;
}
.theme-toggle:hover { opacity: 1; background: var(--chip); }
.theme-toggle svg { width: 16px; height: 16px; }
.menu-toggle { display: none; }

@media (max-width: 833px) {
  .globalnav-links {
    display: none; position: absolute; top: 44px; left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 12px 22px 24px;
    background: var(--bg); border-bottom: 1px solid var(--hairline);
  }
  .globalnav.open .globalnav-links { display: flex; }
  .globalnav-links a { font-size: 24px; font-weight: 600; line-height: 2.2; padding: 0; }
  .menu-toggle {
    display: grid; place-items: center; margin-left: auto; width: 32px; height: 32px;
    border: 0; background: transparent; cursor: pointer; color: var(--fg);
  }
  .menu-toggle svg { width: 18px; height: 18px; }
  .theme-toggle { margin-left: 0; }
}

/* ---------- Local nav (sticky) ---------- */

.localnav {
  position: sticky; top: 0; z-index: 40;
  height: 52px;
  background: var(--localnav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline);
}
.localnav .wrap-wide { height: 100%; display: flex; align-items: center; gap: 20px; }
.localnav-title { font-size: 21px; font-weight: 600; letter-spacing: 0.011em; color: var(--fg); margin-right: auto; }
.localnav-title:hover { text-decoration: none; }
.localnav-links { display: flex; gap: 20px; list-style: none; margin: 0; padding: 0; }
.localnav-links a { font-size: 12px; color: var(--fg); opacity: 0.85; }
.localnav-links a[aria-current="page"] { opacity: 0.5; pointer-events: none; }
@media (max-width: 600px) { .localnav-links { display: none; } }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 22px; border-radius: 980px;
  background: var(--accent); color: #fff; font-size: 17px; font-weight: 400; letter-spacing: -0.022em;
  border: 1px solid transparent; cursor: pointer; transition: background 0.2s;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn-secondary { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-secondary:hover { background: var(--accent); color: #fff; }
.btn-sm { min-height: 28px; padding: 0 12px; font-size: 12px; }
.link-arrow { font-size: 17px; }
.link-arrow::after { content: " ›"; }
.cta-row { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; justify-content: center; }

/* ---------- Typography ---------- */

.eyebrow { font-size: 21px; font-weight: 600; letter-spacing: 0.011em; color: var(--fg); margin: 0 0 8px; }
.eyebrow.accent { background: var(--gradient-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.headline-xl { font-size: clamp(48px, 9vw, 96px); line-height: 1.04; font-weight: 700; letter-spacing: -0.035em; margin: 0; }
.headline-lg { font-size: clamp(40px, 6.4vw, 80px); line-height: 1.05; font-weight: 700; letter-spacing: -0.03em; margin: 0; }
.headline-md { font-size: clamp(32px, 4.8vw, 56px); line-height: 1.07; font-weight: 700; letter-spacing: -0.028em; margin: 0; }
.headline-sm { font-size: clamp(24px, 3vw, 32px); line-height: 1.125; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.lede { font-size: clamp(19px, 2.2vw, 24px); line-height: 1.33; font-weight: 500; color: var(--fg-secondary); letter-spacing: -0.01em; }
.lede strong, .copy strong { color: var(--fg); font-weight: 600; }
.copy { font-size: 19px; line-height: 1.42; color: var(--fg-secondary); font-weight: 500; }
.gradient-text { background: var(--gradient-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.center { text-align: center; }

/* ---------- Sections ---------- */

.section { padding: clamp(80px, 12vw, 140px) 0; }
.section-alt { background: var(--bg-alt); }
.section-dark {
  background: #000; color: #f5f5f7;
  --fg: #f5f5f7; --fg-secondary: #a1a1a6; --hairline: rgba(255,255,255,0.14);
  --card: #1c1c1e; --card-shadow: none; --link: #2997ff;
  --placeholder-a: #1a2233; --placeholder-b: #2a1d2e; --placeholder-fg: #a1a1a6;
  --chip: #2c2c2e; --chip-fg: #f5f5f7;
}
.section-header { max-width: 820px; margin: 0 auto clamp(48px, 7vw, 80px); text-align: center; }
.section-header .lede { margin: 20px auto 0; max-width: 700px; }
.section-header-left { text-align: left; margin-left: 0; }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.9s cubic-bezier(.2,.7,.2,1), transform 0.9s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Hero ---------- */

.hero { position: relative; padding: clamp(56px, 9vw, 110px) 0 0; text-align: center; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; background: var(--hero-glow); pointer-events: none; }
.hero > * { position: relative; }
.hero-icon { width: 88px; height: 88px; border-radius: 20px; margin: 0 auto 24px; box-shadow: 0 10px 30px rgba(0,0,0,0.15); }
.hero .lede { max-width: 640px; margin: 24px auto 32px; }
.hero-devices {
  position: relative; margin: clamp(48px, 7vw, 80px) auto 0; width: min(1100px, 100%);
  aspect-ratio: 1100 / 620;
}
/* One of each device: Apple TV behind, MacBook Pro and iPad in the middle, iPhone Duo (folded) and Watch in front. */
.hero-devices .device { position: absolute; }
.hero-devices .device-tv { left: 9%; width: 74%; bottom: 20%; z-index: 1; }
.hero-devices .device-mac { left: 0; width: 52%; bottom: 0; z-index: 2; }
.hero-devices .device-ipad-land { right: 5%; width: 36%; bottom: 3%; z-index: 2; }
.hero-devices .device-duo { left: 48%; width: 18%; bottom: 0; z-index: 3; }
/* Folded, the Duo shows its smaller cover display. */
.hero-devices .device-duo-closed { left: 49%; width: 16%; bottom: 0; z-index: 3; }
.hero-devices .device-watch { right: 0; width: 11%; bottom: 0; z-index: 4; }
@media (max-width: 734px) {
  .hero-devices { aspect-ratio: 1 / 0.8; width: calc(100% - 32px); }
  .hero-devices .device-tv { left: 4%; width: 88%; bottom: 30%; }
  .hero-devices .device-mac { left: 0; width: 60%; bottom: 0; }
  .hero-devices .device-ipad-land { display: none; }
  .hero-devices .device-duo { left: 52%; width: 28%; bottom: 0; }
  .hero-devices .device-duo-closed { left: 54%; width: 25%; bottom: 0; }
  .hero-devices .device-watch { right: 0; width: 19%; bottom: 0; }
}

/* ---------- Device frames ----------
   Apple's product bezels (src/assets/bezels/) are transparent WebPs laid over the screenshot.
   build.py generates the per-device aspect ratio and screen placement from bezels.json and
   writes them in place of the [[bezels]] marker below. */

.device { position: relative; }
.device .bezel { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; user-select: none; }
.device .screen { position: absolute; overflow: hidden; background: #000; }
/* Round each cutout like the real display (radius over its width / height), or the screenshot's
   square corners poke out past the bezel's rounded ones. */
.device-iphone .screen { border-radius: 15% / 6.9%; }
.device-duo .screen { border-radius: 6% / 4.2%; }
.device-duo-closed .screen { border-radius: 8.5% / 5.8%; }
.device-ipad .screen { border-radius: 2.6% / 1.95%; }
.device-ipad-land .screen { border-radius: 1.95% / 2.6%; }
.device-mac .screen { border-radius: 1.2% 1.2% 0 0 / 1.9% 1.9% 0 0; }
.screen img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
/* A MacBook screen is narrower than a 16:10 Mac window: show the whole
   window (the sidebar's left edge was cropped) and let the black strip
   below it read as part of the bezel. */
.device-mac .screen img { object-fit: contain; object-position: top center; }

.device-duo { aspect-ratio: 1000 / 1396; }
.device-duo .screen { left: 3.2726%; top: 2.3451%; width: 93.8289%; height: 95.5779%; }
.device-duo-closed { aspect-ratio: 720 / 1005; }
.device-duo-closed .screen { left: 5.0294%; top: 2.6193%; width: 91.3129%; height: 95.1356%; }
.device-imac { aspect-ratio: 1600 / 1348; }
.device-imac .screen { left: 2.5223%; top: 2.9678%; width: 94.9555%; height: 63.3803%; }
.device-ipad { aspect-ratio: 1000 / 1305; }
.device-ipad .screen { left: 4.0018%; top: 3.2016%; width: 91.7741%; height: 93.733%; }
.device-ipad-land { aspect-ratio: 1400 / 1072; }
.device-ipad-land .screen { left: 3.2016%; top: 4.2241%; width: 93.733%; height: 91.7741%; }
.device-iphone { aspect-ratio: 720 / 1484; }
.device-iphone .screen { left: 4.2489%; top: 1.7667%; width: 91.5023%; height: 96.5035%; }
.device-mac { aspect-ratio: 1800 / 1087; }
.device-mac .screen { left: 10.276%; top: 2.438%; width: 79.4744%; height: 85.5028%; }
.device-tv { aspect-ratio: 1800 / 1118; }
.device-tv .screen { left: 0.6481%; top: 1.2751%; width: 92.1747%; height: 83.4235%; }
.device-watch { aspect-ratio: 600 / 956; }
.device-watch .screen { left: 9.8039%; top: 21.2528%; width: 75.2228%; height: 57.4944%; }

/* Soft shadow under the hardware; drop-shadow follows the bezel's alpha, not its box. */
.device-iphone, .device-duo, .device-duo-closed, .device-ipad, .device-ipad-land, .device-watch { filter: drop-shadow(0 24px 40px rgba(0,0,0,0.22)); }
.device-mac, .device-imac, .device-tv { filter: drop-shadow(0 30px 50px rgba(0,0,0,0.2)); }

/* Apple does not publish a Vision Pro bezel; its window is a floating glass pane. */
.device-vision .screen { position: relative; aspect-ratio: 16 / 10; border-radius: 5%; box-shadow: 0 30px 80px rgba(0,0,0,0.35), inset 0 0 0 1px rgba(255,255,255,0.25); }
.device-bare .screen { position: relative; border-radius: 22px; box-shadow: var(--card-shadow); border: 1px solid var(--hairline); }

/* Screenshot placeholder — shown until a real file is dropped into src/screens/ */
.placeholder {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  background: linear-gradient(150deg, var(--placeholder-a), var(--placeholder-b));
  color: var(--placeholder-fg); padding: 8%;
  font-size: clamp(9px, 1.1vw, 13px); font-weight: 500; line-height: 1.3; letter-spacing: 0;
}
.device-watch .placeholder { font-size: clamp(7px, 0.7vw, 10px); padding: 10%; }
.device-watch .placeholder code { display: none; }
.placeholder b { display: block; color: var(--fg); font-weight: 600; font-size: 1.1em; margin-bottom: 4px; }
.placeholder code { font-family: ui-monospace, Menlo, monospace; font-size: 0.9em; }

.only-dark { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .only-dark { display: block !important; }
  :root:not([data-theme="light"]) .only-light { display: none !important; }
}
:root[data-theme="dark"] .only-dark { display: block !important; }
:root[data-theme="dark"] .only-light { display: none !important; }

/* ---------- Highlights gallery ---------- */

.gallery { position: relative; }
.gallery-track {
  display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px max(22px, calc((100vw - 980px) / 2)) 24px; scrollbar-width: none;
  scroll-padding-inline: max(22px, calc((100vw - 980px) / 2));
  overscroll-behavior-x: contain; touch-action: pan-x pan-y;
}
.gallery-track::-webkit-scrollbar { display: none; }
/* One card per swipe, like a pager: a fling stops at the next card instead of coasting past several. */
.gallery-track > * { scroll-snap-stop: always; }
.gallery-item {
  flex: 0 0 min(820px, 86vw); scroll-snap-align: start;
  border-radius: 28px; overflow: hidden; background: var(--card); box-shadow: var(--card-shadow);
  display: flex; flex-direction: column;
}
.gallery-item .caption { padding: 36px 40px 0; font-size: clamp(19px, 2vw, 24px); line-height: 1.25; font-weight: 600; letter-spacing: -0.015em; color: var(--fg-secondary); }
.gallery-item .caption strong { color: var(--fg); font-weight: 600; }
.gallery-item .media { padding: 32px 40px 0; margin-top: auto; display: flex; justify-content: center; align-items: flex-end; gap: 4%; min-height: 380px; }
.gallery-item .media .device-iphone { width: 36%; margin-bottom: -20%; }
/* Controls along the bottom of the screen (a light's swatches) stay in view: smaller, cropped less. */
.gallery-item .media.show-bottom .device-iphone { width: 30%; margin-bottom: -2%; }
.gallery-item .media .device-ipad-land { width: 82%; margin-bottom: -8%; }
.gallery-item .media .device-watch { width: 30%; margin-bottom: 6%; }
.gallery-item .media .device-tv { width: 86%; margin-bottom: 4%; }
@media (max-width: 734px) {
  .gallery-item .media { min-height: 300px; }
  .gallery-item .media .device-iphone { width: 58%; margin-bottom: -28%; }
  .gallery-item .media.show-bottom .device-iphone { width: 46%; margin-bottom: -2%; }
  .gallery-item .media .device-ipad-land { width: 96%; }
  .gallery-item .media .device-watch { width: 48%; }
}
.gallery-controls { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 18px; }
.gallery-dots { display: flex; gap: 10px; padding: 14px 20px; border-radius: 999px; background: var(--chip); }
.gallery-dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 999px; background: var(--fg-tertiary); opacity: 0.6; cursor: pointer; transition: width .3s, opacity .3s; }
.gallery-dots button[aria-current="true"] { width: 44px; opacity: 1; background: var(--fg); }
/* Topic dots match DiscoverPageDots in the apps: small, and the current one stretches in its topic's tint. */
.topic-gallery .gallery-dots { gap: 6px; padding: 12px 14px; }
.topic-gallery .gallery-dots button { width: 6px; height: 6px; transition: width .3s, opacity .3s, background-color .3s; }
.topic-gallery .gallery-dots button[aria-current="true"] { width: 20px; background: var(--dot-tint, var(--fg)); }
.gallery-controls { max-width: 100%; padding-inline: 16px; }
.gallery-dots { min-width: 0; }
.paddle {
  width: 36px; height: 36px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: var(--chip); color: var(--fg); cursor: pointer;
}
.paddle:disabled { opacity: 0.35; cursor: default; }
.paddle svg { width: 14px; height: 14px; }

/* ---------- Feature blocks ---------- */

.feature { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.feature + .feature { margin-top: clamp(80px, 10vw, 140px); }
.feature.flip .feature-media { order: -1; }
.feature-copy .headline-md { margin-bottom: 20px; }
.feature-copy .copy { margin: 0 0 16px; }
.feature-media { display: flex; justify-content: center; align-items: flex-end; gap: 6%; }
.feature-media .device-iphone { width: min(300px, 46%); }
.feature-media .device-iphone + .device-iphone { margin-bottom: 12%; }
.feature-media .device-duo { width: min(400px, 60%); }
.feature-media .device-ipad { width: min(440px, 82%); }
.feature-media .device-watch { width: min(220px, 40%); }
@media (max-width: 833px) {
  .feature { grid-template-columns: 1fr; }
  .feature.flip .feature-media { order: 0; }
}

.feature-stack { text-align: center; }
.feature-stack .copy { max-width: 680px; margin: 20px auto 0; }
.feature-stack .feature-media { margin-top: clamp(40px, 6vw, 72px); }

/* Pill list of capabilities */
.pill-list { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 28px 0 0; }
.feature-stack .pill-list { justify-content: center; }
.pill-list li { padding: 8px 16px; border-radius: 999px; background: var(--chip); color: var(--chip-fg); font-size: 14px; font-weight: 500; letter-spacing: -0.01em; }
/* Every supported accessory type, with its symbol. */
.pill-icons { gap: 8px; }
.pill-icons li { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px 7px 11px; }
.pill-icons li svg { width: 17px; height: 17px; flex: none; opacity: 0.85; }

/* ---------- Tiles grid ---------- */

.tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }
.tile {
  grid-column: span 2; background: var(--card); border-radius: 28px; box-shadow: var(--card-shadow);
  padding: 36px 32px; display: flex; flex-direction: column; overflow: hidden; min-height: 300px;
}
.tile.span-3 { grid-column: span 3; }
.tile.span-4 { grid-column: span 4; }
.tile.span-6 { grid-column: span 6; }
.tile h3 { font-size: clamp(24px, 2.6vw, 32px); line-height: 1.125; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 12px; }
.tile p { margin: 0; color: var(--fg-secondary); font-size: 17px; font-weight: 500; }
.tile .stat { font-size: clamp(56px, 7vw, 88px); font-weight: 700; letter-spacing: -0.04em; line-height: 1; margin: 8px 0 12px; }
.tile > svg { flex: none; width: 44px; height: 44px; margin-bottom: 20px; color: var(--amber); }
.tile .stat.gradient-text { color: transparent; }
.tile:not(:has(.tile-media)) { min-height: 0; }
.tile:has(.stat) { justify-content: center; }
.tile-split { display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 40px; padding-bottom: 0; min-height: 0; }
.tile-split .tile-copy { align-self: center; padding: 24px 0 36px; max-width: 460px; }
.tile-split .tile-copy > svg { width: 44px; height: 44px; margin-bottom: 20px; color: var(--amber); }
.tile-split .tile-copy h3 { font-size: clamp(28px, 3.4vw, 40px); }
.tile-split .tile-media { margin: 0; padding: 0; align-self: end; }
.tile-split .tile-media .device-iphone { width: min(260px, 70%); margin-bottom: -30%; }
@media (max-width: 833px) {
  .tile-split { grid-template-columns: 1fr; gap: 0; }
  .tile-split .tile-media .device-iphone { width: 55%; }
}
.tile .tile-media { margin-top: auto; padding-top: 28px; display: flex; justify-content: center; }
.tile .tile-media .device-iphone { width: 48%; margin-bottom: -42%; }
.tile .tile-media .device-watch { width: 46%; }
@media (max-width: 833px) {
  .tiles { grid-template-columns: 1fr; }
  .tile, .tile.span-3, .tile.span-4, .tile.span-6 { grid-column: auto; }
}

/* ---------- Platforms ---------- */

.platforms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.platform { text-align: center; padding: 40px 24px 0; border-radius: 28px; background: var(--card); box-shadow: var(--card-shadow); overflow: hidden; display: flex; flex-direction: column; }
.platform h3 { font-size: 24px; font-weight: 700; margin: 0 0 8px; letter-spacing: -0.02em; }
.platform p { margin: 0 auto; max-width: 300px; color: var(--fg-secondary); font-size: 15px; font-weight: 500; }
.platform .platform-media { margin-top: auto; padding-top: 32px; display: flex; justify-content: center; align-items: flex-end; min-height: 240px; }
.platform .device-iphone { width: 46%; margin-bottom: -28%; }
.platform .device-ipad { width: 64%; margin-bottom: -24%; }
.platform .device-mac { width: 96%; margin-bottom: -2%; }
.platform .device-imac { width: 88%; margin-bottom: -14%; }
.platform .device-watch { width: 48%; margin-bottom: -8%; }
.platform .device-tv { width: 94%; margin-bottom: 8px; }
.platform .device-vision { width: 92%; margin-bottom: 32px; }
@media (max-width: 1023px) { .platforms { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .platforms { grid-template-columns: 1fr; } }

/* ---------- Privacy ---------- */

.privacy-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin-top: 64px; }
.privacy-grid h3 { font-size: 21px; margin: 16px 0 8px; letter-spacing: -0.01em; }
.privacy-grid p { margin: 0; color: var(--fg-secondary); font-size: 17px; }
.privacy-grid svg { width: 40px; height: 40px; color: var(--accent); }
@media (max-width: 833px) { .privacy-grid { grid-template-columns: 1fr; } }

/* ---------- CTA band ---------- */

.cta-band { text-align: center; }
.cta-band .lede { margin: 20px auto 36px; max-width: 640px; }
.cta-band .category-strip { display: flex; flex-wrap: wrap; justify-content: center; gap: 28px 40px; margin: 56px 0 0; list-style: none; padding: 0; }
.cta-band .category-strip a { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--fg); font-size: 14px; font-weight: 500; }
.cta-band .category-strip a:hover { text-decoration: none; color: var(--link); }
.cta-band .category-strip svg { width: 40px; height: 40px; }

/* ---------- Footer ---------- */

.footer { background: var(--bg-alt); color: var(--fg-secondary); font-size: 12px; line-height: 1.33; letter-spacing: -0.01em; padding: 20px 0 32px; }
.footer .notes { padding: 16px 0; border-bottom: 1px solid var(--hairline); }
.footer .notes p { margin: 0 0 10px; }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 8px 24px; padding-top: 16px; align-items: center; }
.footer-bottom nav { display: flex; flex-wrap: wrap; gap: 6px 0; }
.footer-bottom nav a { color: var(--fg-secondary); padding: 0 10px; border-left: 1px solid var(--hairline-strong); }
.footer-bottom nav a:first-child { padding-left: 0; border-left: 0; }
.footer-bottom .domain { margin-left: auto; }

/* ================= Accessories ================= */

.acc-hero { padding: clamp(56px, 8vw, 96px) 0 clamp(32px, 5vw, 56px); text-align: center; }
.acc-hero .lede { max-width: 720px; margin: 20px auto 0; }

.acc-toolbar {
  position: sticky; top: 52px; z-index: 30; background: var(--localnav-bg);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline); padding: 12px 0;
}
.acc-toolbar .wrap-wide { display: flex; gap: 12px; align-items: center; }
.chip-sm { padding: 6px 12px; font-size: 13px; background: transparent; box-shadow: inset 0 0 0 1px var(--hairline-strong); }
.chip-sm svg { width: 14px; height: 14px; }
.chip-sm[hidden] { display: none; }
.chip-count { color: var(--fg-tertiary); font-weight: 500; margin-left: 2px; }
.chip[aria-pressed="true"] .chip-count { color: inherit; opacity: 0.6; }
/* Filter button: opens the slide-out panel; its badge counts the picks inside. */
.filter-button {
  flex: none; height: 36px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; border: 0; border-radius: 999px;
  background: var(--chip); color: var(--chip-fg); font-size: 14px; font-weight: 500; letter-spacing: -0.01em; cursor: pointer;
}
.filter-button svg { width: 16px; height: 16px; }
.filter-button.active { background: var(--chip-active); color: var(--chip-active-fg); }
.filter-badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: inline-grid; place-items: center;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.filter-badge[hidden] { display: none; }
/* Apple Store-style filter panel: slides in from the left over a scrim, sections fold open. */
.filter-drawer { position: fixed; inset: 0; z-index: 100; visibility: hidden; transition: visibility 0s .4s; }
.filter-drawer.open { visibility: visible; transition: none; }
.filter-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.45); opacity: 0; transition: opacity .4s ease; }
.filter-drawer.open .filter-scrim { opacity: 1; }
.filter-panel {
  position: absolute; top: 0; bottom: 0; left: 0; width: min(420px, 100vw); display: flex; flex-direction: column;
  background: var(--bg-elevated); box-shadow: 0 0 60px rgba(0, 0, 0, 0.3);
  transform: translateX(-100%); transition: transform .4s cubic-bezier(0.32, 0.72, 0, 1);
}
.filter-drawer.open .filter-panel { transform: none; }
@media (prefers-reduced-motion: reduce) { .filter-drawer, .filter-scrim, .filter-panel { transition: none; } }
:root.drawer-open { overflow: hidden; }
.filter-head { display: flex; align-items: center; justify-content: space-between; padding: 24px 24px 8px; }
.filter-head h2 { margin: 0; font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.filter-close { width: 36px; height: 36px; flex: none; border: 0; border-radius: 50%; background: var(--chip); color: var(--fg); display: grid; place-items: center; cursor: pointer; }
.filter-close svg { width: 18px; height: 18px; }
.filter-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 24px 16px; }
.filter-section { border-bottom: 1px solid var(--hairline); }
.filter-section[hidden] { display: none; }
.filter-section summary {
  display: flex; align-items: center; gap: 12px; padding: 18px 0; list-style: none; cursor: pointer;
  font-size: 17px; font-weight: 600; letter-spacing: -0.01em;
}
.filter-section summary::-webkit-details-marker { display: none; }
.filter-section summary svg { width: 14px; height: 14px; flex: none; color: var(--fg-tertiary); transition: transform .2s; }
.filter-section[open] summary svg { transform: rotate(180deg); }
.filter-picked { flex: 1; min-width: 0; text-align: right; color: var(--fg-secondary); font-size: 14px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filter-options { padding: 0 0 14px; }
.filter-options .tag-option { margin: 0 -10px; }
.filter-foot {
  display: flex; align-items: center; gap: 12px; padding: 16px 24px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--hairline);
}
.filter-clear { flex: none; padding: 0 8px; border: 0; background: none; color: var(--link); font-size: 15px; cursor: pointer; }
.filter-done { flex: 1; height: 44px; border: 0; border-radius: 12px; background: var(--accent); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; }
.filter-done:hover { background: var(--accent-hover); }
.tag-option[hidden] { display: none; }
.tag-option { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 8px 10px; border-radius: 10px; cursor: pointer; font-size: 15px; }
.tag-option:hover { background: var(--chip); }
.tag-option input { position: absolute; opacity: 0; pointer-events: none; }
.tag-check { width: 18px; height: 18px; flex: none; border-radius: 5px; box-shadow: inset 0 0 0 1.5px var(--hairline-strong); display: grid; place-items: center; }
.tag-option input:checked + .tag-check { background: var(--accent); box-shadow: none; }
.tag-option input:checked + .tag-check::after { content: ""; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.tag-option input[type="radio"] + .tag-check { border-radius: 50%; }
.tag-option input[type="radio"]:checked + .tag-check::after { width: 8px; height: 8px; border: 0; border-radius: 50%; background: #fff; transform: none; }
.tag-option input:focus-visible + .tag-check { outline: 2px solid var(--accent); outline-offset: 2px; }
.tag-option > svg { width: 16px; height: 16px; flex: none; color: var(--fg-secondary); }
.tag-label { flex: 1; }
.tag-count { color: var(--fg-tertiary); font-size: 13px; font-variant-numeric: tabular-nums; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
/* Rows that scroll sideways fade out at the edge with more chips past it (site.js sets the classes). */
.chips.fade-end { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent); }
.chips.fade-start { -webkit-mask-image: linear-gradient(to right, transparent, #000 56px); mask-image: linear-gradient(to right, transparent, #000 56px); }
.chips.fade-start.fade-end { -webkit-mask-image: linear-gradient(to right, transparent, #000 56px, #000 calc(100% - 56px), transparent); mask-image: linear-gradient(to right, transparent, #000 56px, #000 calc(100% - 56px), transparent); }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 0; cursor: pointer; padding: 8px 16px; border-radius: 999px;
  background: var(--chip); color: var(--chip-fg); font-size: 14px; font-weight: 500; letter-spacing: -0.01em;
  display: inline-flex; gap: 6px; align-items: center;
}
.chip svg { width: 16px; height: 16px; }
.chip[aria-pressed="true"] { background: var(--chip-active); color: var(--chip-active-fg); }
.search {
  flex: 0 1 300px; min-width: 240px; display: flex; align-items: center; gap: 8px; padding: 0 14px; height: 36px;
  border-radius: 10px; background: var(--chip); color: var(--fg-secondary);
}
.search svg { width: 15px; height: 15px; flex: none; }
.search input { border: 0; outline: 0; background: transparent; color: var(--fg); font: inherit; font-size: 15px; width: 100%; }
@media (max-width: 734px) {
  .acc-toolbar .wrap-wide { flex-wrap: wrap; gap: 10px; }
  .search { order: -1; flex: 1 0 100%; min-width: 0; }
}

.acc-count { color: var(--fg-secondary); font-size: 14px; margin: 24px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-height: 28px; }
.acc-active { display: contents; }
.acc-token {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px 0 12px; border: 0; border-radius: 999px;
  background: var(--chip); color: var(--fg); font-size: 13px; font-weight: 500; cursor: pointer;
}
.acc-token span:last-child { color: var(--fg-tertiary); font-size: 16px; line-height: 1; }
.acc-token:hover span:last-child { color: var(--fg); }
.acc-clear { border: 0; background: none; padding: 0; cursor: pointer; color: var(--link); font-size: 14px; }
.acc-clear:hover { text-decoration: underline; }
.acc-clear[hidden] { display: none; }
.acc-group { padding: 56px 0 8px; }
.acc-group[hidden] { display: none; }
.acc-group-header { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.acc-group-header svg { width: 36px; height: 36px; color: var(--amber); }
.acc-group-header h2 { margin: 0; font-size: clamp(32px, 4vw, 48px); letter-spacing: -0.028em; line-height: 1.1; }
.acc-type { margin-top: 36px; }
.acc-type[hidden] { display: none; }
.acc-type h3 { font-size: 21px; margin: 0 0 16px; letter-spacing: -0.01em; display: flex; align-items: baseline; gap: 10px; }
.acc-type h3 span { color: var(--fg-tertiary); font-weight: 500; font-size: 15px; }
.acc-type .rehome-line { margin: -8px 0 18px; color: var(--fg-secondary); font-size: 15px; }

.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); grid-auto-rows: 1fr; gap: 16px; list-style: none; padding: 0; margin: 0; }
@media (max-width: 480px) { .acc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
.acc-card[hidden] { display: none; }
.acc-card a {
  height: 100%; display: flex; flex-direction: column; border-radius: 20px; background: var(--card);
  box-shadow: var(--card-shadow); border: 1px solid var(--hairline); overflow: hidden; color: var(--fg);
  transition: transform .25s ease, box-shadow .25s ease;
}
.acc-card a:hover { text-decoration: none; transform: translateY(-3px); box-shadow: 0 12px 34px rgba(0,0,0,0.12); }
.acc-thumb { position: relative; aspect-ratio: 1; flex: none; display: grid; place-items: center; background: #fff; padding: 14%; overflow: hidden; }
.acc-thumb img { position: absolute; inset: 12%; width: 76%; height: 76%; object-fit: contain; }
.acc-thumb.empty { background: var(--bg-alt); color: var(--fg-tertiary); padding: 30%; }
.acc-thumb.empty svg { width: 100%; height: 100%; }
.acc-meta { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.acc-brand { font-size: 12px; color: var(--fg-tertiary); font-weight: 500; letter-spacing: 0; text-transform: uppercase; }
.acc-card .acc-brand { display: block; height: 16px; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-name { font-size: 15px; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
.acc-card .acc-name {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3;
  overflow: hidden; height: calc(2 * 1.25em);
}
.acc-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.acc-card .acc-badges { margin-top: auto; padding-top: 10px; max-height: 58px; overflow: hidden; }
.badge {
  font-size: 11px; font-weight: 600; letter-spacing: 0; padding: 3px 8px; border-radius: 999px;
  background: var(--chip); color: var(--fg-secondary); white-space: nowrap;
}
.badge.matter { background: rgba(10, 132, 255, 0.14); color: var(--link); }
.badge.thread { background: rgba(48, 209, 88, 0.16); color: #1f9d43; }
.badge.hsv { background: rgba(255, 159, 10, 0.18); color: #c46c00; }
.badge.keys { background: rgba(191, 90, 242, 0.16); color: #9b3fd1; }
.badge.aliro { background: rgba(88, 86, 214, 0.16); color: #4b48c2; }
.badge.adaptive { background: rgba(255, 214, 10, 0.22); color: #8a6d00; }
.badge.homekit { background: rgba(255, 159, 10, 0.14); color: #b86200; }
.badge.airplay { background: rgba(94, 92, 230, 0.15); color: #5e5ce6; }
.badge.bridge { background: rgba(100, 210, 255, 0.18); color: #0a7ea4; }
.badge.radio { background: transparent; box-shadow: inset 0 0 0 1px var(--hairline-strong); }
.badge.soon { background: rgba(255, 69, 58, 0.14); color: #d7372b; }
.badge.applelist { background: transparent; box-shadow: inset 0 0 0 1px var(--hairline-strong); color: var(--muted); }
.badge.archive { background: rgba(172, 142, 104, 0.18); color: #7a5a30; }
.badge.regional { background: rgba(172, 142, 104, 0.18); color: #7a5a30; }
.badge.uwb { background: rgba(50, 173, 230, 0.16); color: #0a6fa3; }
.badge.sense { background: rgba(255, 55, 95, 0.13); color: #c2184a; }
/* Protocol options carry a dot in their card badge's colour. */
.tag-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: currentColor; }
.tag-dot.matter { color: var(--link); }
.tag-dot.homekit { color: #ff9f0a; }
.tag-dot.homekit.unchecked { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.tag-dot.airplay { color: #5e5ce6; }
.reading-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.reading-list a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: rgba(255, 55, 95, 0.12); color: #c2184a; font-weight: 600; font-size: 14px; text-decoration: none; }
.reading-list a svg { width: 15px; height: 15px; }
.readings-title { margin: 28px 0 6px; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.readings-hint { margin: 0 0 16px; color: var(--fg-secondary); max-width: 60ch; }
.readings-grid { list-style: none; margin: 0 0 36px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.reading-tile { display: flex; flex-direction: column; gap: 10px; padding: 14px 14px 12px; border-radius: 16px; background: var(--card); box-shadow: inset 0 0 0 1px var(--hairline); text-decoration: none; color: inherit; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.reading-tile:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--hairline-strong); }
.reading-tile svg { width: 22px; height: 22px; color: #c2184a; }
.reading-name { font-weight: 600; font-size: 15px; }
.reading-count { font-size: 13px; color: var(--fg-secondary); font-variant-numeric: tabular-nums; }
.topic-shop .readings-title { margin-top: 40px; }
.topic-shop .readings-title .topic-all-count { color: var(--fg-tertiary); font-weight: 500; font-size: 15px; margin-left: 6px; }
.topic-shop .topic-type { margin-top: 28px; }
.topic-shop .topic-type h3 { flex-wrap: wrap; }
.topic-type-link { margin-left: auto; font-size: 14px; font-weight: 500; color: var(--fg-secondary); text-decoration: none; }
.topic-type-link:hover { color: var(--fg); text-decoration: underline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .badge.sense, :root:not([data-theme="light"]) .reading-list a,
  :root:not([data-theme="light"]) .reading-tile svg { color: #ff6b8f; }
}
:root[data-theme="dark"] .badge.sense, :root[data-theme="dark"] .reading-list a, :root[data-theme="dark"] .reading-tile svg { color: #ff6b8f; }
.badge.nothk { background: rgba(255, 69, 58, 0.14); color: #d7372b; }
.acc-empty { text-align: center; padding: 80px 0; color: var(--fg-secondary); }

/* ---------- Accessory detail ---------- */

.crumbs { font-size: 12px; color: var(--fg-secondary); padding: 18px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { color: var(--fg-secondary); }
.crumbs span[aria-hidden] { opacity: 0.6; }
.detail-hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 6vw, 72px); align-items: center; padding: 40px 0 clamp(56px, 8vw, 96px); }
/* Capped so a tall photo never pushes the card past the viewport; the img is pinned inside the padding so its
   natural size can't stretch the square. */
.detail-image { position: relative; width: min(100%, 460px, 62vh); justify-self: center; aspect-ratio: 1; border-radius: 32px; background: #fff; display: grid; place-items: center; padding: 12%; border: 1px solid var(--hairline); }
.detail-image img { position: absolute; inset: 12%; width: 76%; height: 76%; object-fit: contain; }
.detail-image.empty { background: var(--bg-alt); color: var(--fg-tertiary); padding: 28%; }
.detail-image.empty svg { width: 100%; height: 100%; }
.detail-copy .acc-brand { font-size: 14px; }
.detail-copy h1 { font-size: clamp(36px, 5vw, 56px); line-height: 1.07; letter-spacing: -0.03em; margin: 8px 0 16px; }
.detail-copy .category-line { font-size: 19px; color: var(--fg-secondary); font-weight: 500; margin: 0 0 20px; }
.detail-copy .acc-badges .badge { font-size: 13px; padding: 5px 12px; }
.detail-copy .cta-row { justify-content: flex-start; margin-top: 32px; }
@media (max-width: 833px) { .detail-hero { grid-template-columns: 1fr; } }

.detail-sections { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: clamp(64px, 8vw, 96px); }
.panel { background: var(--card); border-radius: 24px; padding: 32px; box-shadow: var(--card-shadow); border: 1px solid var(--hairline); }
.panel.wide { grid-column: span 2; }
.panel h2 { font-size: 24px; letter-spacing: -0.02em; margin: 0 0 16px; }
.panel p { color: var(--fg-secondary); margin: 0 0 12px; font-size: 17px; }
.panel ul { margin: 0; padding-left: 20px; color: var(--fg-secondary); }
.panel li { margin: 0 0 8px; }
.panel .transport-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.panel .transport-list li { margin: 0; padding: 8px 14px; border-radius: 999px; background: var(--chip); color: var(--chip-fg); font-size: 14px; font-weight: 500; }
.panel .shop-rating { color: var(--fg); font-size: 17px; }
.panel .shop-rating .stars { color: #f5a623; }
.panel .kv + .muted { margin-top: 16px; }
.path-list { list-style: none; padding: 0 !important; }
.path-list li { padding: 12px 16px; border-radius: 14px; background: var(--bg-alt); color: var(--fg); font-size: 15px; margin-bottom: 8px; }
.kv { width: 100%; border-collapse: collapse; font-size: 15px; }
.kv th, .kv td { text-align: left; padding: 10px 0; border-bottom: 1px solid var(--hairline); vertical-align: top; }
.kv th { color: var(--fg-secondary); font-weight: 500; width: 40%; padding-right: 16px; }
.panel.wide .kv th { width: 280px; }
.kv tr:last-child th, .kv tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; }
.versions { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 520px; }
.versions th, .versions td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--hairline); }
.versions th { color: var(--fg-secondary); font-weight: 500; }
.sources { list-style: none; padding: 0 !important; font-size: 14px; }
.sources li { overflow-wrap: anywhere; }
.muted { color: var(--fg-tertiary); font-size: 13px; }
@media (max-width: 833px) { .detail-sections { grid-template-columns: 1fr; } .panel.wide { grid-column: auto; } }

.related { padding: clamp(64px, 8vw, 96px) 0; }
.related h2 { font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -0.025em; margin: 0 0 28px; }

/* Icon above a section headline (e.g. Privacy) */
.section-header > svg { display: block; width: 56px; height: 56px; margin: 0 auto 20px; color: var(--accent); }

/* ================= Discover ================= */

.topic-gallery .gallery-track > .topic-card { flex: 0 0 min(340px, 78vw); scroll-snap-align: start; }
.topic-card {
  display: flex; flex-direction: column; border-radius: 28px; overflow: hidden; color: var(--fg);
  background: linear-gradient(color-mix(in srgb, var(--tint) 28%, transparent), transparent 55%), var(--card);
  box-shadow: var(--card-shadow); border: 1px solid var(--hairline);
  transition: transform .3s ease, box-shadow .3s ease;
}
.topic-card:hover { text-decoration: none; transform: translateY(-4px); box-shadow: 0 16px 40px rgba(0,0,0,0.14); }
.topic-card-art { padding: 30px 22px 20px; }
.discover-art { display: block; width: 100%; aspect-ratio: 320 / 220; }
.topic-card-body { padding: 0 26px 28px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.topic-card-body h3 { margin: 0; font-size: 28px; line-height: 1.15; letter-spacing: -0.02em; }
.topic-card-body p {
  margin: 0; color: var(--fg-secondary); font-weight: 500; font-size: 17px; line-height: 1.35;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
  min-height: calc(3 * 1.35em);
}
.topic-count {
  align-self: flex-start; margin-top: 6px; padding: 5px 10px; border-radius: 999px; font-size: 13px; font-weight: 600;
  color: color-mix(in oklab, var(--tint) 70%, var(--fg)); background: color-mix(in srgb, var(--tint) 16%, transparent);
}
.topic-badge-pill { background: var(--tint); color: var(--on-tint); }
.topic-badge-pill + .topic-count { margin-top: 0; }
.topic-card-body .topic-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.topic-pills .topic-count { margin-top: 0; }

.topic-hero { background: var(--tint); color: var(--on-tint); padding: clamp(56px, 8vw, 96px) 0 clamp(40px, 6vw, 64px); }
.topic-eyebrow { margin: 0 0 12px; font-size: 15px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.85; }
.topic-hero h1 { max-width: 760px; }
.topic-hero-art { max-width: 640px; margin: clamp(32px, 5vw, 56px) auto 0; }

.topic-sections { display: flex; flex-direction: column; gap: clamp(48px, 7vw, 88px); }
.topic-text { max-width: 760px; }
.topic-text .copy { margin: 20px 0 0; }
.topic-accent { color: color-mix(in oklab, var(--tint) 80%, var(--fg)); }
.topic-badge {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; flex: none;
  background: var(--tint); color: var(--on-tint);
}
.topic-badge svg { width: 28px; height: 28px; }
.topic-panel { background: var(--bg-alt); border-radius: 28px; padding: clamp(28px, 4vw, 44px); }
.topic-panel h3, .topic-band h3 { font-size: clamp(24px, 3vw, 32px); letter-spacing: -0.02em; line-height: 1.15; margin: 20px 0 10px; }
.topic-panel p, .topic-band p { margin: 0; font-size: 19px; font-weight: 500; color: var(--fg-secondary); max-width: 680px; }
.topic-band {
  background: var(--tint); color: var(--on-tint); border-radius: 28px; padding: clamp(28px, 4vw, 44px);
  display: flex; gap: 24px; align-items: flex-start;
}
.topic-band h3 { margin-top: 0; }
.topic-band p { color: inherit; opacity: 0.85; }
.topic-band .topic-badge { background: color-mix(in srgb, var(--on-tint) 14%, transparent); color: var(--on-tint); }
.topic-footnote { margin-top: 12px !important; font-size: 14px !important; opacity: 0.75; }
.topic-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 18px; font-size: 17px; font-weight: 600; color: var(--accent); text-decoration: none; }
.topic-link:hover { text-decoration: underline; }
.topic-link svg { width: 16px; height: 16px; }
.topic-band .topic-link { color: inherit; }
.topic-shop .lede { margin: 12px 0 36px; }
@media (max-width: 600px) { .topic-band { flex-direction: column; } }

/* Where to buy */
.buy-list { list-style: none; padding: 0 !important; margin: 0 0 16px !important; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.buy-list li { margin: 0 !important; }
.buy-link {
  display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 14px;
  background: var(--bg-alt); color: var(--fg); border: 1px solid var(--hairline); height: 100%;
}
.buy-link:hover { text-decoration: none; border-color: var(--accent); }
.buy-link span { font-weight: 600; font-size: 16px; }
.buy-link span::after { content: " ↗"; color: var(--fg-tertiary); font-weight: 400; }
.buy-link small { color: var(--fg-tertiary); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.buy-link small b { color: var(--fg-secondary); font-weight: 600; }
.buy-maker { background: color-mix(in srgb, var(--accent) 10%, var(--bg-alt)); }
.buy-subhead { font-size: 15px; font-weight: 600; color: var(--fg-secondary); margin: 4px 0 10px; }
.buy-search .buy-link { padding: 10px 14px; }
.buy-search .buy-link span { font-size: 15px; font-weight: 500; }
#buy { scroll-margin-top: 140px; }
#buy h2 { display: flex; align-items: center; gap: 10px; }

/* Topic page tabs: Overview (the editorial page) and More (every accessory type as a demo tile). */
.topic-tabbar { background: var(--bg); padding: 12px 0; border-bottom: 1px solid var(--hairline); }
.topic-tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--chip); }
.topic-tab {
  border: 0; background: transparent; color: var(--fg-secondary); font: inherit; font-size: 15px; font-weight: 600;
  letter-spacing: -0.01em; padding: 8px 22px; border-radius: 999px; cursor: pointer; transition: background .2s, color .2s;
}
.topic-tab[aria-selected="true"] { background: var(--bg); color: var(--fg); box-shadow: 0 1px 4px rgba(0,0,0,0.12); }
.no-js .topic-tabbar { display: none; }
/* Scrolled past the bar, site.js moves the same tablist into the local nav beside the title. */
.localnav.has-tabs .localnav-title { margin-right: 0; }
.localnav .topic-tabs { margin-right: auto; flex: none; animation: tabs-dock .25s ease-out; }
.localnav .topic-tab { font-size: 13px; padding: 5px 15px; }
@keyframes tabs-dock { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .localnav .topic-tabs { animation: none; } }
@media (max-width: 600px) {
  .localnav.has-tabs .wrap-wide { gap: 12px; }
  .localnav.has-tabs .localnav-title { font-size: 19px; }
}
@media (max-width: 420px) {
  .localnav.has-tabs .btn { display: none; }
  .localnav .topic-tabs { margin-right: 0; margin-left: auto; }
}
.no-js [data-tab-panel][hidden] { display: block; }

/* Demo tiles: drawn like the apps' accessory tiles, on a dark card washed with the topic color. */
.topic-demos .lede { margin: 12px 0 36px; max-width: 680px; }
.demo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.demo-card {
  border-radius: 28px; padding: 0 16px 16px; color: #fff; display: flex; flex-direction: column; gap: 14px; overflow: hidden;
  background: linear-gradient(color-mix(in srgb, var(--demo-tint) 30%, transparent), transparent 55%), #1c1c1e;
  border: 1px solid var(--hairline);
}
.demo-art { margin: 0 -2px; padding: 22px 6px 4px; }
.demo-tile {
  display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 9px 11px; border-radius: 20px;
  background: rgba(255,255,255,0.14); color: #fff; transition: background .45s, color .45s;
}
.demo-tile[data-on="true"] { background: rgba(255,255,255,0.94); color: #000; }
.demo-icon {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: rgba(0,0,0,0.2); color: rgba(255,255,255,0.85); transition: background .45s, color .45s;
}
.demo-tile[data-on="true"] .demo-icon { background: rgba(0,0,0,0.06); color: var(--demo-tint); }
.demo-icon svg { width: 22px; height: 22px; stroke-width: 1.9; }
.demo-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.demo-name { font-size: 17px; font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-status { position: relative; height: 20px; overflow: hidden; font-size: 15px; line-height: 20px; }
.demo-page {
  position: absolute; left: 0; top: 0; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap;
  opacity: 0.6; font-variant-numeric: tabular-nums; max-width: 100%;
}
.demo-page[style] { opacity: 1; font-weight: 500; }
.demo-page svg { width: 13px; height: 13px; stroke-width: 2.2; flex: none; }
.demo-page .ch { display: inline-block; white-space: pre; }
.demo-page.enter { animation: demo-enter .45s cubic-bezier(.3,.7,.3,1) both; }
.demo-page.leave { animation: demo-leave .45s cubic-bezier(.3,.7,.3,1) both; }
.demo-page .ch.roll { animation: demo-enter .45s cubic-bezier(.3,.7,.3,1) both; }
.demo-page .ch.out { animation: demo-leave .45s cubic-bezier(.3,.7,.3,1) both; }
.demo-page .ch.hide { visibility: hidden; }
@keyframes demo-enter { from { transform: translateY(100%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes demo-leave { from { transform: none; opacity: 1; } to { transform: translateY(-100%); opacity: 0; } }
.demo-summary { margin: 0; font-size: 15px; line-height: 1.4; color: rgba(255,255,255,0.8); }
.demo-reports { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.demo-reports li { padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,0.14); font-size: 12px; font-weight: 500; }
@media (prefers-reduced-motion: reduce) {
  .demo-page.enter, .demo-page.leave, .demo-page .ch.roll, .demo-page .ch.out { animation: none; }
  .demo-page.leave, .demo-page .ch.out { display: none; }
}

/* ---------- HomeKit.sh (/mcp/) ---------- */

.hk-hero-icon { width: 88px; height: 88px; margin: 0 auto 24px; border-radius: 20px; display: grid; place-items: center;
  background: linear-gradient(160deg, #2c2c2e, #000); color: #30d158; box-shadow: 0 10px 30px rgba(0,0,0,0.18); }
.hk-hero-icon svg { width: 52px; height: 52px; stroke-width: 1.4; }
.hk-hero .btn svg, .hk-skill-grid .btn svg { width: 18px; height: 18px; }
.hk-hero .btn-sm svg, .hk-skill-grid .btn-sm svg { width: 14px; height: 14px; }
.hk-fineprint { margin: 20px auto 0; max-width: 560px; font-size: 14px; color: var(--fg-tertiary); }
.hk-term-wrap { padding: clamp(48px, 7vw, 72px) 0 clamp(56px, 8vw, 96px); }
.hk-term { max-width: 720px; margin: 0 auto; text-align: left; border-radius: 14px; overflow: hidden;
  background: #1c1c1e; color: #f5f5f7; box-shadow: 0 30px 80px rgba(0,0,0,0.25), 0 0 0 1px rgba(255,255,255,0.06) inset; }
.hk-term-bar { display: flex; align-items: center; gap: 8px; padding: 12px 14px; background: #2c2c2e; }
.hk-term-bar span { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; }
.hk-term-bar span:nth-child(2) { background: #febc2e; }
.hk-term-bar span:nth-child(3) { background: #28c840; }
.hk-term-bar b { flex: 1; text-align: center; margin-right: 52px; font-size: 13px; font-weight: 500; color: #a1a1a6; }
.hk-term pre { margin: 0; padding: 20px 22px 24px; font: 14px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-x: auto; }
.hk-p { color: #64d2ff; } .hk-ok { color: #30d158; } .hk-a { color: #ffd60a; }

.hk code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.88em; }
.hk :where(.lede, .hk-steps, .hk-card, .hk-safety, .versions, .hk-note) code:not(pre code) {
  padding: 1px 6px; border-radius: 6px; background: var(--chip); color: var(--fg); white-space: nowrap; }

.hk-code { position: relative; margin: 16px 0 0; border-radius: 14px; background: var(--card); border: 1px solid var(--hairline); box-shadow: var(--card-shadow); }
.hk-code pre { margin: 0; padding: 16px 56px 16px 18px; font: 14px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap; overflow-wrap: anywhere; color: var(--fg); }
.hk-code > .hk-copy { position: absolute; top: 8px; right: 8px; }
.hk-copy { display: inline-flex; align-items: center; gap: 6px; height: 32px; min-width: 32px; padding: 0 9px; justify-content: center;
  border-radius: 8px; border: 1px solid var(--hairline); background: var(--bg); color: var(--fg-secondary);
  font: inherit; font-size: 13px; cursor: pointer; transition: color 0.15s, border-color 0.15s; }
.hk-copy:hover { color: var(--fg); border-color: var(--hairline-strong); }
.hk-copy svg { width: 16px; height: 16px; }
.hk-copy.copied, .btn.copied { color: #30d158; border-color: #30d158; }
.btn.copied { background: #30d158; color: #fff; }

.hk-tabs { display: flex; width: max-content; max-width: 100%; margin: 0 auto 24px; gap: 2px; padding: 3px; border-radius: 999px; background: var(--chip); overflow-x: auto; }
.hk-tab { border: 0; background: none; color: var(--fg-secondary); font: inherit; font-size: 15px; padding: 7px 18px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.hk-tab[aria-selected="true"] { background: var(--bg); color: var(--fg); box-shadow: 0 1px 4px rgba(0,0,0,0.12); }
.no-js .hk-tabs { display: none; }
.no-js .hk-panel[hidden] { display: block; margin-top: 24px; }
.hk-prompt .hk-code-head { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 10px 10px 18px; border-bottom: 1px solid var(--hairline); font-size: 13px; color: var(--fg-secondary); }
.hk-prompt pre { padding-right: 18px; font-family: "Inter", system-ui, sans-serif; font-size: 15px; line-height: 1.55; }

.hk-steps { list-style: none; counter-reset: step; padding: 0; margin: 0 auto; max-width: 760px; display: grid; gap: 40px; }
.hk-steps li { counter-increment: step; position: relative; padding-left: 56px; }
.hk-steps li::before { content: counter(step); position: absolute; left: 0; top: -2px; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; background: var(--fg); color: var(--bg); font-weight: 700; font-size: 17px; }
.hk-steps h3, .hk-card h3, .hk-safety h3 { font-size: 21px; letter-spacing: -0.015em; margin: 4px 0 8px; }
.hk-steps p, .hk-card p, .hk-safety p { margin: 0; color: var(--fg-secondary); line-height: 1.5; }
.hk-note { margin-top: 12px !important; font-size: 14px; }

.hk-skill-grid, .hk-usage, .hk-safety { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); }
.hk-card { padding: 24px; border-radius: 18px; background: var(--card); box-shadow: var(--card-shadow); border: 1px solid var(--hairline); min-width: 0; }
.hk-card h3 { display: flex; align-items: center; gap: 10px; }
.hk-card h3 svg { width: 24px; height: 24px; color: var(--accent); flex: none; }
.hk-card > pre { margin: 12px 0 0; font: 13px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.hk-card .hk-code { box-shadow: none; background: var(--bg-alt); }
.hk-left { justify-content: flex-start; margin-top: 18px; }
.hk-details { margin-top: 24px; }
.hk-details summary { cursor: pointer; color: var(--link); font-size: 17px; }
.hk-details pre { max-height: 520px; overflow: auto; font-size: 13px; }
.hk-quote { margin: clamp(48px, 7vw, 72px) auto 0; max-width: 680px; text-align: center; }
.hk-quote p { font-size: clamp(24px, 3vw, 32px); font-weight: 700; letter-spacing: -0.02em; margin: 0 0 12px; }
.hk-quote span { color: var(--fg-secondary); font-size: 17px; }
.hk-exit, .hk-from { margin-top: 40px; }
.hk-from { min-width: 0; }
.hk-subhead { font-size: 28px; letter-spacing: -0.02em; margin: 56px 0 8px; }
.hk-api td:first-child { white-space: nowrap; width: 1%; }
.hk .versions td code { white-space: nowrap; }
@media (max-width: 600px) {
  .hk-steps li { padding-left: 0; padding-top: 48px; }
  .hk-api td:first-child { white-space: normal; }
}

/* ---------------------------------------------------------------- Homebridge tab
   The /homebridge/ pages swap the blue accent for Homebridge's purple (#491F59, from its
   "Verified by Homebridge" badge), lifted for dark mode where the brand colour is too dark to read. */
.theme-homebridge {
  --accent: #491f59;
  --accent-hover: #5c2a72;
  --link: #7a3a99;
  --hb-tint: rgba(73, 31, 89, 0.1);
  --hb-ink: #491f59;
  --gradient-text: linear-gradient(90deg, #b45bd6 0%, #7a3a99 50%, #491f59 100%);
  --hero-glow: radial-gradient(60% 50% at 50% 0%, rgba(122, 58, 153, 0.22), transparent 70%);
  --placeholder-a: #efe6f4;
  --placeholder-b: #f6eef9;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-homebridge {
    --accent: #8e4fb0; --accent-hover: #a062c2; --link: #c792e3;
    --hb-tint: rgba(199, 146, 227, 0.16); --hb-ink: #dcb4f0;
    --gradient-text: linear-gradient(90deg, #e3b2ff 0%, #c792e3 50%, #9b5cc0 100%);
    --hero-glow: radial-gradient(60% 50% at 50% 0%, rgba(155, 92, 192, 0.24), transparent 70%);
    --placeholder-a: #241a2b; --placeholder-b: #2a1d31;
  }
}
:root[data-theme="dark"] .theme-homebridge {
  --accent: #8e4fb0; --accent-hover: #a062c2; --link: #c792e3;
  --hb-tint: rgba(199, 146, 227, 0.16); --hb-ink: #dcb4f0;
  --gradient-text: linear-gradient(90deg, #e3b2ff 0%, #c792e3 50%, #9b5cc0 100%);
  --hero-glow: radial-gradient(60% 50% at 50% 0%, rgba(155, 92, 192, 0.24), transparent 70%);
  --placeholder-a: #241a2b; --placeholder-b: #2a1d31;
}
:is(.theme-homebridge, .theme-homeassistant) a { color: var(--link); }
:is(.theme-homebridge, .theme-homeassistant) .btn, :is(.theme-homebridge, .theme-homeassistant) .btn:hover { color: #fff; }
:is(.theme-homebridge, .theme-homeassistant) .btn-secondary { color: var(--link); border-color: var(--link); }
:is(.theme-homebridge, .theme-homeassistant) .btn-secondary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
:is(.theme-homebridge, .theme-homeassistant) .acc-card a, :is(.theme-homebridge, .theme-homeassistant) .globalnav a, :is(.theme-homebridge, .theme-homeassistant) .localnav a:not(.btn),
:is(.theme-homebridge, .theme-homeassistant) .footer a, :is(.theme-homebridge, .theme-homeassistant) .crumbs a { color: inherit; }
:is(.theme-homebridge, .theme-homeassistant) .crumbs a { color: var(--link); }
:is(.theme-homebridge, .theme-homeassistant) .chip[aria-pressed="true"] { background: var(--accent); color: #fff; box-shadow: none; }
:is(.theme-homebridge, .theme-homeassistant) .globalnav a[aria-current="page"], :is(.theme-homebridge, .theme-homeassistant) .localnav-links a[aria-current="page"] { color: var(--hb-ink); }
:is(.theme-homebridge, .theme-homeassistant) .hb-hero { background: var(--hero-glow); }
:is(.theme-homebridge, .theme-homeassistant) .acc-group-header svg { color: var(--hb-ink); }
:is(.theme-homebridge, .theme-homeassistant) .badge.matter { background: rgba(10, 132, 255, 0.14); color: #0066cc; }

.hb-facts { list-style: none; padding: 0; margin: 36px auto 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; max-width: 900px; }
.hb-facts li { display: flex; flex-direction: column; align-items: center; padding: 14px 10px; border-radius: 18px; background: var(--hb-tint); }
@media (max-width: 720px) { .hb-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hb-facts li:last-child { grid-column: span 2; } }
.hb-facts strong { font-size: 28px; letter-spacing: -0.02em; color: var(--hb-ink); font-variant-numeric: tabular-nums; }
.hb-facts span { font-size: 13px; color: var(--fg-secondary); max-width: 140px; line-height: 1.3; }

.hb-icon { background: #fff; }
.acc-thumb.hb-icon { padding: 0; }
.acc-thumb.hb-icon img { inset: 18%; width: 64%; height: 64%; border-radius: 22%; }
.detail-image.hb-icon { padding: 20%; }
.detail-image.hb-icon img { inset: 20%; width: 60%; height: 60%; border-radius: 22%; }
.hb-glyph { background: var(--hb-tint) !important; color: var(--hb-ink) !important; }
.hb-card .acc-meta { gap: 3px; }
.hb-pkg { font: 500 12px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--fg-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-stats { font-size: 12px; color: var(--fg-secondary); font-variant-numeric: tabular-nums; }

.badge.hbverified { background: var(--accent); color: #fff; }
.badge.local { background: rgba(48, 209, 88, 0.16); color: #1f8a3c; }
.badge.cloud { background: rgba(142, 142, 147, 0.18); color: var(--fg-secondary); }
.badge.localcloud { background: rgba(100, 210, 255, 0.18); color: #0a7ea4; }
.badge.hb2 { background: var(--hb-tint); color: var(--hb-ink); }
.badge.big { font-size: 14px; padding: 6px 14px; }
.tag-dot.hb-verified { color: var(--accent); }
.tag-dot.hb-unverified { background: transparent; box-shadow: inset 0 0 0 1.5px var(--fg-tertiary); }
.tag-dot.hb-local { color: #30d158; }
.tag-dot.hb-cloud { color: #8e8e93; }
.tag-dot.hb-local-cloud { color: #64d2ff; }
.tag-dot.hb-conn-unknown, .tag-dot.hb-stale { background: transparent; box-shadow: inset 0 0 0 1.5px var(--fg-tertiary); }
.tag-dot.hb-hb2, .tag-dot.hb-config-ui { color: var(--hb-ink); }
.tag-dot.hb-matter { color: #0a84ff; }
.tag-dot.hb-active { color: #30d158; }

.hb-summary { font-size: 19px; line-height: 1.45; color: var(--fg-secondary); margin: 18px 0 0; max-width: 620px; }
.detail-copy code, .hb-chips.mono li { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; }
.hb-label { font-size: 13px !important; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--fg-tertiary) !important; margin: 20px 0 10px !important; }
.hb-label:first-of-type { margin-top: 0 !important; }
.hb-label small { text-transform: none; letter-spacing: 0; font-weight: 400; }
.hb-chips, .hb-types { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.hb-chips li { padding: 6px 12px; border-radius: 999px; background: var(--hb-tint); color: var(--hb-ink); font-size: 14px; font-weight: 600; }
.hb-chips.plain li { background: transparent; color: var(--fg); font-weight: 500; box-shadow: inset 0 0 0 1px var(--hairline-strong); }
.hb-chips.mono li { font-weight: 500; }
.hb-types a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--hb-tint); color: var(--hb-ink); font-size: 14px; font-weight: 600; text-decoration: none; }
.hb-types a:hover { background: var(--accent); color: #fff; }
.hb-types svg { width: 15px; height: 15px; }
.hb-list { margin: 0; padding-left: 20px; color: var(--fg-secondary); }
.hb-method { max-width: 760px; margin: 72px auto 0; padding: 28px 32px; border-radius: 24px; background: var(--bg-alt); }
.hb-method h2 { font-size: 21px; margin: 0 0 10px; }
.hb-method p { color: var(--fg-secondary); font-size: 15px; margin: 0 0 10px; }
.panel ul.hb-chips, .panel ul.hb-types, .panel ul.reading-list { padding: 0; }
/* Homebridge's verified icons are 100px squares: show them small, beside the copy. */
.hb-detail-hero { grid-template-columns: 220px 1fr; padding-bottom: clamp(40px, 6vw, 64px); }
.hb-detail-hero .detail-image { border-radius: 44px; padding: 18%; }
.hb-detail-hero .detail-image img { inset: 18%; width: 64%; height: 64%; }
.hb-detail-hero .detail-image.hb-icon img { border-radius: 22%; }
@media (max-width: 833px) { .hb-detail-hero { grid-template-columns: 1fr; } .hb-detail-hero .detail-image { width: 160px; } }
.hb-facts { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); max-width: 1000px; }
@media (max-width: 720px) { .hb-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hb-facts li:last-child { grid-column: auto; } }
.badge.st-works { background: rgba(48, 209, 88, 0.16); color: #1f8a3c; }
.badge.st-partial { background: rgba(255, 159, 10, 0.18); color: #b86200; }
.badge.st-broken { background: rgba(255, 69, 58, 0.14); color: #d7372b; }
.badge.st-requested { background: transparent; box-shadow: inset 0 0 0 1px var(--hairline-strong); color: var(--fg-secondary); }
.badge.st-unsupported { background: rgba(142, 142, 147, 0.2); color: var(--fg-secondary); }
.hb-status-counts { list-style: none; padding: 0 !important; margin: 4px 0 18px; display: flex; flex-wrap: wrap; gap: 14px; }
.hb-status-counts li { display: flex; align-items: center; gap: 6px; }
.hb-status-counts strong { font-variant-numeric: tabular-nums; }
.hb-reports td:first-child { font-weight: 600; color: var(--fg); }
.hb-reports td { vertical-align: top; }
.hb-reports td:nth-child(2) { white-space: nowrap; }
.hb-reports td:last-child { white-space: nowrap; font-size: 14px; }
.hb-more { margin-top: 12px; }
.hb-more summary { cursor: pointer; color: var(--link); font-weight: 600; padding: 8px 0; }
.tag-dot.hb-reports, .tag-dot.hb-device-list { color: #30d158; }
.tag-dot.hb-reports-broken { color: #ff453a; }
.detail-sections > * { min-width: 0; }
@media (max-width: 833px) { .detail-sections { grid-template-columns: minmax(0, 1fr); } }
/* Status dots in the Works with Homebridge filter panel borrow the status badge colours. */
.badge.dot { width: 10px; height: 10px; padding: 0; border-radius: 50%; flex: none; }
.badge.st-works.dot { background: #30d158; }
.badge.st-partial.dot { background: #ff9f0a; }
.badge.st-broken.dot { background: #ff453a; }
.badge.st-unsupported.dot { background: #8e8e93; }
.hb-reports code.hb-pkg { font-size: 12px; }
.badge.st-mixed { background: rgba(255, 159, 10, 0.12); color: #a85a00; box-shadow: inset 0 0 0 1px rgba(255, 159, 10, 0.45); }
.badge.st-mixed.dot { background: linear-gradient(90deg, #30d158 50%, #ff453a 50%); box-shadow: none; }
.badge.st-requested.dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--fg-tertiary); }
.hb-tally { margin-top: 10px; }
/* Saved copy of a report's source, kept in case the original is edited or deleted. */
.hb-saved { margin-top: 6px; font-size: 14px; }
.hb-saved summary { cursor: pointer; color: var(--link); font-weight: 500; list-style: none; }
.hb-saved summary::-webkit-details-marker { display: none; }
.hb-saved summary::before { content: "›"; display: inline-block; margin-right: 6px; transition: transform 0.15s; }
.hb-saved[open] summary::before { transform: rotate(90deg); }
.hb-saved blockquote { margin: 8px 0 4px; padding: 8px 12px; border-left: 3px solid var(--accent); background: var(--bg-alt); border-radius: 0 10px 10px 0; color: var(--fg); white-space: normal; max-width: 520px; }
.hb-saved .muted { font-size: 12px; margin: 0; }
/* Homebridge plugins that can bridge an AirPlay-only TV into the Home app (TV pages and the TVs topic). */
.tv-bridge h2 + p { margin-bottom: 12px; }
.tv-bridge h2 + p .badge { font-size: 14px; padding: 5px 12px; }
.bridge-plugins { list-style: none; padding: 0 !important; margin: 16px 0; }
.bridge-plugins li { padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.bridge-plugins li:last-child { border-bottom: 0; }
.bridge-plugins code.hb-pkg { font-size: 12px; color: var(--fg-secondary); margin-left: 6px; overflow-wrap: anywhere; }
.bridge-plugins li span { display: block; color: var(--fg-secondary); font-size: 14px; margin-top: 2px; }
.bridge-sources-title { margin-top: 16px; color: var(--fg-secondary); font-size: 14px; }
.tv-bridges { margin: 0 0 24px; padding: 20px 24px; border-radius: 18px; background: var(--bg-elevated, var(--bg)); box-shadow: inset 0 0 0 1px var(--hairline); }
.tv-bridges h4 { font-size: 17px; margin: 0 0 6px; }
.tv-bridges > p { color: var(--fg-secondary); font-size: 15px; margin: 0 0 12px; }
.tv-bridges .versions { min-width: 0; }
.tv-bridges td { vertical-align: top; }
.tv-bridges td .badge { white-space: nowrap; margin-top: 6px; }
.tv-bridges td:first-child { width: 55%; }
@media (max-width: 600px) { .tv-bridges { padding: 16px; } }

/* ---------------------------------------------------------------- Home Assistant tab
   The /home-assistant/ pages use Home Assistant's blue (#18BCF2 in its logo), deepened so white button text
   stays readable; the rules shared with the Homebridge tab are written for both themes above. */
.theme-homeassistant {
  --accent: #0b7fc0;
  --accent-hover: #0a6fa8;
  --link: #0a73ad;
  --hb-tint: rgba(24, 188, 242, 0.12);
  --hb-ink: #065a8a;
  --gradient-text: linear-gradient(90deg, #41bdf5 0%, #18a3e0 50%, #0b7fc0 100%);
  --hero-glow: radial-gradient(60% 50% at 50% 0%, rgba(24, 188, 242, 0.22), transparent 70%);
  --placeholder-a: #e3f4fc;
  --placeholder-b: #eef8fd;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-homeassistant {
    --accent: #1488c9; --accent-hover: #1a97dc; --link: #6fd0f8;
    --hb-tint: rgba(65, 189, 245, 0.16); --hb-ink: #9fdffb;
    --gradient-text: linear-gradient(90deg, #a6e4ff 0%, #6fd0f8 50%, #2ea8e6 100%);
    --hero-glow: radial-gradient(60% 50% at 50% 0%, rgba(46, 168, 230, 0.24), transparent 70%);
    --placeholder-a: #15232c; --placeholder-b: #182a34;
  }
}
:root[data-theme="dark"] .theme-homeassistant {
  --accent: #1488c9; --accent-hover: #1a97dc; --link: #6fd0f8;
  --hb-tint: rgba(65, 189, 245, 0.16); --hb-ink: #9fdffb;
  --gradient-text: linear-gradient(90deg, #a6e4ff 0%, #6fd0f8 50%, #2ea8e6 100%);
  --hero-glow: radial-gradient(60% 50% at 50% 0%, rgba(46, 168, 230, 0.24), transparent 70%);
  --placeholder-a: #15232c; --placeholder-b: #182a34;
}
.tag-dot.ha-core, .tag-dot.ha-hk-devices, .tag-dot.ha-core-int { color: var(--accent); }
.tag-dot.ha-hacs, .tag-dot.ha-hacs-int, .tag-dot.ha-multi { color: var(--hb-ink); }
.tag-dot.ha-local-push, .tag-dot.ha-local-polling, .tag-dot.ha-local, .tag-dot.ha-active, .tag-dot.ha-hk-works,
.tag-dot.ha-reports, .tag-dot.ha-device-list, .tag-dot.ha-reports-homekit, .tag-dot.ha-listed, .tag-dot.ha-pr { color: #30d158; }
.tag-dot.ha-cloud-push, .tag-dot.ha-cloud-polling, .tag-dot.ha-cloud { color: #8e8e93; }
.tag-dot.ha-hk-sensors, .tag-dot.ha-thread, .tag-dot.ha-reddit, .tag-dot.ha-forked { color: #64d2ff; }
.tag-dot.ha-hk-accessory, .tag-dot.ha-hk-trouble, .tag-dot.ha-reports-broken { color: #ff9f0a; }
.tag-dot.ha-assumed, .tag-dot.ha-conn-unknown, .tag-dot.ha-stale, .tag-dot.ha-q-legacy { background: transparent; box-shadow: inset 0 0 0 1.5px var(--fg-tertiary); }
.tag-dot.ha-q-platinum { color: #8e9aa6; } .tag-dot.ha-q-gold { color: #d4a017; } .tag-dot.ha-q-silver { color: #b0b6bd; } .tag-dot.ha-q-bronze { color: #b87333; }
.theme-homeassistant .badge.matter { background: rgba(212, 160, 23, 0.16); color: #8a6400; }
.ha-reports td:nth-child(3) small { display: block; color: var(--fg-secondary); margin-top: 4px; white-space: normal; min-width: 140px; }
.ha-reports td:nth-child(2) .badge + .badge { margin-left: 4px; }
.ha-bridge td:first-child { font-weight: 600; white-space: nowrap; }
.ha-bridge-explainer h3 { font-size: 17px; margin: 22px 0 6px; }
.ha-bridge-explainer .table-scroll { margin: 14px 0; }
.hb-hero .cta-row { justify-content: center; margin-top: 28px; }
.ha-listed li { font-size: 13px; }
