:root {
  --bg: #ffffff;
  --bg-rgb: 255, 255, 255;
  --edge-offset: 20px;
  --header-height: 44px;
  --ui-font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --bubble-font: "SF Pro Text", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --text: #0a0a0a;
  --glass-bright: rgba(250, 252, 255, 0.96);
  --glass-mid: rgba(238, 242, 246, 0.92);
  --glass-dim: rgba(232, 236, 241, 0.9);
  --glass-edge: rgba(255, 255, 255, 0.7);
  --glass-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  --glass-inner: rgba(255, 255, 255, 0.5);
  --glass-highlight: rgba(255, 255, 255, 0.7);
  --glass-outline: rgba(170, 176, 186, 0.18);
  --glass-inner-line: rgba(255, 255, 255, 0.4);
  --ripple: rgba(var(--bg-rgb), 0.7);
  --ripple-shadow: rgba(0, 0, 0, 0.08);
  --ripple-line: rgba(78, 86, 98, 0.24);
  --toggle-bg: rgba(255, 255, 255, 0.65);
  --toggle-border: rgba(0, 0, 0, 0.08);
}

body[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-rgb: 10, 10, 10;
  --text: #f1f1f1;
  --glass-bright: rgba(52, 52, 52, 0.94);
  --glass-mid: rgba(36, 36, 36, 0.94);
  --glass-dim: rgba(26, 26, 26, 0.96);
  --glass-edge: rgba(0, 0, 0, 0);
  --glass-shadow: 0 18px 42px rgba(0, 0, 0, 0.65);
  --glass-inner: rgba(255, 255, 255, 0);
  --glass-highlight: rgba(255, 255, 255, 0);
  --glass-outline: rgba(255, 255, 255, 0);
  --glass-inner-line: rgba(255, 255, 255, 0);
  --ripple: rgba(var(--bg-rgb), 0.7);
  --ripple-shadow: rgba(0, 0, 0, 0.08);
  --ripple-line: rgba(255, 255, 255, 0.22);
  --toggle-bg: rgba(18, 18, 18, 0.72);
  --toggle-border: rgba(255, 255, 255, 0.08);
}

body[data-theme="sunset"] {
  --sunset-cycle: 76s;
  --sunset-pulse-cycle: 34s;
  --bg:
    radial-gradient(
      160% 140% at 50% 30%,
      rgba(255, 248, 242, 0.56) 0%,
      rgba(255, 232, 220, 0.4) 18%,
      rgba(244, 194, 184, 0.26) 36%,
      rgba(170, 185, 214, 0.18) 52%,
      rgba(104, 136, 196, 0.14) 68%,
      rgba(16, 30, 62, 0.08) 82%
    ),
    linear-gradient(
      0deg,
      #01040a 0%,
      #02060f 6%,
      #040b16 12%,
      #081324 18%,
      #11203a 24%,
      #1a3052 30%,
      #28456f 36%,
      #3c6292 42%,
      #5a80af 48%,
      #7699c2 54%,
      #95b2d2 60%,
      #b4c7de 66%,
      #d0d4df 72%,
      #e1c4bc 78%,
      #efb9a5 84%,
      #f5c0aa 90%,
      #f6d3bf 95%,
      #f5e5d8 100%
    );
  --bg-rgb: 220, 178, 164;
  --text: #f2e3d7;
  --glass-bright: rgba(245, 242, 238, 0.92);
  --glass-mid: rgba(231, 226, 220, 0.9);
  --glass-dim: rgba(214, 207, 200, 0.9);
  --glass-edge: rgba(255, 255, 255, 0);
  --glass-shadow: 0 20px 50px rgba(24, 12, 8, 0.45);
  --glass-inner: rgba(255, 255, 255, 0.3);
  --glass-highlight: rgba(255, 255, 255, 0.55);
  --glass-outline: rgba(255, 255, 255, 0);
  --glass-inner-line: rgba(255, 255, 255, 0);
  --ripple-line: rgba(255, 232, 220, 0.28);
  --toggle-bg: rgba(58, 46, 42, 0.7);
  --toggle-border: rgba(255, 214, 194, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--ui-font);
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

body[data-theme="sunset"] {
  background-color: #02050b;
  background: #02050b;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
  isolation: isolate;
}

#sunset-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: 1;
  isolation: isolate;
  transition: opacity 0.08s linear;
}

