:root {
  --t-lead: clamp(17px, 1.6 * var(--vw), 24px);
}

/* Zora */
#zora {
  --p: 18px;
  --lg: 36px;
  position: fixed;
  right: var(--pad);
  bottom: var(--bot);
  z-index: 45;
  width: 44px;
  height: 44px;
  border-radius: 22px;
  background: var(--fg);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform-origin: 50% 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0), inset 0 0 0 1px rgba(255, 251, 241, 0);
  -webkit-backdrop-filter: none;
  backdrop-filter: none
}

#zora * {
  -webkit-user-select: none;
  user-select: none
}

#zora .nl {
  position: absolute;
  left: 0;
  top: 0;
  width: 44px;
  height: 44px;
  border: 0;
  padding: 0;
  border-radius: 50%;
  background: var(--fg);
  color: var(--bg); /* the face follows the theme: dark on a light button, light on a dark one */
  cursor: pointer;
  z-index: 3;
  display: grid;
  place-items: center
}

#zora .nl svg {
  width: 64%;
  height: 64%;
  display: block;
  overflow: visible
}

#zora .nl:focus-visible,
#zora button:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 2px
}

#zora .nc {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  padding: var(--p)
}

#zora.open .nc {
  pointer-events: auto
}

.nx2 {
  align-self: flex-end;
  width: var(--lg);
  height: var(--lg);
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--fg) 10%, transparent);
  color: var(--fg);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .3s, rotate .5s var(--e);
  flex: none
}

.nx2:hover {
  background: color-mix(in srgb, var(--fg) 20%, transparent);
  rotate: 90deg
}

.nx2 svg {
  width: 14px;
  height: 14px
}

.nbody {
  position: relative;
  overflow-anchor: none;
  overscroll-behavior: contain;
  touch-action: pan-y;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden; /* the chat only ever scrolls up and down */
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 18px 4px 6px;
  color: var(--fg);
  font-size: 16px;
  line-height: 1.3;
  -webkit-mask: linear-gradient(transparent, #000 14px);
  mask: linear-gradient(transparent, #000 14px)
}

.nbody::-webkit-scrollbar {
  display: none
}

.nbody>.gap {
  flex: 1
}

.hi {
  font-size: 26px;
  line-height: 1.1;
  color: var(--fg)
}

.hi b { font-weight: inherit; color: var(--acc) }

.hi em {
  font-style: normal;
  color: var(--mut)
}

.chips {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  font-size: 15px
}

.chips button {
  background: none;
  border: 0;
  color: var(--fg);
  font: inherit;
  cursor: pointer;
  text-align: right;
  padding: 2px 0;
  transition: color .3s, translate .4s var(--e)
}

.chips button:hover {
  color: var(--mut);
  translate: -4px 0
}

.chips .arr {
  width: .55em;
  height: .55em;
  margin-left: .25em
}

.mu {
  align-self: flex-end;
  max-width: 85%;
  text-align: right;
  color: var(--fg)
}

.mb2 {
  align-self: flex-start;
  max-width: 92%;
  position: relative
}

.mb2::before {
  content: '';
  position: absolute;
  inset: -30px 0; /* never wider than the bubble, or the chat can be dragged sideways */
  background: radial-gradient(closest-side, color-mix(in srgb, var(--fg) 7%, transparent), transparent);
  z-index: -1;
  pointer-events: none
}

.mb2 a.zl {
  display: block;
  width: fit-content;
  margin-top: 6px;
  color: var(--fg);
  transition: color .3s
}

.mb2 a.zl:hover {
  color: var(--mut)
}

.mb2 a.zl .arr {
  display: inline-block;
  width: .55em;
  height: .55em;
  margin-left: .3em
}

.mb2 .w {
  display: inline-block;
  text-indent: 0
}

/* words must not inherit the bullet's hanging indent, or they overlap */
.mb2 b {
  font-weight: 500
}

.mb2 code {
  font: 13px ui-monospace, monospace;
  background: color-mix(in srgb, var(--fg) 10%, transparent);
  padding: 1px 5px;
  border-radius: 5px
}

.mb2 .li {
  display: block;
  padding-left: 14px;
  text-indent: -14px
}

.th {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--mut)
}

.th svg {
  width: 58px;
  height: 26px;
  flex: none;
  overflow: visible
}

.th path {
  fill: none;
  stroke: var(--fg);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round
}

.th span {
  display: inline-block;
  background: linear-gradient(90deg, var(--mut) 30%, var(--fg) 50%, var(--mut) 70%) 0 0/250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shim 1.8s linear infinite
}

@keyframes shim {
  to {
    background-position: -150% 0
  }
}

.nf {
  display: flex;
  gap: 8px;
  flex: none;
  padding-top: 10px
}

.nf input {
  flex: 1;
  min-width: 0;
  height: var(--lg);
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--fg) 12%, transparent);
  color: var(--fg);
  font: 16px Outfit, sans-serif;
  padding: 0 16px;
  outline: 0;
  -webkit-user-select: text;
  user-select: text
}

.nf input::placeholder {
  color: var(--mut)
}

.nf button {
  width: var(--lg);
  height: var(--lg);
  flex: none;
  border: 0;
  border-radius: 50%;
  background: var(--acc);
  color: #111;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: scale .4s var(--e), rotate .4s var(--e), opacity .3s
}

.nf button:hover {
  scale: 1.08;
  rotate: -8deg
}

.nf button:disabled {
  opacity: .5;
  cursor: default
}

.nf button svg {
  width: 17px;
  height: 17px
}

@media(prefers-reduced-motion:reduce) {
  .th span {
    animation: none
  }
}
