/* Mango Live Check - the look both windows share.

   Black, white, thin borders. One accent, blue, for what is good or picked
   out; one alarm, red, for what is wrong. Everything else is white or grey.
   The type is Inter for words and JetBrains Mono for small labels. */

:root {
  --bg:      #000000;
  --panel:   #0A0A0A;
  --raised:  #141414;
  --line:    #262626;
  --line-hi: #3A3A3A;
  --text:    #FFFFFF;
  --muted:   #A1A1A1;
  --faint:   #5E5E5E;
  --accent:  #3D7BFF;
  --fail:    #FF5A5F;

  --sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; background: var(--bg); }

body {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss01';
}

[hidden] { display: none !important; }

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

.label {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.wordmark {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.wordmark span { color: var(--muted); font-weight: 500; }

/* ================================================================ control */

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
}

.top .spacer { flex: 1 1 auto; }

.pill {
  margin: 0;
  min-width: 0;
  max-width: 50vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.pill[data-state="running"] { color: var(--text); border-color: var(--accent); }

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
  gap: 24px;
  padding: 24px;
  max-width: 1440px;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding: 16px; gap: 16px; }
  .top { padding: 12px 16px; }
}

.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.row { display: flex; gap: 8px; align-items: stretch; }
.row > .field { flex: 1 1 auto; min-width: 0; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.field > span:not(.sr) { font-size: 12px; color: var(--muted); }

.field input,
.select {
  width: 100%;
  min-width: 0;
  font: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.12s;
}

#in-url { font-size: 16px; padding: 12px 14px; }

.field input:hover, .select:hover { border-color: var(--line-hi); }

.field input:focus, .select:focus {
  outline: none;
  border-color: var(--text);
}

.field input::placeholder { color: var(--faint); }

/* A value the tool found rather than one the presenter typed. */
.field input.is-guess { color: #D4D4D4; }

/* A guess the tool is unsure of, marked so it gets a glance before it is
   spoken. Only low confidence: marking everything marks nothing. */
.field input[data-confidence="low"] { border-color: var(--fail); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.12s, border-color 0.12s;
}

.btn:hover:not(:disabled) { border-color: var(--line-hi); background: var(--raised); }
.btn:disabled { opacity: 0.35; cursor: default; }

.btn-primary { background: var(--text); color: #000; border-color: var(--text); }
.btn-primary:hover:not(:disabled) { background: #E6E6E6; border-color: #E6E6E6; }

.btn-block { width: 100%; }
.btn-small { padding: 6px 10px; font-size: 12px; }

kbd {
  font-family: var(--mono);
  font-size: 11px;
  padding: 1px 5px;
  border: 1px solid currentColor;
  border-radius: 4px;
  opacity: 0.6;
}

.note { margin: 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.note-strong { color: var(--text); }

/* status */
.status {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}

.status > div { min-width: 0; }
.status dt { font-size: 12px; color: var(--muted); }
.status dd {
  margin: 1px 0 0;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.status dd[data-on="true"] { color: var(--text); }
.status dd[data-on="false"] { color: var(--faint); }
.status dd[data-on="bad"] { color: var(--fail); }

/* the presenter's view of the run */
.now-empty { margin: 0; color: var(--faint); font-size: 14px; }

.now-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.now-name { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.now-meta { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.now-score { margin: 0; font-size: 36px; font-weight: 700; line-height: 1; white-space: nowrap; color: var(--accent); }
.now-score span { font-size: 16px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.now-headline { margin: 0; font-size: 15px; }
.now-ai { margin: 0; font-size: 13px; color: var(--muted); }
.now-ai[data-named="false"] { color: var(--fail); }
.now-ai[data-named="true"] { color: var(--accent); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.steps li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.steps li:last-child { border-bottom: 0; }
.steps .step-state { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.steps li[data-state="running"] .step-state { color: var(--text); }
.steps li[data-state="done"] .step-state { color: var(--accent); }
.steps li[data-state="skipped"] .step-state,
.steps li[data-state="failed"] .step-state { color: var(--muted); }

/* lead log */
.leads-scroll { overflow-x: auto; margin: 0 -18px -18px; border-top: 1px solid var(--line); }

.leads-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.leads-table th, .leads-table td {
  text-align: left; padding: 10px 18px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.leads-table tr:last-child td { border-bottom: 0; }
.leads-table th { font-weight: 500; color: var(--muted); font-size: 12px; }
.leads-table td:nth-child(2) { white-space: normal; min-width: 160px; font-weight: 600; }
.leads-table input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

.report-link { color: var(--text); font-weight: 600; text-decoration: none; margin-right: 12px; }
.report-link:hover { text-decoration: underline; }

#card-canvas { display: none; }
