.lens-cloudscape {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 420ms ease;
}

.lens-cloud-group {
  position: absolute;
  top: clamp(168px, 20vh, 210px);
  left: 0;
  width: clamp(300px, 34vw, 440px);
  height: clamp(96px, 9vw, 128px);
  opacity: 0.72;
  transform: translate3d(-105%, 0, 0);
  animation: lens-cloud-drift 34s linear -15.2s infinite;
  will-change: transform;
}

.lens-cloud {
  position: absolute;
  width: 62%;
  height: 22%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.32);
  filter: blur(0.8px);
  animation: lens-cloud-stagger 22s ease-in-out infinite alternate;
  will-change: transform;
}

.lens-cloud::before,
.lens-cloud::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: inherit;
}

.lens-cloud::before {
  left: 16%;
  bottom: 0;
  width: 44%;
  height: 250%;
}

.lens-cloud::after {
  right: 10%;
  bottom: 0;
  width: 54%;
  height: 185%;
}

.lens-cloud:nth-child(1) {
  left: 0;
  top: 54%;
  opacity: 0.84;
  animation-delay: -4s;
}

.lens-cloud:nth-child(2) {
  left: 24%;
  top: 8%;
  opacity: 0.64;
  animation-delay: -11s;
}

.lens-cloud:nth-child(3) {
  right: 0;
  top: 42%;
  opacity: 0.5;
  animation-delay: -17s;
}

html[data-theme="light"] .lens-cloudscape {
  opacity: 1;
}

html[data-theme="dark"] .lens-cloudscape {
  opacity: 0;
}

@keyframes lens-cloud-drift {
  from {
    transform: translate3d(-105%, 0, 0);
  }

  to {
    transform: translate3d(calc(100vw + 5%), 0, 0);
  }
}

@keyframes lens-cloud-stagger {
  from {
    transform: translate3d(-7px, 2px, 0);
  }

  to {
    transform: translate3d(14px, -2px, 0);
  }
}

.thread-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid rgba(216, 180, 119, 0.42);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: #f1ece0;
  font: 9px/1 var(--mono, "DM Mono", monospace);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.thread-theme-toggle .theme-icon {
  color: #d8b477;
  font-size: 14px;
  line-height: 1;
}

.thread-theme-toggle .theme-label {
  display: inline;
  white-space: nowrap;
}

.thread-theme-toggle:is(:hover, :focus-visible) {
  border-color: #d8b477;
  background: #d8b477;
  color: #1b211c;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
}

.thread-theme-toggle:is(:hover, :focus-visible) .theme-icon {
  color: inherit;
}

.thread-theme-toggle:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

html[data-theme="light"] .thread-theme-toggle {
  border-color: rgba(57, 86, 67, 0.34);
  background: rgba(255, 255, 255, 0.42);
  color: #263a2e;
}

html[data-theme="light"] .thread-theme-toggle .theme-icon {
  color: #8e5c2f;
}

html[data-theme="light"] .thread-theme-toggle:is(:hover, :focus-visible) {
  border-color: #356f50;
  background: #356f50;
  color: #fffdf6;
}

.nyarindo-thread-footer > .thread-theme-toggle,
.experiment-signoff > .thread-theme-toggle {
  flex: 0 0 auto;
  margin-left: auto;
}

@media (max-width: 650px) {
  .nyarindo-thread-footer > .thread-theme-toggle,
  .experiment-signoff > .thread-theme-toggle {
    align-self: flex-start;
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lens-cloud-group {
    animation: none;
    transform: translate3d(clamp(18px, 18vw, 240px), 0, 0);
    will-change: auto;
  }

  .lens-cloud {
    animation: none;
    will-change: auto;
  }

  .thread-theme-toggle {
    transition: none;
  }
}

.download-support-notice {
  --download-support-bg: rgba(14, 22, 18, 0.97);
  --download-support-ink: #f6f2e7;
  --download-support-muted: #bcc9bd;
  --download-support-line: rgba(142, 181, 162, 0.32);
  --download-support-gold: #e0b979;
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 1500;
  display: grid;
  gap: 15px;
  width: min(470px, calc(100vw - 36px));
  padding: 20px;
  border: 1px solid var(--download-support-line);
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0, rgba(88, 157, 116, 0.18), transparent 42%),
    linear-gradient(145deg, rgba(23, 31, 25, 0.98), var(--download-support-bg));
  color: var(--download-support-ink);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.42);
  animation: download-support-arrive 260ms ease-out both;
}