body[data-theme="sunset"] #sunset-layer {
  opacity: 1;
}

#sunset-layer::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 86%;
  width: clamp(110px, 15vw, 180px);
  height: clamp(110px, 15vw, 180px);
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #ffe6d7 0%, #e89b75 58%, #c95f39 100%);
  box-shadow:
    0 0 150px rgba(238, 170, 120, 0.46),
    0 0 320px rgba(206, 108, 64, 0.28);
  filter: blur(8px);
  z-index: 2;
  transform: translate(-50%, -50%) translateY(34vh);
  opacity: 0;
  animation: none;
  will-change: transform, opacity;
}

body[data-theme="sunset"] #sunset-layer::before {
  animation: sunsetSun var(--sunset-cycle) linear infinite;
}

#sunset-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      0deg,
      rgba(255, 132, 106, 0.18) 0%,
      rgba(255, 142, 118, 0.13) 32%,
      rgba(228, 166, 178, 0.08) 58%,
      rgba(98, 126, 176, 0.05) 82%,
      rgba(0, 0, 0, 0) 100%
    ),
    radial-gradient(
      circle at 50% 68%,
      rgba(255, 152, 126, 0.18),
      rgba(144, 166, 210, 0.1) 56%,
      rgba(0, 0, 0, 0) 72%
    );
  opacity: 0.04;
  mix-blend-mode: soft-light;
  z-index: 3;
  animation: sunsetPulse var(--sunset-pulse-cycle) ease-in-out infinite;
}

#sunset-layer .sunset-gradient {
  position: absolute;
  inset: 0;
  background: var(--bg);
  background-size: 160% 160%;
  background-repeat: no-repeat;
  z-index: 0;
  animation: none;
}

body[data-theme="sunset"] #sunset-layer .sunset-gradient {
  animation: sunsetShift var(--sunset-cycle) linear infinite;
}

#sunset-layer .sunset-night {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    0deg,
    rgba(2, 6, 14, 0.96) 0%,
    rgba(5, 10, 20, 0.92) 40%,
    rgba(10, 18, 30, 0.78) 70%,
    rgba(18, 28, 44, 0.62) 100%
  );
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: multiply;
  z-index: 1;
  animation: none;
}

body[data-theme="sunset"] #sunset-layer .sunset-night {
  animation: nightFall var(--sunset-cycle) linear infinite;
}

#ripple-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.bg-ripple {
  position: absolute;
  width: var(--ripple-size, 130px);
  height: var(--ripple-size, 130px);
  border-radius: 50%;
  border: 1.2px solid var(--ripple-line);
  background:
    radial-gradient(ellipse at 50% 40%, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.04) 28%, rgba(255, 255, 255, 0) 62%),
    radial-gradient(ellipse at 50% 62%, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0) 60%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.2),
    inset 0 -5px 10px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 10px 30px var(--ripple-shadow);
  transform: translate(-50%, -50%) scale(0.2);
  opacity: 0;
  animation: bgRipple 1720ms cubic-bezier(0.16, 0.58, 0.2, 1) forwards;
  will-change: transform, opacity;
}

.bg-ripple::before,
.bg-ripple::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
}

.bg-ripple::before {
  inset: -1px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  opacity: 0.55;
  animation: bgRippleInner 1720ms cubic-bezier(0.16, 0.58, 0.2, 1) forwards;
}

