/* Reader room: homepage-only, cache-safe UI. */
body.wor-reader-room-open {
  overflow: hidden;
}

.wor-reader-room-fab {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 0px));
  left: auto;
  inset-block-end: calc(var(--wor-bottom-nav-height, 74px) + var(--wor-safe-bottom, 0px) + 24px);
  z-index: 1110;
  display: grid;
  place-items: center;
  inline-size: 58px;
  block-size: 58px;
  padding: 0;
  overflow: visible;
  border: 1px solid color-mix(in srgb, var(--wor-accent) 58%, var(--wor-border));
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 20%, color-mix(in srgb, #fff 25%, transparent), transparent 30%),
    linear-gradient(145deg, color-mix(in srgb, var(--wor-accent) 88%, #7c3aed), color-mix(in srgb, var(--wor-accent) 66%, #2563eb));
  color: #fff;
  box-shadow:
    0 14px 34px color-mix(in srgb, var(--wor-accent) 34%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, .3);
  cursor: pointer;
  isolation: isolate;
  transition: transform .18s ease, box-shadow .18s ease;
}

.wor-reader-room-fab:is(:hover, :focus-visible) {
  transform: translateY(-3px) scale(1.04);
  box-shadow:
    0 18px 42px color-mix(in srgb, var(--wor-accent) 42%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, .38);
}

.wor-reader-room-fab:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--wor-accent) 32%, transparent);
  outline-offset: 4px;
}

.wor-reader-room-fab svg {
  position: relative;
  z-index: 2;
  inline-size: 28px;
  block-size: 28px;
  fill: currentColor;
}

.wor-reader-room-fab__glow {
  position: absolute;
  z-index: -1;
  inset: -7px;
  border: 1px solid color-mix(in srgb, var(--wor-accent) 50%, transparent);
  border-radius: inherit;
  pointer-events: none;
}

@keyframes wor-room-fab-welcome {
  0%, 100% { opacity: 0; transform: scale(.86); }
  35% { opacity: .8; }
  75% { opacity: 0; transform: scale(1.28); }
}

@media (prefers-reduced-motion: no-preference) {
  .wor-reader-room-fab__glow {
    animation: wor-room-fab-welcome 2.2s ease-out 2;
  }
}

.wor-reader-room {
  position: fixed;
  inset: 0;
  z-index: 1350;
  direction: rtl;
}

.wor-reader-room [hidden] {
  display: none !important;
}

.wor-reader-room__backdrop {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  padding: 0;
  border: 0;
  background: rgba(1, 6, 15, .58);
  cursor: default;
}

.wor-reader-room__panel {
  position: absolute;
  right: max(16px, env(safe-area-inset-right, 0px));
  left: auto;
  inset-block-end: calc(var(--wor-bottom-nav-height, 74px) + var(--wor-safe-bottom, 0px) + 18px);
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  inline-size: min(420px, calc(100vw - 32px));
  block-size: min(720px, calc(100vh - var(--wor-topbar-height, 64px) - var(--wor-bottom-nav-height, 74px) - var(--wor-safe-bottom, 0px) - 48px));
  block-size: min(720px, calc(100dvh - var(--wor-topbar-height, 64px) - var(--wor-bottom-nav-height, 74px) - var(--wor-safe-bottom, 0px) - 48px));
  min-block-size: min(520px, calc(100vh - var(--wor-bottom-nav-height, 74px) - var(--wor-safe-bottom, 0px) - 34px));
  min-block-size: min(520px, calc(100dvh - var(--wor-bottom-nav-height, 74px) - var(--wor-safe-bottom, 0px) - 34px));
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--wor-accent) 28%, var(--wor-border));
  border-radius: 28px;
  background: var(--wor-surface-solid);
  color: var(--wor-text);
  box-shadow:
    0 32px 90px rgba(0, 0, 0, .42),
    0 0 0 1px color-mix(in srgb, var(--wor-accent) 8%, transparent);
  transform-origin: bottom right;
}

