:root {
  --bg: #0b0f13;
  --card: #0f1720;
  --muted: #9aa6b2;
  --accent: #1ee07a;
  --accent-2: #23d160;
  --glass: rgba(255, 255, 255, 0.04);
}
* {
  box-sizing: border-box;
}
body {
  font-family: Inter, Roboto, Arial, sans-serif;
  background: var(--bg);
  margin: 0;
  color: #e6eef3;
  -webkit-font-smoothing: antialiased;
}
.hero {
  padding: 56px 20px 32px;
  text-align: center;
}
.hero-inner {
  max-width: 860px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 6px;
}
.logo {
  font-size: 26px;
}
.title {
  color: var(--accent);
  font-weight: 700;
  font-size: 20px;
}
.hero h1 {
  margin: 6px 0 8px;
  font-size: 40px;
  color: #ffd27a;
}
.subtitle {
  color: var(--muted);
  margin: 0 0 12px;
}
.badges {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 8px;
}
.badge {
  background: var(--glass);
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
}

.center-card {
  max-width: 900px;
  margin: 20px auto;
  padding: 0 20px;
}
.card {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.02),
    rgba(255, 255, 255, 0.01)
  );
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 8px 30px rgba(2, 6, 23, 0.6);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card input[type="text"] {
  background: #071018;
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 18px;
  border-radius: 10px;
  color: #dfeff3;
  font-size: 16px;
  width: 100%;
}
.primary {
  background: var(--accent);
  color: #042214;
  border: none;
  padding: 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
}
.primary:hover {
  background: var(--accent-2);
}
.chips {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.chip {
  background: #071018;
  border: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--muted);
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
}
.progress-label {
  flex: 1;
  color: var(--muted);
}
.global-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 420px;
}
.global-progress-bg {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  overflow: hidden;
}
.global-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  width: 0%;
  transition: width 0.6s ease;
}
.global-progress-percent {
  width: 36px;
  text-align: right;
  color: var(--accent-2);
  font-weight: 700;
}

/* Agent progress styles (three agents visible during a run) */
.agent-progress {
  margin-top: 14px;
}
.agent-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}
.agent-name {
  width: 160px;
  color: var(--muted);
  font-weight: 600;
}
.progress-bar-bg.small {
  flex: 1;
  height: 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  width: 0%;
  transition: width 0.5s ease;
}
.progress-percent {
  width: 48px;
  text-align: right;
  color: var(--accent-2);
  font-weight: 700;
}

.smallfoot {
  max-width: 900px;
  margin: 28px auto;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.smallfoot a {
  color: inherit;
  opacity: 0.8;
  text-decoration: none;
  margin: 0 6px;
}

/* Share / secondary button styling */
.secondary {
  background: transparent;
  color: #e6eef3;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 14px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}
.secondary:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Report action container */
#report-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 50;
  pointer-events: auto;
}

/* Strong override: ensure no ancestor or overlay can block clicks on these buttons */
#report-actions,
#report-actions * {
  pointer-events: auto !important;
  z-index: 99999 !important;
  position: relative !important;
}
/* Button sizing for report actions */
#report-actions .primary,
#report-actions .secondary {
  padding: 12px 24px !important;
  min-width: 240px !important;
  font-size: 14px !important;
  margin: 0 !important;
}
/* Ensure secondary button in the report actions matches primary visually */
#report-actions .secondary {
  background: var(--accent);
  color: #042214;
  border: none;
}
#report-actions .secondary:hover {
  background: var(--accent-2);
}

.report-preview {
  color: #dfeff3;
  font-family: monospace;
  white-space: pre-wrap;
}

/* Visual 'disabled' state for buttons — keeps them clickable for JS fallbacks */
.disabled {
  opacity: 0.6;
  filter: grayscale(20%);
  cursor: default;
}

/* Print modal overlay */
.print-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(2,6,23,0.6);
  z-index: 100000;
  padding: 20px;
}
.print-modal.show {
  display: flex;
}
.print-modal-content {
  background: #071018;
  color: #dfeff3;
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.7);
  overflow: auto;
  padding: 18px;
  position: relative;
}
.print-modal-header {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:12px;
}
.print-modal .close-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid rgba(255,255,255,0.04);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.print-modal .print-btn {
  background: var(--accent);
  color: #042214;
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}
.print-modal .report-body {
  /* allow normal HTML flow for formatted report content */
  white-space: normal;
  font-family: Inter, Roboto, Arial, sans-serif;
  line-height: 1.5;
  color: #dfeff3;
}

