.submission-page {
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 26%),
    linear-gradient(180deg, #f8fbff 0%, #edf3fb 100%);
}

.submission-hero {
  padding-bottom: 1rem;
}

.submission-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 1.6rem;
  align-items: center;
}

.submission-hero-copy {
  max-width: 720px;
}

.submission-hero-copy h1 {
  margin: 0 0 0.85rem;
  font-family: 'Sora', sans-serif;
  font-size: clamp(2.6rem, 4.6vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
  color: var(--blue-950);
  text-wrap: balance;
}

.submission-hero-lead {
  max-width: 38rem;
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.72;
}

.submission-hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.1rem;
}

.submission-hero-points span {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.86);
  border: 1px solid rgba(37, 99, 235, 0.08);
  color: var(--blue-900);
  font-weight: 600;
}

.submission-hero-panel {
  display: flex;
  justify-content: flex-end;
}

.submission-preview-card {
  display: grid;
  gap: 0.42rem;
  padding: 0.95rem 1rem;
  border-radius: 20px;
  background: rgba(255,255,255,0.76);
  border: 1px solid rgba(37, 99, 235, 0.07);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.05);
}

.submission-preview-card-compact {
  max-width: 320px;
}

.submission-preview-label {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue-700);
  font-weight: 700;
}

.submission-preview-text {
  margin: 0;
  color: var(--text);
  line-height: 1.62;
}

.submission-preview-text + .submission-preview-text {
  color: var(--muted);
  font-size: 0.95rem;
}

.submission-layout {
  display: grid;
  grid-template-columns: minmax(220px, 270px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.submission-side-panel {
  display: grid;
  gap: 1rem;
  position: sticky;
  top: 108px;
}

.submission-side-card,
.chat-stage-page {
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(37, 99, 235, 0.07);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.05);
}

.submission-side-card {
  border-radius: 26px;
  padding: 1.2rem;
}

.submission-side-card-minimal {
  background: rgba(255,255,255,0.7);
}

.submission-feature-list {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--text);
  line-height: 1.72;
}

.submission-feature-list-plain {
  display: grid;
  gap: 0.65rem;
}

.chat-stage-page {
  border-radius: 28px;
  padding: 0.9rem;
  backdrop-filter: blur(8px);
}

.chat-stage-shell {
  display: grid;
  gap: 0.9rem;
}

.chat-stage-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.chat-stage-top h2 {
  color: var(--blue-950);
}

.chat-stage-top-minimal .eyebrow {
  margin-bottom: 0.45rem;
}

.chat-stage-intro {
  margin: 0.3rem 0 0;
  color: var(--muted);
  line-height: 1.58;
  max-width: 34rem;
}

.btn-mail-direct {
  white-space: nowrap;
}

.chat-progress {
  margin-bottom: 0.05rem;
}

.chat-progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  overflow: hidden;
}

.chat-progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--blue-700), var(--blue-500));
  transition: width 0.22s ease;
}

.chat-progress-label {
  margin: 0.55rem 0 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.chat-app-frame {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 700px;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(180deg, #0f172a 0%, #13233e 100%);
  border: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: 0 22px 42px rgba(15, 23, 42, 0.12);
}

.chat-app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.95rem 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  background: rgba(255,255,255,0.02);
}

.chat-app-identity {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.chat-app-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, #60a5fa, #22d3ee);
  box-shadow: 0 0 14px rgba(96, 165, 250, 0.7);
  flex: 0 0 auto;
}

.chat-app-title,
.chat-app-subtitle {
  margin: 0;
}

.chat-app-title {
  color: #f8fbff;
  font-weight: 700;
}

.chat-app-subtitle {
  color: rgba(226, 232, 240, 0.72);
  font-size: 0.84rem;
}

.chat-app-badge {
  padding: 0.38rem 0.68rem;
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.12);
  border: 1px solid rgba(125, 211, 252, 0.16);
  color: #dbeafe;
  font-size: 0.78rem;
  font-weight: 700;
}

.chat-window {
  min-height: 540px;
  max-height: 72vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.95rem;
  scroll-behavior: smooth;
}

.message-row {
  display: flex;
}

.message-row.bot {
  justify-content: flex-start;
}

.message-row.user {
  justify-content: flex-end;
}

.message-bubble {
  max-width: min(80%, 660px);
  border-radius: 20px;
  padding: 0.9rem 0.95rem 0.72rem;
  line-height: 1.6;
  white-space: pre-wrap;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
  animation: bubbleIn 0.22s ease;
}

.message-row.bot .message-bubble {
  background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(243,247,255,0.95) 100%);
  border: 1px solid rgba(96, 165, 250, 0.14);
  color: var(--text);
  border-top-left-radius: 12px;
}

.message-row.user .message-bubble {
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  border: 1px solid rgba(191, 219, 254, 0.16);
  color: #f8fbff;
  border-top-right-radius: 12px;
}

.message-meta {
  margin-top: 0.48rem;
  font-size: 0.75rem;
  opacity: 0.64;
}

.chat-composer {
  padding: 0.85rem 0.95rem 0.95rem;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  background: rgba(8, 20, 37, 0.4);
}

.chat-composer textarea {
  width: 100%;
  min-height: 78px;
  max-height: 200px;
  resize: vertical;
  border-radius: 16px;
  border: 1px solid rgba(96, 165, 250, 0.14);
  background: rgba(255,255,255,0.07);
  padding: 0.9rem 0.95rem;
  font: inherit;
  color: #f8fbff;
}

.chat-composer textarea::placeholder {
  color: rgba(226, 232, 240, 0.5);
}

.chat-composer textarea:focus {
  outline: 2px solid rgba(96, 165, 250, 0.18);
  border-color: rgba(125, 211, 252, 0.26);
}

.chat-composer textarea:disabled {
  background: rgba(255,255,255,0.05);
  color: rgba(226, 232, 240, 0.62);
  cursor: not-allowed;
}

.chat-composer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.chat-composer-hint {
  margin: 0;
  font-size: 0.82rem;
  color: rgba(226, 232, 240, 0.7);
}

.chat-final-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.1rem;
}

#submitSubmissionBtn[disabled],
#sendBtn[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.submission-toast {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 80;
  min-width: 280px;
  max-width: min(420px, calc(100% - 2rem));
  padding: 1rem 1.05rem;
  border-radius: 20px;
  background: rgba(9, 20, 39, 0.96);
  color: #f8fbff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.22);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.submission-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.submission-toast p {
  margin: 0;
  line-height: 1.6;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes bubbleIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  .submission-layout {
    grid-template-columns: 1fr;
  }

  .submission-side-panel {
    position: static;
  }

  .chat-app-frame,
  .chat-window {
    min-height: 560px;
  }
}

@media (max-width: 980px) {
  .submission-hero-grid {
    grid-template-columns: 1fr;
  }

  .submission-hero-panel {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .chat-stage-top,
  .chat-composer-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .chat-app-header {
    flex-direction: column;
    align-items: stretch;
  }

  .chat-window {
    min-height: 460px;
    max-height: none;
    padding: 0.95rem;
  }

  .message-bubble {
    max-width: 95%;
  }

  .btn-mail-direct {
    white-space: normal;
  }

  .chat-composer-hint {
    text-align: center;
  }

  .chat-final-actions {
    justify-content: stretch;
  }

  .chat-stage-page,
  .submission-side-card {
    padding: 1rem;
    border-radius: 24px;
  }

  .chat-app-frame {
    min-height: 0;
    border-radius: 22px;
  }

  .submission-toast {
    right: 1rem;
    left: 1rem;
    bottom: 1rem;
    max-width: none;
  }
}
