* {
  box-sizing: border-box;
  font-family: sans-serif;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: #f4f4f5;
  color: #333;
}

.top-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: #fff;
  border-bottom: 1px solid #ddd;
}

.top-panel h1 {
  margin: 0;
  font-size: 1.5rem;
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.toggle-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Toggle Switch CSS */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
}

input:checked + .slider {
  background-color: #2196F3;
}

input:checked + .slider:before {
  transform: translateX(26px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

.main-content {
  display: flex;
  flex-shrink: 0;
}

.left-panel {
  flex: 1;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-width: 800px;
  margin: 0 auto;
}

.left-panel {
  background: #fafafa;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-top: 2rem;
}

.tab-pane {
  display: none;
  height: 100%;
}

.tab-pane.active {
  display: flex;
  flex-direction: column;
}

.config-form {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 1rem;
  padding-right: 5px;
}

.input-group {
  margin-bottom: 1.5rem;
}

.input-group label {
  display: block;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

input[type="text"], select, textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.header-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.remove-header-btn {
  background: #e74c3c;
  color: white;
  border: none;
  cursor: pointer;
  border-radius: 4px;
  padding: 0 10px;
}

#add-header-btn, #send-btn {
  padding: 0.5rem 1rem;
  cursor: pointer;
  border: none;
  border-radius: 4px;
  background: #3498db;
  color: white;
  font-weight: bold;
}

#send-btn {
  width: 100%;
  padding: 0.8rem;
  background: #2ecc71;
  font-size: 1.1rem;
  flex-shrink: 0;
}

pre {
  background: #282c34;
  color: #abb2bf;
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.bottom-panel {
  background: #fff;
  border-top: 1px solid #ddd;
  min-height: 35vh;
  display: flex;
  flex-direction: column;
}

/* Tabs UI */
.tabs-header {
  display: flex;
  background: #f6f8fa;
  border-bottom: 1px solid #d0d7de;
}

.tab-btn {
  padding: 8px 24px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: #57606a;
  position: relative;
  transition: 0.2s;
}

.tab-btn:hover {
  background: #eaeef2;
}

.tab-btn.active {
  color: #1f2328;
  font-weight: 600;
}

.tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #fd8c00; /* PostSense Orange */
}

.tabs-content {
  flex: 1;
  padding: 1rem 2rem;
}

.count-badge {
  background: #d0d7de;
  color: #1f2328;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 4px;
}


.bottom-panel h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
}

#issues-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.issue-card {
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 4px;
  border-left: 5px solid #ccc;
  background: #fdfdfd;
}

.issue-card.severity-warning {
  border-left-color: #f39c12;
  background: #fdfae5;
}

.issue-card.severity-error {
  border-left-color: #e74c3c;
  background: #fdf3f2;
}