@keyframes wor-room-panel-in {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: no-preference) {
  .wor-reader-room__panel {
    animation: wor-room-panel-in .24s cubic-bezier(.2, .8, .2, 1) both;
  }
}

.wor-reader-room__head {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-block-size: 78px;
  padding: 13px 14px;
  overflow: hidden;
  border-block-end: 1px solid color-mix(in srgb, var(--wor-accent) 20%, var(--wor-border));
  background:
    radial-gradient(circle at 8% 0%, color-mix(in srgb, #8b5cf6 18%, transparent), transparent 46%),
    radial-gradient(circle at 92% 100%, color-mix(in srgb, var(--wor-accent) 18%, transparent), transparent 45%),
    linear-gradient(135deg, color-mix(in srgb, var(--wor-surface-soft) 88%, var(--wor-accent) 12%), var(--wor-surface-solid));
}

.wor-reader-room__head { grid-row: 1; }

.wor-reader-room__head::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -80% -30%;
  opacity: .26;
  background: linear-gradient(110deg, transparent 40%, rgba(255,255,255,.44) 49%, transparent 58%);
  transform: translateX(45%);
  pointer-events: none;
}

@keyframes wor-room-head-shine {
  0%, 25% { transform: translateX(45%); }
  75%, 100% { transform: translateX(-45%); }
}

@media (prefers-reduced-motion: no-preference) {
  .wor-reader-room__head::after {
    animation: wor-room-head-shine 7s ease-in-out infinite;
  }
}

.wor-reader-room__brand {
  display: grid;
  place-items: center;
  inline-size: 46px;
  block-size: 46px;
  border: 1px solid color-mix(in srgb, var(--wor-accent) 44%, var(--wor-border));
  border-radius: 16px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--wor-accent) 86%, #7c3aed), color-mix(in srgb, var(--wor-accent) 70%, #2563eb));
  color: #fff;
  box-shadow: 0 9px 24px color-mix(in srgb, var(--wor-accent) 24%, transparent);
}

.wor-reader-room__brand svg {
  inline-size: 25px;
  block-size: 25px;
  fill: currentColor;
}

.wor-reader-room__title {
  min-inline-size: 0;
}

.wor-reader-room__title h2,
.wor-reader-room__title p {
  margin: 0;
}

.wor-reader-room__title h2 {
  overflow: hidden;
  color: var(--wor-text);
  font-size: 1.05rem;
  font-weight: 1000;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wor-reader-room__title p {
  margin-block-start: 3px;
  color: var(--wor-muted);
  font-size: .74rem;
  font-weight: 700;
}

.wor-reader-room__head-actions {
  display: flex;
  gap: 6px;
}

.wor-reader-room__head-actions button {
  display: grid;
  place-items: center;
  inline-size: 38px;
  block-size: 38px;
  padding: 0;
  border: 1px solid var(--wor-border);
  border-radius: 13px;
  background: color-mix(in srgb, var(--wor-surface-solid) 86%, transparent);
  color: var(--wor-text);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.wor-reader-room__head-actions button:is(:hover, :focus-visible) {
  border-color: color-mix(in srgb, var(--wor-accent) 52%, var(--wor-border));
  color: var(--wor-accent);
}

.wor-reader-room__head-actions svg {
  inline-size: 19px;
  block-size: 19px;
  fill: currentColor;
}

@keyframes wor-room-refresh-spin { to { transform: rotate(1turn); } }
.wor-reader-room__head-actions [data-wor-room-refresh].is-loading svg {
  animation: wor-room-refresh-spin .8s linear infinite;
}

.wor-reader-room__notice {
  grid-row: 2;
  margin: 8px 12px 0;
  padding: 8px 11px;
  border: 1px solid var(--wor-border);
  border-radius: 12px;
  background: var(--wor-surface-soft);
  color: var(--wor-muted);
  font-size: .76rem;
  font-weight: 800;
  text-align: center;
}

.wor-reader-room__notice.is-error {
  border-color: color-mix(in srgb, var(--wor-danger) 46%, var(--wor-border));
  background: var(--wor-danger-soft);
  color: var(--wor-danger);
}

.wor-reader-room__notice.is-success {
  color: #059669;
}

.wor-reader-room__older {
  grid-row: 3;
  justify-self: center;
  min-block-size: 32px;
  margin: 8px 0 0;
  padding: 5px 13px;
  border: 1px solid var(--wor-border);
  border-radius: 999px;
  background: var(--wor-surface-soft);
  color: var(--wor-accent);
  font-size: .72rem;
  font-weight: 900;
  cursor: pointer;
}

.wor-reader-room__older:disabled {
  opacity: .6;
  cursor: wait;
}

.wor-reader-room__messages {
  grid-row: 4;
  min-block-size: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overflow-anchor: none;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--wor-accent) 35%, transparent) transparent;
}

