/* Brand assets follow the current KOMA application. */
.brand-mark { border-color: var(--line-strong); border-radius: 11px; background: var(--accent-soft); color: var(--accent); }
.brand-mark .brand-symbol { width: 31px; height: 31px; }
.brand-title { font-family: var(--sans); font-size: 19px; font-weight: 600; line-height: 1.25; letter-spacing: .015em; }
.brand-sub { font-size: 8px; letter-spacing: .19em; margin-top: 4px; }

/* Every slide shares one canvas; images keep their original proportions. */
.browser-viewport, .browser-viewport.mobile-mode {
  position: relative; display: block; aspect-ratio: 16 / 10;
  min-height: 0; padding: 0; width: 100%;
}
.browser-viewport img, .browser-viewport.mobile-mode img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  max-width: 100%; max-height: 100%; padding: 14px;
  object-fit: contain; object-position: center;
  border: 0; border-radius: 0; box-shadow: none;
}
.carousel-toggle svg { width: 13px; height: 13px; }
.carousel-toggle .play-icon { display: none; }
.carousel-toggle[aria-pressed="true"] .pause-icon { display: none; }
.carousel-toggle[aria-pressed="true"] .play-icon { display: block; }
.stage-caption { min-height: 2.2em; }

/* All three source paths remain visible, without mode tabs. */
.sync-route { display: grid; grid-template-columns: 1.35fr .65fr .8fr .65fr 1fr; gap: 20px; align-items: center; padding: 24px 12px; }
.sync-route + .sync-route { border-top: 1px solid var(--line); }
.route-source, .route-output { display: flex; flex-direction: column; gap: 6px; }
.route-source strong, .route-output strong { font-size: 14px; font-weight: 500; }
.route-source small, .route-output small { font-size: 11px; color: var(--muted); }
.route-output { text-align: right; }
.route-engine { display: flex; justify-content: center; align-items: center; gap: 9px; color: var(--accent); }
.route-engine .brand-symbol { width: 32px; height: 32px; flex-shrink: 0; }
.route-engine span { font-family: var(--sans); font-size: 12px; letter-spacing: .08em; font-weight: 500; }
.route-line { height: 1px; position: relative; background: var(--line-strong); overflow: hidden; }
.route-line span { position: absolute; width: 32%; height: 1px; background: var(--accent); animation: flow-travel 3s ease-in-out infinite; }
.sync-route:nth-child(2) .route-line span { animation-delay: .7s; }
.sync-route:nth-child(3) .route-line span { animation-delay: 1.4s; }
.sync-route .route-line:nth-of-type(4) span { animation-delay: .4s; }
.sync-routes .sync-note { margin-top: 8px; }

/* A small, transparent companion, independent of page sections. */
.desktop-pet { position: fixed; z-index: 130; right: max(18px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); width: 128px; user-select: none; -webkit-user-select: none; }
.desktop-pet .cat-corner { position: relative; inset: auto; width: 128px; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; cursor: grab; touch-action: none; animation: none; }
.desktop-pet .cat-corner:hover { transform: none; }
.desktop-pet.is-dragging .cat-corner { cursor: grabbing; }
.desktop-pet .cat-svg-box { width: 128px; height: 120px; transform-origin: 50% 90%; }
.pet-controls { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: -3px; }
.pet-control { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; background: var(--header-bg); color: var(--muted); border: 1px solid var(--line-strong); border-radius: 50%; backdrop-filter: blur(10px); transition: color .2s, transform .25s var(--motion-ease), background-color .2s; }
.pet-control svg { width: 13px; height: 13px; }
.pet-control:hover, .pet-control[aria-pressed="true"] { color: var(--accent); background: var(--surface); }
.pet-control:hover { transform: translateY(-2px); }
.pet-control:active { transform: scale(.92); }
.pet-effects { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.pet-heart { position: absolute; width: 14px; height: 14px; color: #b77768; left: 58px; top: 35px; }
.desktop-pet.is-sleeping .paper-cat-art .eye { animation: none; transform: scaleY(.14); }
.desktop-pet.is-sleeping .paper-cat-art .cat { animation-duration: 6s; }
.desktop-pet.is-sleeping .paper-cat-art .tail { animation-play-state: paused; }
.desktop-pet.is-petting .paper-cat-art .eye { animation: none; transform: scaleY(.2); }

@media(max-width:640px) {
  .brand-title { font-size: 17px; }
  .brand-mark .brand-symbol { width: 28px; height: 28px; }
  .browser-viewport, .browser-viewport.mobile-mode { aspect-ratio: 4 / 3; }
  .browser-viewport img, .browser-viewport.mobile-mode img { padding: 8px; }
  .stage-caption { min-height: 3.2em; font-size: 12px; }
  .sync-route { grid-template-columns: 1.15fr .2fr .65fr .2fr .9fr; gap: 8px; padding: 22px 0; }
  .route-source strong, .route-output strong { font-size: 12px; }
  .route-source small, .route-output small { font-size: 10px; line-height: 1.6; }
  .route-engine { flex-direction: column; gap: 4px; }
  .route-engine .brand-symbol { width: 27px; height: 27px; }
  .route-engine span { font-size: 9px; }
  .desktop-pet { width: 112px; right: max(10px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); }
  .desktop-pet .cat-corner, .desktop-pet .cat-svg-box { width: 112px; }
  .desktop-pet .cat-svg-box { height: 105px; }
  .pet-controls { gap: 2px; }
  .pet-control { width: 25px; height: 25px; }
}
@media(prefers-reduced-motion:reduce) {
  .route-line span { animation: none; }
  .pet-control:hover, .pet-control:active { transform: none; }
}

/* Bottom iPhone Scriptable widget section */
.widget-layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 64px;
  align-items: center;
}
.widget-copy h2 {
  margin-bottom: 14px;
}
.widget-lead {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.75;
  max-width: 500px;
  margin: 0 0 26px;
}
.widget-points {
  list-style: none;
  padding: 0;
  margin: 0 0 30px;
  border-top: 1px solid var(--line);
}
.widget-points li {
  display: grid;
  grid-template-columns: 28px 116px 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.widget-points li > span {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--subtle);
}
.widget-points li strong {
  font-size: 13.5px;
  font-weight: 500;
}
.widget-points li p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.65;
}
.widget-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.widget-showcase {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.widget-frame {
  width: 100%;
  max-width: 410px;
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.widget-shot {
  width: 100%;
  height: auto;
  border-radius: 14px;
}
.widget-shot-dark {
  display: none;
}
[data-theme="dark"] .widget-shot-light {
  display: none;
}
[data-theme="dark"] .widget-shot-dark {
  display: block;
}
.widget-note {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 900px) {
  .widget-layout {
    grid-template-columns: 1fr;
    gap: 36px;
  }
}
@media (max-width: 640px) {
  .widget-points li {
    grid-template-columns: 24px 1fr;
    gap: 4px 10px;
  }
  .widget-points li p {
    grid-column: 2;
  }
  .widget-frame {
    padding: 12px;
  }
}