.bg-ripple::after {
  inset: 14%;
  border: 1px solid rgba(0, 0, 0, 0.12);
  opacity: 0.34;
  filter: blur(0.35px);
  animation: bgRippleCore 1720ms cubic-bezier(0.16, 0.58, 0.2, 1) forwards;
}

#bubble-field {
  position: absolute;
  inset: 0;
  z-index: 2;
}


#theme-toggle {
  position: absolute;
  top: var(--edge-offset);
  right: var(--edge-offset);
  width: var(--header-height);
  height: var(--header-height);
  border-radius: 999px;
  border: 1px solid var(--toggle-border);
  background: var(--toggle-bg);
  backdrop-filter: blur(12px) saturate(1.2);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
  display: grid;
  place-items: center;
  z-index: 5;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}


#site-header {
  position: absolute;
  top: var(--edge-offset);
  left: var(--edge-offset);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  z-index: 6;
}

#menu-toggle {
  font-family: var(--ui-font);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
  background: var(--toggle-bg);
  border: 1px solid var(--toggle-border);
  padding: 0 12px;
  height: var(--header-height);
  line-height: var(--header-height);
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(12px) saturate(1.2);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#menu-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.16);
}

#menu-toggle:focus-visible {
  outline: 2px solid rgba(0, 0, 0, 0.25);
  outline-offset: 6px;
  border-radius: 8px;
}

.menu-bubble {
  display: grid;
  gap: 10px;
  padding: 0;
  min-width: unset;
  border: none;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.menu-bubble.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.menu-bubble a {
  font-family: var(--ui-font);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  background: var(--toggle-bg);
  border: 1px solid var(--toggle-border);
  padding: 0 12px;
  height: var(--header-height);
  line-height: var(--header-height);
  border-radius: 999px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(12px) saturate(1.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.menu-bubble a.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.menu-bubble a:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.16);
}

#theme-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.16);
}

#theme-toggle svg {
  width: 20px;
  height: 20px;
  color: var(--text);
}

#theme-toggle svg {
  display: none;
}

body[data-theme="light"] #theme-toggle .icon-sun {
  display: block;
}

body[data-theme="dark"] #theme-toggle .icon-moon {
  display: block;
}

body[data-theme="sunset"] #theme-toggle .icon-sunset {
  display: block;
}

#theme-toggle .icon-moon {
  transform: translate(-1px, 1px);
  transform-origin: center;
}

.bubble {
  font-family: var(--bubble-font, var(--ui-font));
  font-weight: 500;
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--bubble-pad-y, 12px) var(--bubble-pad-x, 18px);
  color: var(--text);
  text-decoration: none;
  border-radius: var(--bubble-radius, 46px);
  background: linear-gradient(180deg, var(--glass-bright) 0%, var(--glass-mid) 56%, var(--glass-dim) 100%);
  border: 1px solid var(--glass-outline);
  backdrop-filter: blur(14px) saturate(1.02);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 var(--glass-highlight),
    inset 0 -4px 8px rgba(0, 0, 0, 0.03);
  user-select: none;
  cursor: grab;
  touch-action: none;
  will-change: transform;
  transition: box-shadow 0.35s ease, border-color 0.35s ease;
  overflow: visible;
}

.bubble::before {
  content: "";
  position: absolute;
  inset: 6% 10% auto 10%;
  height: 42%;
  border-radius: inherit;
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0));
  opacity: 0.06;
  pointer-events: none;
}

.bubble::after {
  content: "";
  position: absolute;
  inset: var(--bubble-inset, 10px);
  border-radius: inherit;
  border: 1px solid var(--glass-inner-line);
  box-shadow: none;
  pointer-events: none;
  opacity: 0.45;
}