.wor-reader-room__loading {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  min-block-size: 180px;
}

.wor-reader-room__loading span {
  inline-size: 8px;
  block-size: 8px;
  border-radius: 50%;
  background: var(--wor-accent);
  opacity: .32;
}

@keyframes wor-room-loading {
  0%, 80%, 100% { opacity: .25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-6px); }
}

@media (prefers-reduced-motion: no-preference) {
  .wor-reader-room__loading span { animation: wor-room-loading 1.1s ease-in-out infinite; }
  .wor-reader-room__loading span:nth-child(2) { animation-delay: .12s; }
  .wor-reader-room__loading span:nth-child(3) { animation-delay: .24s; }
}

.wor-reader-room__empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  min-block-size: 220px;
  padding: 24px;
  color: var(--wor-muted);
  text-align: center;
}

.wor-reader-room__empty > span {
  display: grid;
  place-items: center;
  inline-size: 52px;
  block-size: 52px;
  border: 1px solid color-mix(in srgb, var(--wor-accent) 35%, var(--wor-border));
  border-radius: 18px;
  background: var(--wor-accent-soft);
  color: var(--wor-accent);
  font-size: 24px;
}

.wor-reader-room__empty strong { color: var(--wor-text); font-size: .98rem; }
.wor-reader-room__empty p { margin: 0; font-size: .8rem; }

.wor-reader-room-message {
  --wor-room-vip-primary: var(--wor-accent);
  --wor-room-vip-secondary: var(--wor-accent);
  --wor-room-vip-highlight: var(--wor-text);
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--wor-border);
  border-radius: 19px;
  background: color-mix(in srgb, var(--wor-surface-soft) 72%, var(--wor-surface-solid));
  color: var(--wor-text);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .035);
}

.wor-reader-room-message.is-vip-vip1 {
  --wor-room-vip-primary: #1d4ed8;
  --wor-room-vip-secondary: #60a5fa;
  --wor-room-vip-highlight: #bfdbfe;
}

.wor-reader-room-message.is-vip-vip2 {
  --wor-room-vip-primary: #047857;
  --wor-room-vip-secondary: #34d399;
  --wor-room-vip-highlight: #a7f3d0;
}

.wor-reader-room-message.is-vip-vip3 {
  --wor-room-vip-primary: #a16207;
  --wor-room-vip-secondary: #f6c453;
  --wor-room-vip-highlight: #fff0a6;
}

.wor-reader-room-message.is-vip-vipmax {
  --wor-room-vip-primary: #6d28d9;
  --wor-room-vip-secondary: #d8a62c;
  --wor-room-vip-highlight: #c084fc;
}

.wor-reader-room-message.is-vip {
  border-color: color-mix(in srgb, var(--wor-room-vip-primary) 54%, var(--wor-border));
  background:
    radial-gradient(circle at 96% 0%, color-mix(in srgb, var(--wor-room-vip-highlight) 18%, transparent), transparent 38%),
    linear-gradient(122deg,
      color-mix(in srgb, var(--wor-room-vip-primary) 13%, var(--wor-surface-solid)),
      color-mix(in srgb, var(--wor-room-vip-highlight) 6%, var(--wor-surface-soft)) 54%,
      color-mix(in srgb, var(--wor-room-vip-secondary) 11%, var(--wor-surface-solid)));
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--wor-room-vip-highlight) 22%, transparent),
    0 8px 22px color-mix(in srgb, var(--wor-room-vip-primary) 12%, transparent);
}