.download-support-notice[hidden] {
  display: none;
}

.download-support-eyebrow {
  margin: 0 0 7px;
  color: var(--download-support-gold);
  font: 9px/1.4 var(--mono, monospace);
  letter-spacing: 0.14em;
}

.download-support-title {
  display: block;
  font: 400 clamp(21px, 3vw, 27px)/1.08 var(--serif, Georgia, serif);
}

.download-support-body {
  margin: 9px 0 0;
  color: var(--download-support-muted);
  font-size: 12px;
  line-height: 1.65;
}

.download-support-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.download-support-link,
.download-support-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--download-support-line);
  border-radius: 999px;
  font: 9px/1.3 var(--mono, monospace);
  letter-spacing: 0.06em;
}

.download-support-link {
  background: var(--download-support-gold);
  color: #17130e;
}

.download-support-close {
  background: transparent;
  color: var(--download-support-muted);
  cursor: pointer;
}

.download-support-link:is(:hover, :focus-visible),
.download-support-close:is(:hover, :focus-visible) {
  border-color: var(--download-support-gold);
  outline: none;
}

html[data-theme="light"] .download-support-notice {
  --download-support-bg: rgba(250, 247, 237, 0.98);
  --download-support-ink: #25352b;
  --download-support-muted: #596b5f;
  --download-support-line: rgba(72, 103, 81, 0.28);
  --download-support-gold: #8e5b28;
  box-shadow: 0 24px 70px rgba(40, 52, 41, 0.2);
}

html .reader-dialog .download-support-notice {
  --download-support-bg: rgba(8, 19, 15, 0.99);
  --download-support-ink: #fffaf0;
  --download-support-muted: #d1dad2;
  --download-support-line: rgba(224, 185, 121, 0.42);
  --download-support-gold: #f0c77f;
  background:
    radial-gradient(circle at 100% 0, rgba(88, 157, 116, 0.24), transparent 42%),
    linear-gradient(145deg, rgba(24, 35, 28, 0.995), var(--download-support-bg));
  color: var(--download-support-ink);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.62);
}

