 .preview-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 20px calc(16px + var(--safe-right)) calc(24px + var(--safe-bottom)) calc(16px + var(--safe-left));
  isolation: isolate;
  touch-action: pan-x pan-y;
}

.preview-shell input,.preview-shell textarea,.preview-shell [contenteditable='true'] {
  touch-action: auto;
}

.preview-shell [data-allow-native-zoom],.preview-shell [data-allow-native-zoom] * {
  touch-action: auto !important;
}
.preview-shell[hidden] {
  display: none !important;
}

.preview-shell::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at center, rgba(30, 58, 138, 0.22) 0%, rgba(15, 23, 42, 0.08) 34%, transparent 58%),
    linear-gradient(180deg, rgba(5, 9, 17, 0.16) 0%, rgba(3, 7, 13, 0) 44%);
  pointer-events: none;
}

.preview-shell.is-auth {
  padding: 0;
}

@media (max-width: 719px) {
  .chat-thread-panel[data-viewport-fixed='true'] {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .chat-thread-panel[data-viewport-fixed='true']::before,
  .chat-thread-panel[data-viewport-fixed='true']::after {
    display: none;
  }
}

.preview-shell > * {
  position: relative;
  z-index: 1;
}

.shell-header,
.support-card,
.chat-list-panel,
.shell-banner {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(111, 132, 167, 0.18);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(16, 25, 44, 0.92) 0%, rgba(9, 15, 28, 0.9) 100%),
    rgba(9, 15, 28, 0.88);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
}

.shell-header::before,
.support-card::before,
.chat-list-panel::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(116, 145, 187, 0.28), transparent);
  pointer-events: none;
}

.shell-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  background:
    radial-gradient(circle at top right, rgba(30, 58, 138, 0.14) 0%, transparent 34%),
    linear-gradient(180deg, rgba(17, 27, 48, 0.94) 0%, rgba(9, 15, 28, 0.92) 100%);
}

.shell-main {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.shell-eyebrow,
.panel-copy,
.surface-copy,
.surface-note,
.chat-row-preview,
.chat-row-time,
.message-meta {
  color: var(--text-muted);
}

.shell-eyebrow {
  color: rgba(141, 162, 193, 0.7);
}

.shell-title,
.surface-title,
.panel-title {
  margin: 6px 0 0;
  color: var(--text);
  font-size: 28px;
  line-height: 1.08;
}

.surface-title,
.panel-title {
  font-size: 26px;
}

.panel-copy,
.surface-copy {
  margin: 8px 0 0;
  max-width: 38ch;
  line-height: 1.5;
}

.shell-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.shell-banner {
  border-radius: 20px;
  padding: 12px 16px;
  background: linear-gradient(180deg, rgba(18, 28, 49, 0.94) 0%, rgba(10, 17, 31, 0.92) 100%);
  color: var(--loading-text);
}

.support-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
}

.bottom-nav {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
  flex: 0 0 auto;
}

.empty-copy,
.thread-empty {
  padding: 18px;
  border: 1px solid rgba(103, 125, 158, 0.14);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(14, 22, 39, 0.76) 0%, rgba(9, 14, 27, 0.74) 100%);
  color: var(--text-muted);
}

.surface-note {
  color: rgba(136, 155, 183, 0.72);
  line-height: 1.5;
}

@media (min-width: 720px) {
  .preview-shell {
    padding-bottom: calc(24px + var(--safe-bottom));
  }

  .preview-shell.is-auth {
    padding: 0;
  }
}
