.is-dialogue-mode { padding-bottom: 0; }
.is-dialogue-mode .response-section { padding-bottom: 0; }
.is-dialogue-mode .v2-secondary-tabs.content-tabs { position: sticky; z-index: 55; top: 0; background: rgba(255,255,255,.97); backdrop-filter: blur(12px); }
.dialogue-reading { position: relative; padding: 2px 0 96px; background: #fff; }
.dialogue-reading.is-standalone { min-height: 100%; padding-top: 2px; }
.dialogue-stream { padding: 0 14px 18px; }
.dialogue-message-content { max-width: 80%; min-width: 0; }
.dialogue-message-content .dialogue-bubble { max-width: 100%; user-select: text; -webkit-user-select: text; }
.dialogue-image-message { display: block; max-width: 220px; padding: 0; overflow: hidden; background: #f1f1f1; border: 1px solid var(--line); border-radius: 14px; }
.dialogue-image-message img { width: 100%; max-height: 280px; display: block; object-fit: cover; }
.dialogue-jumps { position: fixed; z-index: 48; right: 14px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; }
.dialogue-jumps.has-composer { bottom: 78px; }
.dialogue-jumps button { width: 38px; height: 38px; display: grid; place-items: center; color: #111; background: rgba(255,255,255,.95); border: 1px solid #d7d7d7; border-radius: 50%; box-shadow: 0 5px 15px rgba(0,0,0,.13); font-size: 18px; font-weight: 750; }
.dialogue-jumps button.is-hidden { display: none; }
.dialogue-readonly { margin: 12px 14px 24px; padding: 12px; color: #888; background: #f5f5f5; border-radius: 12px; font-size: 12px; text-align: center; }
.dialogue-empty { margin: 24px 0 4px; }

.dialogue-composer { display: grid; grid-template-columns: minmax(0,1fr) 54px; align-items: end; }
.dialogue-input-field { position: relative; min-width: 0; }
.dialogue-composer .dialogue-input-field textarea { width: 100%; padding-right: 42px; }
.dialogue-composer .dialogue-image-trigger { position: absolute; right: 6px; bottom: 6px; min-width: 30px; width: 30px; height: 30px; padding: 0; color: #777; background: transparent; border: 0; border-radius: 50%; }
.dialogue-composer .dialogue-image-trigger .icon { width: 18px; height: 18px; }
.dialogue-composer .dialogue-image-trigger:active { color: #111; background: #e7e7e7; }

.dialogue-image-sheet { width: 100%; padding: 14px; background: #fff; border-radius: 18px 18px 0 0; }
.dialogue-image-sheet header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.dialogue-image-sheet header button { width: 34px; height: 34px; background: #f1f1f1; border-radius: 50%; font-size: 20px; }
.dialogue-image-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.dialogue-image-grid > button { position: relative; aspect-ratio: 1; overflow: hidden; padding: 0; background: #eee; border: 2px solid transparent; border-radius: 11px; }
.dialogue-image-grid img { width: 100%; height: 100%; display: block; object-fit: cover; }
.dialogue-image-grid button.is-selected { border-color: #111; }
.dialogue-image-grid button i { display: none; }
.dialogue-image-grid button.is-selected i { position: absolute; right: 5px; top: 5px; width: 21px; height: 21px; display: grid; place-items: center; color: #fff; background: #111; border-radius: 50%; }
.dialogue-image-grid button.is-selected i::after { content: "✓"; font-style: normal; font-size: 11px; }
.dialogue-image-send { width: 100%; min-height: 46px; margin-top: 14px; color: #fff; background: #111; border-radius: 13px; font-weight: 750; }
.dialogue-image-send:disabled { color: #999; background: #eee; }

.line-highlight { display: inline; padding: 0; color: inherit; background: rgba(0,0,0,.055); border-bottom: 1.5px solid #111; font: inherit; text-align: left; }
.line-highlight sup { margin-left: 2px; font-size: 9px; font-weight: 750; }
.line-comments-panel { width: min(286px, calc(100vw - 82px)); margin-top: 8px; overflow: hidden; background: #fafafa; border: 1px solid #ddd; border-radius: 13px; }
.line-comments-panel > header { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-bottom: 1px solid #e4e4e4; }
.line-comments-panel > header span { min-width: 0; flex: 1; overflow: hidden; color: #666; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.line-comments-panel > header button { width: 26px; height: 26px; color: #777; background: #eee; border-radius: 50%; }
.line-comments-list { max-height: 260px; overflow-y: auto; }
.line-comments-empty { margin: 0; padding: 20px 12px; color: #999; font-size: 12px; text-align: center; }
.line-comment-floor { border-bottom: 1px solid #e7e7e7; }
.line-comment-item { padding: 10px; border-bottom: 1px solid #e7e7e7; }
.line-comment-floor > .line-comment-item { border-bottom: 0; }
.line-comment-replies { margin: 0 9px 9px 34px; overflow: hidden; background: #f0f0f0; border-radius: 9px; }
.line-comment-replies .line-comment-item { padding: 8px; background: transparent; }
.line-comment-replies .line-comment-item:last-child { border-bottom: 0; }
.line-comment-head { display: grid; grid-template-columns: 24px minmax(0,1fr) auto 26px; align-items: center; gap: 6px; }
.line-comment-head .avatar { width: 24px; height: 24px; flex-basis: 24px; font-size: 9px; }
.line-comment-head strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.line-comment-head small { color: #999; font-size: 9px; }
.line-comment-head button { display: grid; place-items: center; background: transparent; }
.line-comment-item p { margin: 7px 0; font-size: 12px; line-height: 1.55; }
.line-comment-actions { display: flex; gap: 14px; }
.line-comment-actions button { display: flex; align-items: center; gap: 3px; padding: 2px 0; color: #777; background: transparent; font-size: 10px; }
.line-comment-actions .line-comment-like.is-liked { color: #111; font-weight: 750; }
.line-comment-actions .line-comment-like.is-liked svg { fill: #111; }
.line-comment-actions .line-comment-like.is-pulsing svg { animation: line-like-pulse .3s ease; }
.line-reply-context { margin-right: 5px; color: #666; font-weight: 650; }
.line-comment-composer { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; padding: 9px; }
.line-replying-context { grid-column: 1 / -1; display: none; align-items: center; justify-content: space-between; padding: 6px 8px; color: #555; background: #eee; border-radius: 8px; font-size: 10px; }
.line-replying-context.is-visible { display: flex; }
.line-replying-context button { min-width: 22px; width: 22px; height: 22px; padding: 0; color: #666; background: transparent; font-size: 16px; }
.line-comment-composer textarea { grid-column: 1 / -1; min-height: 58px; padding: 8px 9px; border: 1px solid #d5d5d5; border-radius: 9px; resize: none; font: inherit; font-size: 12px; }
.line-comment-composer .line-comment-count { align-self: center; color: #999; font-size: 9px; }
.line-comment-composer button { min-width: 52px; height: 30px; color: #fff; background: #111; border-radius: 999px; font-size: 11px; font-weight: 700; }
.line-comment-composer .line-replying-context button { min-width: 22px; width: 22px; height: 22px; padding: 0; color: #666; background: transparent; border-radius: 50%; font-size: 16px; }
.selection-comment-action { position: absolute; z-index: 85; padding: 8px 14px; color: #fff; background: #111; border-radius: 999px; box-shadow: 0 7px 20px rgba(0,0,0,.2); font-size: 12px; font-weight: 750; transform: translateX(-50%); }

@keyframes line-like-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.36); }
  100% { transform: scale(1); }
}

.dialogue-photo-viewer { position: absolute; z-index: 150; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.94); }
.dialogue-photo-viewer img { max-width: 100%; max-height: 88%; object-fit: contain; }
.dialogue-photo-viewer button { position: absolute; right: 18px; top: 18px; width: 40px; height: 40px; color: #fff; background: rgba(255,255,255,.16); border-radius: 50%; font-size: 22px; }

@media (max-width: 460px) {
  .line-comments-panel { width: calc(100vw - 82px); }
}
