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

html,
body {
  margin: 0;
  width: 470px;
  height: 400px;
  overflow: hidden;
  background: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  color: #171717;
}

.qr {
  position: relative;
  display: flex;
  width: 470px;
  height: 400px;
  overflow: hidden;
  background: #fff;
}

.qr__inbox {
  position: relative;
  flex: 0 0 364px;
  width: 364px;
  height: 400px;
  overflow: hidden;
  border-right: 1px solid #e5e5e5;
}

.qr__pane {
  flex: 0 0 237px;
  width: 237px;
  min-width: 237px;
  padding: 24px;
  overflow: hidden;
  color: #171717;
  font-size: 15px;
  line-height: 20px;
  letter-spacing: -0.15px;
}

.qr__pane-copy {
  margin: 0 0 1em;
}

.qr__pane-copy:last-child {
  margin-bottom: 0;
}

.qr-row {
  position: relative;
  display: flex;
  gap: 4px;
  align-items: flex-start;
  width: 100%;
  padding: 14px;
  border-bottom: 1px solid #e5e5e5;
  background: #fff;
  overflow: hidden;
  transform-origin: top center;
}

.qr-row--selected {
  background: #f5f3ff;
}

.qr-row--unread .qr-row__dot {
  opacity: 1;
}

.qr-row__dot {
  flex: 0 0 14px;
  width: 14px;
  padding-top: 4px;
  opacity: 0;
}

.qr-row__dot span {
  display: block;
  width: 8px;
  height: 8px;
  margin: 0 auto;
  border-radius: 50px;
  background: #7f22fe;
}

.qr-row__body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.qr-row__header {
  display: flex;
  gap: 8px;
  align-items: center;
}

.qr-row__name {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 16px;
  letter-spacing: -0.15px;
  color: #262626;
}

.qr-row__time {
  margin: 0;
  font-size: 12px;
  line-height: 12px;
  color: #525252;
  white-space: nowrap;
}

.qr-row__topic {
  margin: 0;
  font-size: 12px;
  line-height: 12px;
  color: #525252;
}

.qr-row__preview {
  margin: 0;
  height: 40px;
  overflow: hidden;
  font-size: 15px;
  line-height: 20px;
  letter-spacing: -0.15px;
  color: #171717;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.qr-row__footer {
  position: relative;
  min-height: 30px;
}

.qr-row__meta,
.qr-row__actions {
  display: flex;
  align-items: center;
  min-height: 30px;
}

.qr-row__meta {
  gap: 2px;
  font-size: 12px;
  line-height: 12px;
  color: #525252;
}

.qr-row__meta-arrow {
  display: inline-flex;
  width: 12px;
  height: 12px;
  color: #525252;
}

.qr-row__actions {
  position: absolute;
  left: 0;
  top: 50%;
  gap: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
}

.qr-row.is-hovered .qr-row__meta,
.qr-row.is-composing .qr-row__meta {
  visibility: hidden;
}

.qr-row.is-hovered .qr-row__actions,
.qr-row.is-composing .qr-row__actions {
  opacity: 1;
  pointer-events: auto;
}

.qr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 0;
  padding: 8px 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #7c52ff;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.qr-btn__icon {
  display: inline-flex;
  width: 14px;
  height: 14px;
  margin-left: 2px;
}

.qr-btn__label {
  padding: 0 6px;
}

.qr-btn--reply.is-hot {
  background: rgba(212, 188, 255, 0.27);
  color: #5023dd;
}

.qr-btn--resolve.is-hot {
  background: rgba(212, 188, 255, 0.18);
}

.qr-row__composer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 320ms ease;
}

.qr-row__composer-inner {
  overflow: hidden;
  min-height: 0;
}

.qr-row.is-composing .qr-row__composer {
  grid-template-rows: 1fr;
}

.qr-composer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  padding: 4px 4px 4px 8px;
  border: 1px solid #b3b0c0;
  border-radius: 4px;
  background: #fff;
}

.qr-composer__field {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: -0.12px;
  color: #171717;
  white-space: nowrap;
  overflow: hidden;
}

.qr-composer__field.is-placeholder {
  color: #9c99ac;
}

.qr-composer__tools {
  display: flex;
  gap: 4px;
  align-items: center;
}

.qr-composer__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 4px;
  color: #444150;
}

.qr-composer__icon--send {
  color: #7c52ff;
}

.qr-composer__icon--send.is-hot {
  color: #5023dd;
  transform: scale(1.08);
}

.qr-row.is-resolving {
  background-color: #c5e8d6;
  pointer-events: none;
  overflow: hidden;
  will-change: max-height;
  transition:
    max-height 250ms cubic-bezier(0.25, 1, 0.5, 1),
    padding-top 250ms cubic-bezier(0.25, 1, 0.5, 1),
    padding-bottom 250ms cubic-bezier(0.25, 1, 0.5, 1),
    border-bottom-width 250ms cubic-bezier(0.25, 1, 0.5, 1),
    opacity 100ms cubic-bezier(0.25, 1, 0.5, 1) 150ms;
}

/* Green overlay eases in (late) while height eases out — strongest green only when small. */
.qr-row.is-resolving::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #3d9b6e;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms cubic-bezier(0.7, 0, 1, 1);
}

.qr-row.is-resolving .qr-row__actions {
  opacity: 0;
}

.qr-row.is-resolving.is-gone {
  padding-top: 0;
  padding-bottom: 0;
  border-bottom-width: 0;
  opacity: 0;
}

.qr-row.is-resolving.is-gone::after {
  opacity: 0.9;
}

.qr-row.is-entering {
  animation: qr-row-in 240ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes qr-row-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.qr__toast {
  position: absolute;
  left: 50%;
  bottom: 20px;
  z-index: 5;
  padding: 10px 14px;
  border-radius: 999px;
  background: #262626;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.qr__toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.qr__cursor {
  position: absolute;
  z-index: 10;
  width: 18px;
  height: 18px;
  margin: -2px 0 0 -2px;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.28));
  transition: left 420ms cubic-bezier(0.22, 1, 0.36, 1), top 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.qr__cursor svg {
  display: block;
  width: 18px;
  height: 18px;
}