body[data-theme="dark"] .bubble {
  background: rgba(24, 24, 24, 0.98);
  border-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

body[data-theme="dark"] .bubble::before {
  opacity: 0;
}

body[data-theme="dark"] .bubble::after {
  opacity: 0;
}

.bubble.text-only::after,
.bubble.has-image::after {
  content: none;
}


.bubble span {
  position: relative;
  z-index: 2;
  line-height: 1.08;
  letter-spacing: -0.01em;
  font-weight: inherit;
  padding: 0;
  max-width: 100%;
  width: 100%;
  display: block;
  white-space: pre-line;
  word-break: normal;
  hyphens: none;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.bubble::after,
.bubble span,
.bubble.has-image img {
  filter: saturate(0.92) contrast(0.96);
}

.bubble span {
  color: rgba(0, 0, 0, 0.68);
}

body[data-theme="dark"] .bubble span {
  color: rgba(255, 255, 255, 0.92);
}

body[data-theme="sunset"] .bubble span {
  color: rgba(30, 22, 18, 0.9);
}

body[data-theme="sunset"] #menu-toggle,
body[data-theme="sunset"] #theme-toggle svg {
  color: #ffffff;
}

body[data-theme="sunset"] .bubble {
  background: rgba(255, 255, 255, 0.12);
  border-color: transparent;
  backdrop-filter: blur(38px) saturate(2.15) contrast(1.08);
  -webkit-backdrop-filter: blur(38px) saturate(2.15) contrast(1.08);
  box-shadow: 0 16px 34px rgba(22, 10, 8, 0.2);
}

body[data-theme="sunset"] .bubble::before {
  opacity: 0;
}

body[data-theme="sunset"] .bubble::after,
body[data-theme="sunset"] .bubble.text-only::after,
body[data-theme="sunset"] .bubble.has-image::after {
  content: "";
  position: absolute;
  inset: 0;
  padding: 0.2px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 170, 220, 0.32), rgba(120, 190, 255, 0.3));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.12;
  pointer-events: none;
}

body[data-theme="sunset"] .bubble.has-image img {
  filter: saturate(1.05) contrast(0.96) brightness(1.02);
}

@keyframes sunsetShift {
  0% {
    filter: brightness(0.54) saturate(0.9) hue-rotate(-0.82deg);
    background-position: 52% 33%;
  }
  10% {
    filter: brightness(0.86) saturate(0.97) hue-rotate(-0.35deg);
    background-position: 51% 45%;
  }
  20% {
    filter: brightness(1.14) saturate(1.12) hue-rotate(0.22deg);
    background-position: 50% 58%;
  }
  30% {
    filter: brightness(1.2) saturate(1.04) hue-rotate(0.06deg);
    background-position: 49% 68%;
  }
  40% {
    filter: brightness(1.24) saturate(1.02) hue-rotate(-0.06deg);
    background-position: 48% 76%;
  }
  50% {
    filter: brightness(1.26) saturate(0.99) hue-rotate(-0.14deg);
    background-position: 48% 79%;
  }
  60% {
    filter: brightness(1.18) saturate(1.02) hue-rotate(-0.04deg);
    background-position: 49% 70%;
  }
  70% {
    filter: brightness(1.04) saturate(1.08) hue-rotate(0.14deg);
    background-position: 50% 58%;
  }
  80% {
    filter: brightness(0.84) saturate(1.18) hue-rotate(0.38deg);
    background-position: 51% 46%;
  }
  90% {
    filter: brightness(0.62) saturate(0.98) hue-rotate(-0.1deg);
    background-position: 53% 38%;
  }
  100% {
    filter: brightness(0.54) saturate(0.9) hue-rotate(-0.82deg);
    background-position: 52% 33%;
  }
}