.issue-title {
  font-weight: bold;
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.severity-warning .issue-title {
  color: #d68910;
}

.severity-error .issue-title {
  color: #c0392b;
}

.issue-why {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  color: #333;
}

.issue-fix {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  background: rgba(0,0,0,0.05);
  padding: 0.5rem;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.issue-fix code {
  color: #c0392b;
  font-family: monospace;
}

.copy-fix-btn {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
  font-size: 0.8rem;
  transition: 0.2s;
}

.copy-fix-btn:hover {
  background: #eee;
}

/* Assistant Features */
.section-header {
  font-weight: bold;
  margin-bottom: 8px;
  color: #555;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.suggested-actions-container {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #ccc;
}

.action-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fff;
  border: 1px solid #e0e0e0;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 8px;
  transition: all 0.2s;
}

.action-item:hover {
  border-color: #3498db;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.action-label {
  font-size: 0.9rem;
  font-weight: 500;
  flex: 1;
}

.confidence-tag {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: bold;
}

.confidence-high {
  background: #eafaf1;
  color: #27ae60;
  border: 1px solid #27ae60;
}

.confidence-medium {
  background: #fef9e7;
  color: #f39c12;
  border: 1px solid #f39c12;
}

.action-btn {
  background: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: bold;
  white-space: nowrap;
}

.action-btn:hover {
  background: #2980b9;
}

.suggestion-reasoning {
  font-size: 0.8rem;
  color: #27ae60;
  margin-top: -4px;
  margin-bottom: 10px;
  margin-left: 12px;
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 5px;
}

.suggestion-reasoning::before {
  content: '✓';
  font-weight: bold;
}

/* Promoted Issue Styles */
.supporting-status {
  font-size: 0.75rem;
  background: rgba(0,0,0,0.05);
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  margin-left: 10px;
  font-weight: normal;
  color: #666;
}

.delta-list {
  margin: 5px 0 10px 15px;
  padding: 0;
  font-size: 0.85rem;
  color: #444;
}

.delta-item {
  margin-bottom: 2px;
}
/* Timeline UI Refactor (Compact & Collapsible) */
.timeline-summary-bar {
  background: #f6f8fa;
  border: 1px solid #d0d7de;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 15px;
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.timeline-container {
  margin-top: 10px;
  position: relative;
  padding-left: 25px;
  border-left: 2px solid #d0d7de;
}

.timeline-entry {
  position: relative;
  margin-bottom: 8px; /* Reduced */
  font-size: 0.85rem;
}

/* Debugger Transformation Styles */
.step-group-summary {
  color: #57606a;
  font-size: 0.85rem;
  padding: 8px 0;
  cursor: pointer;
  border-bottom: 1px dashed #d0d7de;
  margin-bottom: 12px;
}

.step-group-summary:hover {
  text-decoration: underline;
}

.timeline-entry.muted-step {
  opacity: 0.5;
  filter: grayscale(0.5);
  font-size: 0.8rem;
}

/* Breakpoint Card */
.breakpoint-card {
  background: #fff;
  border: 2px solid #cf222e; /* Failure Red */
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(207, 34, 46, 0.15);
  margin: 16px 0;
  padding: 0;
  overflow: hidden;
  position: relative;
  animation: breakpoint-scale 0.3s ease-out;
}

@keyframes breakpoint-scale {
  0% { transform: scale(0.98); opacity: 0.5; }
  100% { transform: scale(1); opacity: 1; }
}

.breakpoint-header {
  background: #cf222e;
  color: #fff;
  padding: 8px 16px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.breakpoint-body {
  padding: 16px;
}

.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 16px;
}

.comp-box {
  background: #f6f8fa;
  padding: 10px;
  border-radius: 6px;
}

.comp-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #57606a;
  margin-bottom: 4px;
}

.comp-value {
  font-family: monospace;
  font-size: 0.9rem;
  font-weight: 600;
}

.comp-value.expected { color: #2da44e; }
.comp-value.actual { color: #cf222e; }

.breakpoint-impact {
  font-size: 0.9rem;
  color: #1f2328;
  border-left: 3px solid #cf222e;
  padding-left: 12px;
  margin-bottom: 16px;
}

.breakpoint-action {
  display: flex;
  gap: 12px;
  align-items: center;
}

.debugger-step-highlight {
    outline: 2px solid #fd8c00;
    outline-offset: 4px;
    background: #fff8c5 !important;
    transition: background 0.5s ease-out;
}

.timeline-section-divider {
    text-align: center;
    position: relative;
    margin: 20px 0;
}

.timeline-section-divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #d0d7de;
    z-index: 0;
}

.timeline-section-divider span {
    background: #f4f4f5;
    padding: 0 10px;
    color: #57606a;
    font-size: 0.8rem;
    position: relative;
    z-index: 1;
}

.delta-item::before {
  content: '• ';
  color: #3498db;
  font-weight: bold;
}

/* Button Styling Fixes */
.toggle-details-btn, .quick-fix-btn {
  background: #f6f8fa;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  color: #24292f;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 0 rgba(27, 31, 35, 0.04);
  margin-top: 10px;
}

.toggle-details-btn:hover, .quick-fix-btn:hover {
  background-color: #f3f4f6;
  border-color: rgba(27, 31, 35, 0.15);
  box-shadow: 0 1px 0 rgba(27, 31, 35, 0.1);
}

/* Primary Action variation for Breakpoint Card */
.breakpoint-card .toggle-details-btn {
    background: #0969da;
    color: white;
    border: 1px solid rgba(27, 31, 35, 0.15);
    box-shadow: 0 1px 0 rgba(27, 31, 35, 0.1);
    margin-top: 0;
}

.breakpoint-card .toggle-details-btn:hover {
    background: #0860ca;
    transform: translateY(-1px);
}

.reasoning-panel {
  margin-bottom: 25px;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

/* Comparison System Styles */
.compare-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f6f8fa;
  border-bottom: 1px solid #d0d7de;
}

.compare-container {
  padding: 16px;
}

.diff-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.diff-row {
  border: 1px solid #d0d7de;
  border-radius: 8px;
  overflow: hidden;
}

.diff-row-header {
  background: #f6f8fa;
  padding: 8px 12px;
  font-weight: 600;
  border-bottom: 1px solid #d0d7de;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.diff-row-body {
  display: flex;
  background: #fff;
}

.diff-col {
  flex: 1;
  padding: 12px;
  min-width: 0;
}

.diff-col:first-child {
  border-right: 1px solid #d0d7de;
  background-color: #f0fff4; /* Light green for baseline */
}

.diff-col:last-child {
  background-color: #fff5f5; /* Light red for current */
}

.diff-label {
  font-size: 0.75rem;
  color: #57606a;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.diff-value {
  font-family: monospace;
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-break: break-all;
}

.diff-value.changed {
  color: #cf222e;
  font-weight: bold;
}

.empty-compare-state {
  text-align: center;
  color: #57606a;
  padding: 40px;
  font-style: italic;
}

.json-diff-item {
  margin-bottom: 8px;
  padding: 4px 8px;
  border-radius: 4px;
}

.json-changed { border-left: 3px solid #bf8700; background: #fff8c5; }
.json-added { border-left: 3px solid #2da44e; background: #dafbe1; }
.json-removed { border-left: 3px solid #cf222e; background: #ffebe9; }

.diff-action-btn {
  font-size: 0.7rem;
  padding: 2px 6px;
  background: #fff;
  border: 1px solid #d0d7de;
  border-radius: 4px;
  cursor: pointer;
}

.diff-action-btn:hover {
  background: #f3f4f6;
}

.confidence-tag {
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  font-weight: bold;
}

.tag-high { background: #dafbe1; color: #1a7f37; border: 1px solid #2da44e; }
.tag-medium { background: #fff8c5; color: #9a6700; border: 1px solid #bf8700; }
.tag-low { background: #ffebe9; color: #cf222e; border: 1px solid #d73a49; }

.fallback-banner {
  background: #f6f8fa;
  border: 1px dashed #d0d7de;
  color: #57606a;
  padding: 8px;
  font-size: 0.75rem;
  border-radius: 4px;
  margin-bottom: 12px;
  text-align: center;
  font-weight: bold;
}

.observed-fact {
  font-size: 0.85rem;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eee;
}

.probe-loading {
  text-align: center;
  padding: 40px;
  font-size: 0.9rem;
  color: #0969da;
  font-weight: bold;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

.probe-btn {
  background-color: #0969da !important;
  color: white !important;
  border: none !important;
}

.probe-btn:hover {
  background-color: #0550ae !important;
}