.wor-reader-room-message.is-vip-vipmax {
  border-color: color-mix(in srgb, var(--wor-room-vip-primary) 50%, var(--wor-room-vip-secondary));
  background:
    radial-gradient(circle at 94% 0%, color-mix(in srgb, var(--wor-room-vip-secondary) 24%, transparent), transparent 34%),
    radial-gradient(circle at 4% 100%, color-mix(in srgb, var(--wor-room-vip-highlight) 19%, transparent), transparent 38%),
    linear-gradient(118deg,
      color-mix(in srgb, var(--wor-room-vip-primary) 17%, var(--wor-surface-solid)),
      color-mix(in srgb, var(--wor-room-vip-secondary) 10%, var(--wor-surface-soft)) 52%,
      color-mix(in srgb, var(--wor-room-vip-primary) 13%, var(--wor-surface-solid)));
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--wor-room-vip-secondary) 30%, transparent),
    0 10px 26px color-mix(in srgb, var(--wor-room-vip-primary) 17%, transparent);
}

.wor-reader-room-message__avatar {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  inline-size: 42px;
  block-size: 42px;
  overflow: hidden;
  border: 1px solid var(--wor-border);
  border-radius: 50%;
  background: var(--wor-accent-soft);
  color: var(--wor-accent);
  font-size: .9rem;
  font-weight: 1000;
  text-decoration: none;
}

.wor-reader-room-message__avatar img,
.wor-reader-room-message__avatar b {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  inline-size: 100%;
  block-size: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.wor-reader-room-message.is-vip .wor-reader-room-message__avatar {
  overflow: visible;
  border: 0;
}

.wor-reader-room-message.is-vip .wor-reader-room-message__avatar::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: -4px;
  border-radius: inherit;
  background: conic-gradient(from 0deg,
    var(--wor-room-vip-primary),
    var(--wor-room-vip-highlight) 23%,
    var(--wor-room-vip-secondary) 46%,
    var(--wor-room-vip-primary) 69%,
    var(--wor-room-vip-secondary) 85%,
    var(--wor-room-vip-primary));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--wor-room-vip-highlight) 40%, transparent),
    0 0 13px color-mix(in srgb, var(--wor-room-vip-primary) 30%, transparent);
}

.wor-reader-room-message.is-vip .wor-reader-room-message__avatar img,
.wor-reader-room-message.is-vip .wor-reader-room-message__avatar b {
  overflow: hidden;
  background: color-mix(in srgb, var(--wor-room-vip-primary) 12%, var(--wor-surface-solid));
  color: var(--wor-text);
}

@keyframes wor-room-vip-ring { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: no-preference) {
  .wor-reader-room-message.is-vip .wor-reader-room-message__avatar::before {
    animation: wor-room-vip-ring 7s linear infinite;
  }
  .wor-reader-room-message.is-vip-vipmax .wor-reader-room-message__avatar::before {
    animation-duration: 5.2s;
  }
}

.wor-reader-room-message__body {
  min-inline-size: 0;
}

.wor-reader-room-message__reply-context {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  margin-block-end: 7px;
  padding: 6px 8px;
  border-inline-start: 2px solid color-mix(in srgb, var(--wor-room-vip-primary) 62%, var(--wor-accent));
  border-radius: 10px;
  background: color-mix(in srgb, var(--wor-accent-soft) 52%, var(--wor-surface-solid));
  color: var(--wor-text);
}

.wor-reader-room-message__reply-marker {
  display: grid;
  place-items: center;
  color: color-mix(in srgb, var(--wor-room-vip-primary) 70%, var(--wor-accent));
  font-size: .9rem;
  font-weight: 1000;
}