@keyframes download-support-arrive {
  from {
    transform: translateY(12px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 520px) {
  .download-support-notice {
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    left: 12px;
    width: auto;
    padding: 17px;
  }

  .download-support-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .download-support-link,
  .download-support-close {
    width: 100%;
    min-height: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .download-support-notice {
    animation: none;
  }
}

/* Vivid daylight controls and perfect circular colour pickers across the Nyarindo apps. */
html[data-theme="light"] .site-theme-toggle,
html[data-theme="light"] .theme-toggle,
html[data-theme="light"] .theme-button,
html[data-theme="light"] .library-theme {
  border-color: rgba(23, 111, 150, .34);
  background:
    linear-gradient(135deg, rgba(255, 248, 218, .95), rgba(156, 220, 244, .78)),
    #f9f6e9;
  color: #174657;
  box-shadow: 0 5px 16px rgba(28, 104, 132, .12);
}

html[data-theme="light"] .site-theme-toggle .theme-icon,
html[data-theme="light"] .theme-toggle .theme-icon,
html[data-theme="light"] .theme-button .theme-icon,
html[data-theme="light"] .library-theme .theme-icon {
  color: #b4792b;
}

html[data-theme="light"] .site-theme-toggle:is(:hover, :focus-visible),
html[data-theme="light"] .theme-toggle:is(:hover, :focus-visible),
html[data-theme="light"] .theme-button:is(:hover, :focus-visible),
html[data-theme="light"] .library-theme:is(:hover, :focus-visible) {
  border-color: #e8ad46;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, .94), transparent 35%),
    linear-gradient(135deg, #ffd978, #77c8ec);
  color: #102f3b;
  box-shadow: 0 0 0 4px rgba(68, 164, 205, .12), 0 9px 24px rgba(24, 101, 132, .22);
}

input[type="color"] {
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  aspect-ratio: 1 / 1;
  padding: 0 !important;
  overflow: hidden;
  border-radius: 50% !important;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
  border-radius: 50%;
}

input[type="color"]::-webkit-color-swatch {
  border: 2px solid rgba(255, 255, 255, .72);
  border-radius: 50%;
}

input[type="color"]::-moz-color-swatch {
  border: 2px solid rgba(255, 255, 255, .72);
  border-radius: 50%;
}

input[type="color"]:focus-visible {
  outline: 2px solid var(--accent, #5bb8e8);
  outline-offset: 3px;
}

.nyarindo-theme-header {
  position: sticky;
  z-index: 40;
  top: 0;
}

button:not(:disabled) {
  --nyarindo-button-halo: color-mix(in srgb, currentColor 54%, #5bb8e8);
  transition:
    color .2s ease,
    background-color .2s ease,
    border-color .2s ease,
    box-shadow .2s ease,
    filter .2s ease,
    transform .2s ease;
}

button:not(:disabled):is(:hover, :focus-visible) {
  filter: saturate(1.28) brightness(1.07);
  transform: translateY(-2px) scale(1.012);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--nyarindo-button-halo) 18%, transparent),
    0 8px 24px color-mix(in srgb, var(--nyarindo-button-halo) 30%, transparent),
    inset 0 1px rgba(255, 255, 255, .16);
}

button:not(:disabled):focus-visible {
  outline: 2px solid var(--nyarindo-button-halo);
  outline-offset: 3px;
}

button:not(:disabled):active {
  transform: translateY(0) scale(.975);
}

@media (prefers-reduced-motion: reduce) {
  button:not(:disabled) {
    transition: none !important;
  }

  button:not(:disabled):is(:hover, :focus-visible),
  button:not(:disabled):active {
    transform: none !important;
  }
}

/*
 * Shared native-app finish: the apps keep their own colour identities and layouts,
 * while touch, focus, form, scrolling, selection, and safe-area behavior stay coherent.
 */
:root {
  --nyarindo-native-ease: cubic-bezier(.2, .78, .22, 1);
  --nyarindo-native-quick: 180ms;
  --nyarindo-native-calm: 320ms;
  --nyarindo-native-focus: color-mix(in srgb, var(--accent, currentColor) 68%, #5bb8e8);
  --nyarindo-native-hairline: color-mix(in srgb, currentColor 14%, transparent);
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-color:
    color-mix(in srgb, currentColor 25%, transparent)
    color-mix(in srgb, currentColor 4%, transparent);
  scrollbar-width: thin;
}

body {
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain !important;
  text-rendering: optimizeLegibility;
}

button,
a,
summary,
input,
select,
textarea {
  touch-action: manipulation;
}

button {
  user-select: none;
  -webkit-user-select: none;
}

::selection {
  background: color-mix(in srgb, var(--nyarindo-native-focus) 34%, transparent);
  color: inherit;
}

:where(
  input:not([type="color"]):not([type="range"]),
  select,
  textarea
) {
  accent-color: var(--nyarindo-native-focus);
  caret-color: var(--nyarindo-native-focus);
  transition:
    border-color var(--nyarindo-native-quick) ease,
    background-color var(--nyarindo-native-quick) ease,
    box-shadow var(--nyarindo-native-quick) ease;
}

:where(
  input:not([type="color"]):not([type="range"]),
  select,
  textarea
):focus-visible {
  outline: 2px solid var(--nyarindo-native-focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--nyarindo-native-focus) 14%, transparent);
}

:where(
  .install-note,
  .source-action,
  .soft-button,
  .theme-toggle,
  .theme-button,
  .library-theme,
  .site-theme-toggle,
  .quiet-action,
  .profile-button
):focus-visible {
  scroll-margin-block: 96px;
}

:where(
  [class*="floating"],
  [id*="floating"],
  .reader-focus-hint
) {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (pointer: coarse) {
  :where(
    .install-note,
    .source-action,
    .soft-button,
    .theme-toggle,
    .theme-button,
    .library-theme,
    .site-theme-toggle,
    .quiet-action,
    .profile-button
  ) {
    min-height: 44px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  :where(
    input:not([type="color"]):not([type="range"]),
    select,
    textarea
  ) {
    transition: none;
  }
}