@keyframes sunsetSun {
  0% {
    transform: translate(-50%, -50%) translateY(18vh);
    opacity: 0.72;
  }
  10% {
    transform: translate(-50%, -50%) translateY(6vh);
    opacity: 0.82;
  }
  20% {
    transform: translate(-50%, -50%) translateY(-6vh);
    opacity: 0.9;
  }
  30% {
    transform: translate(-50%, -50%) translateY(-18vh);
    opacity: 0.95;
  }
  40% {
    transform: translate(-50%, -50%) translateY(-30vh);
    opacity: 0.98;
  }
  50% {
    transform: translate(-50%, -50%) translateY(-40vh);
    opacity: 1;
  }
  60% {
    transform: translate(-50%, -50%) translateY(-30vh);
    opacity: 0.95;
  }
  70% {
    transform: translate(-50%, -50%) translateY(-18vh);
    opacity: 0.85;
  }
  80% {
    transform: translate(-50%, -50%) translateY(-6vh);
    opacity: 0.74;
  }
  90% {
    transform: translate(-50%, -50%) translateY(6vh);
    opacity: 0.64;
  }
  100% {
    transform: translate(-50%, -50%) translateY(18vh);
    opacity: 0.72;
  }
}

@keyframes sunsetRise {
  0% {
    transform: translate(-50%, -50%) translateY(18vh);
    opacity: 0.24;
  }
  12% {
    transform: translate(-50%, -50%) translateY(8vh);
    opacity: 0.58;
  }
  30% {
    transform: translate(-50%, -50%) translateY(-14vh);
    opacity: 0.76;
  }
  56% {
    transform: translate(-50%, -50%) translateY(-30vh);
    opacity: 0.9;
  }
  82% {
    transform: translate(-50%, -50%) translateY(-42vh);
    opacity: 1;
  }
  92% {
    transform: translate(-50%, -50%) translateY(-40vh);
    opacity: 0.98;
  }
  100% {
    transform: translate(-50%, -50%) translateY(-38vh);
    opacity: 0.95;
  }
}

@keyframes sunsetShiftRise {
  0% {
    filter: brightness(0.66) saturate(0.9) hue-rotate(-1.8deg);
    background-position: 52% 36%;
  }
  20% {
    filter: brightness(0.9) saturate(0.95) hue-rotate(-1.4deg);
    background-position: 53% 44%;
  }
  42% {
    filter: brightness(1.02) saturate(0.97) hue-rotate(-1.2deg);
    background-position: 50% 62%;
  }
  66% {
    filter: brightness(1.08) saturate(0.98) hue-rotate(-1deg);
    background-position: 48% 74%;
  }
  100% {
    filter: brightness(1.16) saturate(1.02) hue-rotate(-1deg);
    background-position: 50% 100%;
  }
}

@keyframes sunsetPulse {
  0% {
    opacity: 0.002;
    filter: hue-rotate(-0.08deg) saturate(1);
    transform: translateY(0);
  }
  10% {
    opacity: 0.004;
    filter: hue-rotate(0deg) saturate(1.02);
    transform: translateY(-0.015%);
  }
  20% {
    opacity: 0.0105;
    filter: hue-rotate(0.22deg) saturate(1.06);
    transform: translateY(-0.04%);
  }
  30% {
    opacity: 0.0065;
    filter: hue-rotate(0.1deg) saturate(1.03);
    transform: translateY(-0.022%);
  }
  50% {
    opacity: 0.0042;
    filter: hue-rotate(-0.04deg) saturate(1.01);
    transform: translateY(-0.01%);
  }
  70% {
    opacity: 0.0066;
    filter: hue-rotate(0.06deg) saturate(1.03);
    transform: translateY(-0.022%);
  }
  80% {
    opacity: 0.011;
    filter: hue-rotate(0.24deg) saturate(1.07);
    transform: translateY(-0.04%);
  }
  90% {
    opacity: 0.0046;
    filter: hue-rotate(0deg) saturate(1.02);
    transform: translateY(-0.016%);
  }
  100% {
    opacity: 0.002;
    filter: hue-rotate(-0.08deg) saturate(1);
    transform: translateY(0);
  }
}