.wor-reader-room-message__reply-copy {
  display: grid;
  min-inline-size: 0;
  gap: 2px;
}

.wor-reader-room-message__reply-copy small {
  overflow: hidden;
  color: var(--wor-muted);
  font-size: .58rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wor-reader-room-message__reply-copy small strong {
  color: color-mix(in srgb, var(--wor-room-vip-primary) 68%, var(--wor-accent));
  font-weight: 1000;
}

.wor-reader-room-message__reply-copy > span {
  overflow: hidden;
  color: var(--wor-text);
  font-size: .67rem;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wor-reader-room-message__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  min-inline-size: 0;
  margin-block-end: 6px;
}

.wor-reader-room-message__name {
  min-inline-size: 0;
  max-inline-size: min(100%, 180px);
  overflow: hidden;
  color: var(--wor-text);
  font-size: .82rem;
  font-weight: 1000;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}

a.wor-reader-room-message__avatar:focus-visible,
a.wor-reader-room-message__name:focus-visible {
  outline: 2px solid var(--wor-accent);
  outline-offset: 3px;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .wor-reader-room-message.is-vip .wor-reader-room-message__name {
    background: linear-gradient(105deg,
      var(--wor-text) 0%,
      var(--wor-text) 39%,
      color-mix(in srgb, var(--wor-room-vip-highlight) 45%, var(--wor-text)) 49%,
      var(--wor-text) 59%,
      var(--wor-text) 100%);
    background-size: 280% 100%;
    background-position: 100% 50%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
  }
}

@keyframes wor-room-vip-name {
  0%, 18% { background-position: 100% 50%; }
  72%, 100% { background-position: -100% 50%; }
}

@media (prefers-reduced-motion: no-preference) {
  .wor-reader-room-message.is-vip .wor-reader-room-message__name {
    animation: wor-room-vip-name 4.8s ease-in-out infinite;
  }
}

.wor-reader-room-message__vip,
.wor-reader-room-message__rank {
  display: inline-flex;
  align-items: center;
  min-block-size: 19px;
  padding: 2px 6px;
  border: 1px solid var(--wor-border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--wor-surface-solid) 75%, transparent);
  font-size: .58rem;
  font-weight: 1000;
  line-height: 1;
  white-space: nowrap;
}

.wor-reader-room-message__rank {
  color: var(--wor-accent);
}

.wor-reader-room-message__vip {
  border-color: color-mix(in srgb, var(--wor-room-vip-primary) 50%, var(--wor-border));
  background: linear-gradient(120deg,
    color-mix(in srgb, var(--wor-room-vip-primary) 17%, var(--wor-surface-solid)),
    color-mix(in srgb, var(--wor-room-vip-secondary) 18%, var(--wor-surface-soft)));
  color: var(--wor-text);
  direction: ltr;
  unicode-bidi: isolate;
}

.wor-reader-room-message__meta time {
  margin-inline-start: auto;
  color: var(--wor-muted);
  font-size: .62rem;
  font-weight: 700;
  white-space: nowrap;
}

.wor-reader-room-message__text {
  margin: 0;
  color: var(--wor-text);
  font-size: .83rem;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
}

.wor-reader-room-message__novel {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-block-start: 9px;
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--wor-accent) 28%, var(--wor-border));
  border-radius: 12px;
  background: color-mix(in srgb, var(--wor-accent-soft) 62%, var(--wor-surface-solid));
  color: var(--wor-text);
}

.wor-reader-room-message__novel > img,
.wor-reader-room-message__novel > span:first-child {
  display: grid;
  place-items: center;
  inline-size: 34px;
  block-size: 42px;
  border-radius: 8px;
  background: var(--wor-accent-soft);
  color: var(--wor-accent);
  object-fit: cover;
  font-weight: 1000;
}

.wor-reader-room-message__novel > span:nth-child(2) {
  display: grid;
  min-inline-size: 0;
  gap: 1px;
}

