.cross-examine {
  margin: 4rem auto 2rem;
  padding-top: 2rem;
  border-top: 1px solid #222;
  color: #d4d4d4;
  font-family: Georgia, "Times New Roman", serif;
}

.cross-examine * {
  box-sizing: border-box;
}

.ce-header h2,
.ce-public h3 {
  color: #fff;
  border-bottom: 1px solid #222;
  padding-bottom: 0.3em;
  margin: 0.2em 0 0.8em;
}

.ce-label,
.ce-meta,
.ce-debate-meta,
.ce-status,
.ce-final,
.ce-submit,
.ce-secondary-button,
.ce-input,
.ce-textarea {
  font-family: "Courier New", monospace;
}

.ce-label {
  display: inline-block;
  color: #00ff41;
  border: 1px solid #333;
  padding: 3px 10px;
  font-size: 0.7rem;
  letter-spacing: 3px;
}

.ce-disclaimer {
  color: #888;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.ce-public {
  margin-bottom: 2rem;
}

.ce-empty,
.ce-final {
  color: #777;
  font-size: 0.9rem;
}

.ce-debate {
  border-left: 3px solid #333;
  padding: 0.9rem 0 0.9rem 1rem;
  margin: 1rem 0;
  background: #0d0d0d;
}

.ce-debate-meta {
  color: #777;
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
}

.ce-debate-reader,
.ce-debate-ai {
  margin: 0.6rem 0;
  font-size: 0.95rem;
  line-height: 1.55;
}

.ce-debate-reader {
  color: #e0e0e0;
}

.ce-debate-ai {
  color: #aaa;
}

.ce-chat {
  border: 1px solid #222;
  background: #101010;
  padding: 1rem;
}

.ce-messages {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 520px;
  overflow-y: auto;
  padding-bottom: 1rem;
}

.ce-message {
  display: flex;
}

.ce-message--reader {
  justify-content: flex-end;
}

.ce-message--ai {
  justify-content: flex-start;
}

.ce-bubble {
  max-width: min(86%, 560px);
  border: 1px solid #2a2a2a;
  padding: 0.8rem 0.9rem;
  background: #151515;
}

.ce-message--reader .ce-bubble {
  border-color: rgba(0, 255, 65, 0.45);
  background: #0f1a12;
}

.ce-meta {
  color: #777;
  font-size: 0.72rem;
  margin-bottom: 0.35rem;
}

.ce-body {
  color: #dcdcdc;
  font-size: 0.96rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ce-status {
  color: #777;
  font-size: 0.76rem;
  margin: 0.4rem 0 0.8rem;
}

.ce-form {
  display: grid;
  gap: 0.75rem;
}

.ce-controls {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.ce-input,
.ce-textarea {
  width: 100%;
  border: 1px solid #333;
  border-radius: 2px;
  background: #0a0a0a;
  color: #e0e0e0;
  font-size: 0.9rem;
  line-height: 1.4;
}

.ce-input {
  flex: 1 1 180px;
  min-height: 44px;
  padding: 0 0.75rem;
}

.ce-textarea {
  min-height: 110px;
  resize: vertical;
  padding: 0.75rem;
}

.ce-input:focus,
.ce-textarea:focus {
  outline: none;
  border-color: #00ff41;
}

.ce-submit,
.ce-secondary-button {
  min-height: 44px;
  border: 1px solid #00ff41;
  border-radius: 2px;
  background: transparent;
  color: #00ff41;
  cursor: pointer;
  letter-spacing: 1px;
}

.ce-submit {
  flex: 0 0 auto;
  padding: 0 1.2rem;
}

.ce-secondary-button {
  padding: 0 0.9rem;
  margin-top: 0.6rem;
}

.ce-submit:hover,
.ce-secondary-button:hover {
  background: rgba(0, 255, 65, 0.08);
}

.ce-submit:disabled,
.ce-input:disabled,
.ce-textarea:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

:root[data-theme="light"] .cross-examine {
  color: #1a1a1a;
  border-top-color: #d0d0d0;
}

:root[data-theme="light"] .ce-header h2,
:root[data-theme="light"] .ce-public h3 {
  color: #0a0a0a;
  border-bottom-color: #d0d0d0;
}

:root[data-theme="light"] .ce-label,
:root[data-theme="light"] .ce-submit,
:root[data-theme="light"] .ce-secondary-button {
  color: #1a8a2a;
  border-color: #1a8a2a;
}

:root[data-theme="light"] .ce-disclaimer,
:root[data-theme="light"] .ce-status,
:root[data-theme="light"] .ce-empty,
:root[data-theme="light"] .ce-final,
:root[data-theme="light"] .ce-meta,
:root[data-theme="light"] .ce-debate-meta {
  color: #555;
}

:root[data-theme="light"] .ce-chat,
:root[data-theme="light"] .ce-debate,
:root[data-theme="light"] .ce-bubble {
  background: #f4f4f0;
  border-color: #d0d0d0;
}

:root[data-theme="light"] .ce-message--reader .ce-bubble {
  background: #eef6ee;
  border-color: rgba(26, 138, 42, 0.45);
}

:root[data-theme="light"] .ce-body,
:root[data-theme="light"] .ce-debate-reader {
  color: #1a1a1a;
}

:root[data-theme="light"] .ce-debate-ai {
  color: #444;
}

:root[data-theme="light"] .ce-input,
:root[data-theme="light"] .ce-textarea {
  background: #fafaf7;
  color: #1a1a1a;
  border-color: #bbb;
}

@media (max-width: 600px) {
  .cross-examine {
    margin-top: 3rem;
  }

  .ce-chat {
    padding: 0.75rem;
  }

  .ce-bubble {
    max-width: 94%;
  }

  .ce-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .ce-submit {
    width: 100%;
  }
}