@keyframes nightFall {
  0% {
    opacity: 0.86;
  }
  10% {
    opacity: 0.52;
  }
  20% {
    opacity: 0.22;
  }
  30% {
    opacity: 0.12;
  }
  40% {
    opacity: 0.08;
  }
  50% {
    opacity: 0.06;
  }
  60% {
    opacity: 0.08;
  }
  70% {
    opacity: 0.22;
  }
  80% {
    opacity: 0.48;
  }
  90% {
    opacity: 0.74;
  }
  100% {
    opacity: 0.86;
  }
}

@keyframes nightLift {
  0% {
    opacity: 0.96;
  }
  18% {
    opacity: 0.76;
  }
  36% {
    opacity: 0.52;
  }
  68% {
    opacity: 0.2;
  }
  100% {
    opacity: 0.04;
  }
}

@keyframes bgRipple {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2);
  }
  10% {
    opacity: 0.48;
  }
  36% {
    opacity: 0.34;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.86);
  }
}

@keyframes bgRippleInner {
  0% {
    opacity: 0.58;
    transform: scale(0.54);
  }
  100% {
    opacity: 0;
    transform: scale(1.56);
  }
}

@keyframes bgRippleCore {
  0% {
    opacity: 0.34;
    transform: scale(0.38);
  }
  100% {
    opacity: 0;
    transform: scale(1.1);
  }
}

.bubble.is-focused {
  border-color: var(--glass-edge);
  box-shadow:
    0 22px 55px rgba(0, 0, 0, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.26),
    inset 0 1px 0 var(--glass-highlight),
    inset 0 -8px 14px rgba(0, 0, 0, 0.06);
}

.bubble.has-image {
  flex-direction: column;
  gap: 0;
  align-items: stretch;
  justify-content: start;
  padding: 0;
  overflow: hidden;
  display: block;
  align-content: start;
  justify-items: stretch;
  row-gap: 0;
}

.bubble.image-only {
  grid-template-rows: var(--bubble-image-height, 120px);
  row-gap: 0;
}

.bubble.image-only span {
  display: none;
}

.bubble.has-image::before {
  opacity: 0.08;
}

.bubble.has-image::after {
  content: none;
}

.bubble.has-image img {
  position: absolute;
  top: var(--bubble-inset, 10px);
  left: var(--bubble-inset, 10px);
  width: calc(100% - 2 * var(--bubble-inset, 10px));
  height: calc(100% - 2 * var(--bubble-inset, 10px));
  border-radius: var(--bubble-image-radius, 22px);
  object-fit: cover;
  display: block;
  justify-self: stretch;
  opacity: 0.9;
  filter: saturate(0.92) contrast(0.95) brightness(1.02);
  pointer-events: none;
  z-index: 1;
}

.bubble.has-image span {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: var(--bubble-text-pad-bottom, 10px);
  transform: translate(-50%, 8px);
  margin: 0;
  padding: 0 var(--bubble-text-pad-x, 0px);
  box-sizing: border-box;
  background: transparent;
  text-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  align-self: stretch;
  width: calc(100% - 2 * var(--bubble-inset, 10px));
  max-width: var(--bubble-text-width, 100%);
  min-height: var(--bubble-text-height, auto);
  line-height: 1.12;
  font-size: var(--bubble-image-font, inherit);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.bubble.has-image.is-focused span {
  opacity: 1;
  transform: translate(-50%, 0);
}

.bubble.is-dragging {
  cursor: grabbing;
}

.bubble:focus-visible {
  outline: 2px solid rgba(0, 0, 0, 0.25);
  outline-offset: 4px;
}

body[data-theme="dark"] .bubble:focus-visible {
  outline-color: rgba(255, 255, 255, 0.4);
}


body[data-theme="dark"] #menu-toggle:focus-visible {
  outline-color: rgba(255, 255, 255, 0.35);
}

@media (max-width: 700px) {
  :root {
    --edge-offset: 14px;
    --header-height: 40px;
  }

  #theme-toggle {
    width: var(--header-height);
    height: var(--header-height);
  }
}