.wor-reader-room-message__novel small {
  color: var(--wor-muted);
  font-size: .58rem;
  font-weight: 800;
}

.wor-reader-room-message__novel strong {
  overflow: hidden;
  font-size: .72rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wor-reader-room-message__novel i {
  color: var(--wor-accent);
  font-style: normal;
}

.wor-reader-room-message__actions {
  display: none;
  justify-content: flex-end;
  min-block-size: 0;
  margin-block-start: 5px;
}

.wor-reader-room-message__reply-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-block-size: 28px;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--wor-muted);
  font-size: .62rem;
  font-weight: 900;
  cursor: pointer;
}

.wor-reader-room.is-logged-in .wor-reader-room-message__actions {
  display: flex;
}

.wor-reader-room-message__reply-action:is(:hover, :focus-visible) {
  border-color: color-mix(in srgb, var(--wor-accent) 32%, var(--wor-border));
  background: var(--wor-accent-soft);
  color: var(--wor-accent);
  outline: none;
}

.wor-reader-room-message__reply-action > span:first-child {
  font-size: .78rem;
  line-height: 1;
}

.wor-reader-room__new {
  position: absolute;
  inset-inline-start: 50%;
  inset-block-end: 112px;
  z-index: 4;
  min-block-size: 34px;
  padding: 6px 14px;
  border: 1px solid color-mix(in srgb, var(--wor-accent) 45%, var(--wor-border));
  border-radius: 999px;
  background: var(--wor-surface-solid);
  color: var(--wor-accent);
  box-shadow: 0 8px 22px rgba(0,0,0,.16);
  font-size: .72rem;
  font-weight: 900;
  transform: translateX(50%);
  cursor: pointer;
}

.wor-reader-room__guest {
  grid-row: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 9px 11px 11px;
  padding: 10px 11px;
  border: 1px solid color-mix(in srgb, var(--wor-accent) 26%, var(--wor-border));
  border-radius: 16px;
  background: var(--wor-accent-soft);
  color: var(--wor-text);
  font-size: .75rem;
  font-weight: 800;
}

.wor-reader-room__guest button {
  flex: 0 0 auto;
  min-block-size: 36px;
  padding: 7px 12px;
  border: 0;
  border-radius: 12px;
  background: var(--wor-accent);
  color: #fff;
  font-size: .72rem;
  font-weight: 900;
  cursor: pointer;
}

.wor-reader-room__composer {
  grid-row: 5;
  position: relative;
  z-index: 5;
  display: grid;
  gap: 6px;
  padding: 9px 10px calc(9px + env(safe-area-inset-bottom, 0px));
  border-block-start: 1px solid var(--wor-border);
  background: var(--wor-surface-solid);
}

.wor-reader-room__composer-main {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 40px;
  align-items: end;
  gap: 7px;
  padding: 6px;
  border: 1px solid var(--wor-border);
  border-radius: 17px;
  background: var(--wor-surface-soft);
  direction: ltr;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.wor-reader-room__composer-main:focus-within {
  border-color: color-mix(in srgb, var(--wor-accent) 58%, var(--wor-border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--wor-accent) 12%, transparent);
}

.wor-reader-room__composer textarea {
  inline-size: 100%;
  min-block-size: 38px;
  max-block-size: 92px;
  padding: 8px 3px;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--wor-text);
  direction: rtl;
  font: inherit;
  font-size: .82rem;
  line-height: 1.55;
  text-align: right;
}

.wor-reader-room__composer textarea::placeholder {
  color: var(--wor-muted);
  direction: rtl;
  opacity: .8;
  text-align: right;
}

.wor-reader-room__mention-button,
.wor-reader-room__send {
  display: grid;
  place-items: center;
  inline-size: 38px;
  block-size: 38px;
  padding: 0;
  border: 0;
  border-radius: 13px;
  cursor: pointer;
}

.wor-reader-room__mention-button {
  background: var(--wor-surface-solid);
  color: var(--wor-accent);
  font-size: 1.05rem;
  font-weight: 1000;
}