.print-modal .report-body h3 {
  margin: 12px 0 6px;
  font-size: 18px;
  font-weight: 700 !important;
  color: #ffd27a;
}
.print-modal .report-body .report-heading {
  font-weight: 800 !important;
  color: #ffd27a;
}
.print-modal .report-body .critical-figure {
  font-weight: 800;
  color: #ffffff;
}
.print-modal .report-body hr.report-hr {
  border: 0;
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 12px 0;
}
.print-modal .report-body p {
  margin: 8px 0;
  color: #dfeff3;
}
.print-modal .report-body ul,
.print-modal .report-body ol {
  margin: 6px 0 6px 20px;
}
.print-modal .report-body li {
  margin: 3px 0;
  line-height: 1.4;
}

.print-modal .report-body ul {
  list-style: disc inside;
}
.print-modal .report-body ol {
  list-style: disc inside !important;  /* Force bullets for numbered lists */
}

/* Result area preformatted style */
.report-output-pre {
  white-space: pre-wrap;
  font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
  color: #dfeff3;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
}

#report-output {
  margin-top: 14px;
  background: #071018;
  border-radius: 8px;
  padding: 18px;
  color: #cfe9d8;
}
#error-section {
  color: #ff6b6b;
  margin-top: 12px;
}

/* Responsive tweaks for mobile */
@media (max-width: 600px) {
  .hero {
    padding: 32px 12px 20px;
  }
  .hero h1 {
    font-size: 28px;
  }
  .hero-inner {
    padding: 0 8px;
  }
  .title {
    font-size: 18px;
  }
  .center-card {
    padding: 0 12px;
  }
  .card {
    padding: 14px;
  }
  .card input[type="text"] {
    padding: 12px;
    font-size: 15px;
  }
  .primary {
    width: 100%;
    padding: 12px;
    font-size: 16px;
  }
  .chips {
    justify-content: center;
  }

  /* Responsive action buttons for mobile */
  #report-actions {
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    text-align: center !important;
  }
  
  #report-actions button {
    width: 100%;
    margin: 0 !important;
    padding: 14px 16px !important;
    font-size: 15px !important;
    min-width: auto !important;
  }
  
  #report-actions #print-report-btn {
    margin-bottom: 0 !important;
  }

  /* make agent rows wrap on small screens so name stacks above bar */
  .agent-row {
    flex-wrap: wrap;
  }
  .agent-name {
    width: 100%;
    margin-bottom: 8px;
  }
  .progress-bar-bg.small {
    width: 100%;
  }
  .progress-percent {
    width: auto;
    text-align: right;
  }
}

@media print {
  body * {
    visibility: hidden;
  }
  .print-modal, .print-modal * {
    visibility: visible;
  }
  .print-modal {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: auto;
    background: white;
    color: black;
    padding: 0;
    margin: 0;
    overflow: visible;
    z-index: 9999;
  }
  .print-modal-header, .close-btn, .print-btn, .secondary, #print-modal-toggle-md {
    display: none !important;
  }
  .print-modal-content {
    box-shadow: none;
    border: none;
    padding: 20px;
    width: 100%;
  }
  .report-body {
    color: black;
    font-size: 12pt;
    line-height: 1.5;
  }
  .report-body h3, .report-body .report-heading {
    color: black;
    border-bottom: 1px solid #000;
    margin-top: 14px;
    margin-bottom: 6px;
    font-weight: bold !important;
  }
  .report-body .critical-figure {
    color: black;
    font-weight: bold;
  }
  .report-body p {
    color: black;
    margin-bottom: 10px;
  }
  .report-body ul, .report-body ol {
    margin-bottom: 10px;
    padding-left: 20px;
    list-style-type: disc !important;  /* Force bullets for all lists */
  }
  .report-body li {
    margin-bottom: 3px;
    color: black;
    line-height: 1.4;
  }
  .report-body hr.report-hr {
    background: #ccc;
    margin: 20px 0;
  }
}
