.reply-page {
  max-width: 1600px;
}

.reply-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 14px;
}

.reply-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.reply-actions select,
.reply-actions input,
.custom-date-row input {
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 11px;
  background: #020617;
  color: #ffffff;
}

.reply-actions button,
.metric-card,
.verify-actions button,
#saveManualBtn,
.open-btn,
.custom-date-row button {
  border: 0;
  border-radius: 10px;
  padding: 11px 14px;
  cursor: pointer;
  font-weight: 900;
}

.reply-actions button,
#saveManualBtn,
.open-btn,
.custom-date-row button {
  background: #2563eb;
  color: #ffffff;
}

.period-badge {
  display: inline-flex;
  margin-top: 10px;
  padding: 8px 11px;
  border-radius: 999px;
  border: 1px solid #334155;
  background: #020617;
  color: #bfdbfe;
  font-size: 12px;
  font-weight: 900;
}

.custom-date-row {
  display: flex;
  align-items: end;
  gap: 10px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 14px;
}

.custom-date-row label {
  display: block;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 900;
  margin-bottom: 5px;
}

.friendly-note {
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(96, 165, 250, 0.22);
  color: #cbd5e1;
  border-radius: 14px;
  padding: 13px 15px;
  margin-bottom: 14px;
  line-height: 1.45;
}

.friendly-note strong {
  color: #ffffff;
}

.reply-card-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.metric-card {
  text-align: left;
  background: #0f172a;
  border: 1px solid #334155;
  color: #ffffff;
  padding: 16px;
}

.metric-card:hover {
  border-color: #60a5fa;
  background: #172033;
}

.metric-card p {
  margin: 0;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 900;
}

.metric-card h2 {
  margin: 8px 0 4px;
  font-size: 30px;
}

.metric-card span {
  color: #94a3b8;
  font-size: 12px;
}

.ab-panel,
.reply-table-panel,
.message-panel,
.comparison-panel {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 16px;
  overflow: hidden;
}

.ab-panel {
  margin-bottom: 16px;
}

.panel-header {
  padding: 16px;
  border-bottom: 1px solid #334155;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.panel-header.no-border {
  border-bottom: 0;
}

.panel-header h2 {
  margin: 0;
}

.panel-header p {
  margin: 4px 0 0;
  color: #94a3b8;
}

.scan-info {
  background: #020617;
  border: 1px solid #334155;
  border-radius: 999px;
  color: #bfdbfe;
  padding: 8px 11px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.table-wrap {
  overflow-x: auto;
  max-height: 620px;
  overflow-y: auto;
}

.ab-table,
.reply-table {
  width: 100%;
  border-collapse: collapse;
}

.reply-table {
  min-width: 900px;
}

.ab-table {
  min-width: 720px;
}

.ab-table th,
.ab-table td,
.reply-table th,
.reply-table td {
  padding: 12px;
  border-top: 1px solid #334155;
  text-align: left;
  vertical-align: top;
}

.ab-table th,
.reply-table th {
  color: #93c5fd;
  font-size: 12px;
  text-transform: uppercase;
}

.ab-number {
  color: #ffffff;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
}

.ab-number:hover {
  color: #60a5fa;
}

.comparison-panel {
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.comparison-panel h2 {
  margin: 0;
}

.comparison-panel p {
  margin: 4px 0 0;
  color: #94a3b8;
}

.winner-box {
  background: #020617;
  border: 1px solid #334155;
  color: #e5e7eb;
  border-radius: 14px;
  padding: 14px;
  min-width: 300px;
  font-weight: 900;
  line-height: 1.55;
}

.winner-box .muted {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
}

.reply-layout {
  display: grid;
  grid-template-columns: minmax(720px, 1fr) 420px;
  gap: 16px;
  align-items: start;
}

.reply-row {
  cursor: pointer;
}

.reply-row:hover,
.reply-row.active {
  background: #172033;
}

.version-badge,
.category-badge,
.version-pill,
.leader-badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 8px;
  font-weight: 900;
  font-size: 11px;
}

.version-A {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
}

.version-B {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.version-Unknown {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
}

.category-badge {
  background: rgba(250, 204, 21, 0.15);
  color: #facc15;
}

.leader-badge {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.message-panel {
  min-height: 620px;
}

.empty-message {
  padding: 30px;
  text-align: center;
  color: #94a3b8;
}

.empty-message h2 {
  margin: 0 0 8px;
  color: #ffffff;
}

.message-detail {
  padding: 18px;
}

.detail-top h2 {
  margin: 10px 0 4px;
  color: #ffffff;
  line-height: 1.3;
}

.detail-top p {
  color: #94a3b8;
  word-break: break-word;
}

.ai-analysis-box {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(139, 92, 246, 0.10));
  border: 1px solid rgba(96, 165, 250, 0.18);
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.ai-analysis-box span {
  display: block;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 900;
}

.ai-analysis-box strong {
  color: #ffffff;
  font-size: 18px;
}

.ai-analysis-box p {
  margin: 0;
  color: #cbd5e1;
  line-height: 1.45;
}

.verify-box {
  background: #020617;
  border: 1px solid #334155;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 14px;
}

.verify-box strong {
  color: #ffffff;
}

.verify-box p {
  color: #94a3b8;
  margin: 6px 0 12px;
}

.verify-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.verify-actions button:first-child {
  background: #16a34a;
  color: #ffffff;
}

.verify-actions button:last-child {
  background: #dc2626;
  color: #ffffff;
}

.verify-box select {
  width: 100%;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 11px;
  background: #020617;
  color: #ffffff;
  margin-bottom: 10px;
}

#saveManualBtn {
  width: 100%;
}

.message-body-card {
  background: #020617;
  border: 1px solid #334155;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 14px;
}

.message-body-card h3 {
  margin: 0 0 10px;
  color: #ffffff;
}

.detail-body {
  color: #e5e7eb;
  line-height: 1.6;
  white-space: pre-wrap;
  max-height: 360px;
  overflow-y: auto;
}

.open-btn {
  width: 100%;
}

.hidden {
  display: none !important;
}

@media (max-width: 1200px) {
  .reply-header,
  .comparison-panel,
  .panel-header {
    flex-direction: column;
  }

  .reply-actions,
  .reply-actions select,
  .reply-actions input,
  .reply-actions button,
  .custom-date-row,
  .custom-date-row button,
  .custom-date-row input {
    width: 100%;
  }

  .custom-date-row {
    flex-direction: column;
    align-items: stretch;
  }

  .reply-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .reply-layout {
    grid-template-columns: 1fr;
  }
}