.wor-reader-room__send {
  inline-size: 40px;
  block-size: 40px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--wor-accent) 90%, #7c3aed), color-mix(in srgb, var(--wor-accent) 78%, #2563eb));
  color: #fff;
  box-shadow: 0 7px 17px color-mix(in srgb, var(--wor-accent) 24%, transparent);
}

.wor-reader-room__send svg {
  inline-size: 20px;
  block-size: 20px;
  fill: currentColor;
  transform: scaleX(-1);
}

.wor-reader-room__send:disabled {
  opacity: .55;
  cursor: wait;
}

.wor-reader-room__composer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-block-size: 15px;
  padding-inline: 4px;
  color: var(--wor-muted);
  font-size: .62rem;
}

.wor-reader-room__composer-foot > span {
  min-inline-size: 0;
  overflow: hidden;
  color: #059669;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wor-reader-room__composer-foot > span.is-error {
  color: var(--wor-danger);
}

.wor-reader-room__selected-reply {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 27px;
  align-items: center;
  gap: 8px;
  min-block-size: 42px;
  padding: 6px 8px 6px 6px;
  border: 1px solid color-mix(in srgb, var(--wor-accent) 38%, var(--wor-border));
  border-inline-start-width: 3px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--wor-accent-soft) 68%, var(--wor-surface-solid));
}

.wor-reader-room__selected-reply-copy {
  display: grid;
  min-inline-size: 0;
  gap: 2px;
}

.wor-reader-room__selected-reply-copy small {
  overflow: hidden;
  color: var(--wor-accent);
  font-size: .59rem;
  font-weight: 1000;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wor-reader-room__selected-reply-copy strong {
  overflow: hidden;
  color: var(--wor-text);
  font-size: .68rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wor-reader-room__selected-reply button,
.wor-reader-room__selected-novel button {
  display: grid;
  place-items: center;
  inline-size: 25px;
  block-size: 25px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: color-mix(in srgb, var(--wor-surface-solid) 70%, transparent);
  color: var(--wor-text);
  cursor: pointer;
}

.wor-reader-room__selected-novel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-block-size: 32px;
  padding: 5px 8px 5px 5px;
  border: 1px solid color-mix(in srgb, var(--wor-accent) 38%, var(--wor-border));
  border-radius: 12px;
  background: var(--wor-accent-soft);
  color: var(--wor-accent);
  font-size: .7rem;
  font-weight: 900;
}

.wor-reader-room__selected-novel span {
  min-inline-size: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wor-reader-room__mention-results {
  position: absolute;
  inset-inline: 10px;
  inset-block-end: calc(100% - 2px);
  z-index: 10;
  max-block-size: min(310px, 46vh);
  max-block-size: min(310px, 46dvh);
  padding: 7px;
  overflow-y: auto;
  border: 1px solid color-mix(in srgb, var(--wor-accent) 30%, var(--wor-border));
  border-radius: 16px;
  background: var(--wor-surface-solid);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
}

.wor-reader-room__mention-results > p {
  margin: 0;
  padding: 16px;
  color: var(--wor-muted);
  font-size: .75rem;
  font-weight: 800;
  text-align: center;
}

.wor-reader-room__mention-results > button {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  inline-size: 100%;
  min-block-size: 50px;
  padding: 6px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--wor-text);
  text-align: start;
  cursor: pointer;
}

.wor-reader-room__mention-results > button:is(:hover, :focus-visible, .is-active) {
  background: var(--wor-accent-soft);
}

.wor-reader-room__mention-results img,
.wor-reader-room__mention-results button > span {
  display: grid;
  place-items: center;
  inline-size: 36px;
  block-size: 42px;
  border-radius: 8px;
  background: var(--wor-accent-soft);
  color: var(--wor-accent);
  object-fit: cover;
  font-weight: 1000;
}

.wor-reader-room__mention-results b {
  min-inline-size: 0;
  overflow: hidden;
  font-size: .76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .wor-reader-room__backdrop {
    background: rgba(1, 6, 15, .68);
  }

  .wor-reader-room__panel {
    inset-inline: 0;
    inset-block-end: 0;
    inline-size: 100%;
    block-size: min(84vh, 760px);
    block-size: min(84dvh, 760px);
    min-block-size: min(540px, 100vh);
    min-block-size: min(540px, 100dvh);
    border-inline: 0;
    border-block-end: 0;
    border-end-start-radius: 0;
    border-end-end-radius: 0;
    border-start-start-radius: 26px;
    border-start-end-radius: 26px;
    transform-origin: bottom center;
  }

  .wor-reader-room__panel::before {
    content: "";
    position: absolute;
    z-index: 20;
    inset-block-start: 7px;
    inset-inline-start: 50%;
    inline-size: 42px;
    block-size: 4px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--wor-muted) 42%, transparent);
    transform: translateX(50%);
    pointer-events: none;
  }

  .wor-reader-room__head {
    padding-block-start: 17px;
  }

  .wor-reader-room-fab {
    inline-size: 54px;
    block-size: 54px;
  }
}

@media (max-width: 390px) {
  .wor-reader-room__head {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 8px;
    padding-inline: 10px;
  }

  .wor-reader-room__brand {
    inline-size: 40px;
    block-size: 40px;
    border-radius: 14px;
  }

  .wor-reader-room__title h2 { font-size: .96rem; }
  .wor-reader-room__title p { font-size: .66rem; }
  .wor-reader-room__head-actions { gap: 4px; }
  .wor-reader-room__head-actions button { inline-size: 34px; block-size: 34px; border-radius: 11px; }
  .wor-reader-room__messages { padding: 10px 8px; }

  .wor-reader-room-message {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 8px;
    padding: 9px;
    border-radius: 17px;
  }

  .wor-reader-room-message__avatar {
    inline-size: 38px;
    block-size: 38px;
  }

  .wor-reader-room-message__name {
    max-inline-size: 125px;
    font-size: .77rem;
  }

  .wor-reader-room-message__vip,
  .wor-reader-room-message__rank {
    min-block-size: 18px;
    padding-inline: 5px;
    font-size: .54rem;
  }

  .wor-reader-room-message__meta time {
    flex-basis: auto;
    margin-inline-start: 0;
  }

  .wor-reader-room-message__text { font-size: .79rem; }
  .wor-reader-room__guest { font-size: .69rem; }
  .wor-reader-room__composer { padding-inline: 7px; }
  .wor-reader-room__composer-main { grid-template-columns: 36px minmax(0, 1fr) 38px; }
  .wor-reader-room__mention-button { inline-size: 36px; block-size: 36px; }
  .wor-reader-room__send { inline-size: 38px; block-size: 38px; }
}

@media (max-height: 650px) and (max-width: 640px) {
  .wor-reader-room__panel {
    block-size: 100vh;
    block-size: 100dvh;
    min-block-size: 100vh;
    min-block-size: 100dvh;
    border-radius: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wor-reader-room-fab__glow,
  .wor-reader-room__panel,
  .wor-reader-room__head::after,
  .wor-reader-room__loading span,
  .wor-reader-room-message.is-vip .wor-reader-room-message__avatar::before,
  .wor-reader-room-message.is-vip .wor-reader-room-message__name,
  .wor-reader-room__head-actions [data-wor-room-refresh].is-loading svg {
    animation: none !important;
  }

  .wor-reader-room__messages {
    scroll-behavior: auto;
  }
}

@supports not (color: color-mix(in srgb, white, black)) {
  .wor-reader-room-fab { background: var(--wor-accent); }
  .wor-reader-room__panel,
  .wor-reader-room__head,
  .wor-reader-room__composer { background: var(--wor-surface-solid); }
  .wor-reader-room-message,
  .wor-reader-room__composer-main,
  .wor-reader-room-message__reply-context,
  .wor-reader-room__selected-reply { background: var(--wor-surface-soft); }
}
