:root {
  --ink: #1a1d29;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f7f8fa;
  --card: #ffffff;
  --accent: #2f5d50;
  --ok: #1a7f4b;
  --ok-bg: #e7f6ee;
  --warn: #92400e;
  --warn-bg: #fef3e0;
  --danger: #991b1b;
  --danger-bg: #fdecec;
}
* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  margin: 0;
  padding: 0;
}
header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 18px 32px;
}
header h1 { font-size: 18px; margin: 0; font-weight: 600; }
header .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
main { max-width: 1100px; margin: 0 auto; padding: 28px 32px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 20px;
}

.upload-drop {
  border: 2px dashed #c7cdd6;
  border-radius: 10px;
  padding: 40px;
  text-align: center;
  background: #fafbfc;
}
.upload-drop input[type=file] { margin: 14px 0; }
button, .btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 500;
}
button:hover { opacity: 0.9; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.badge-real { background: var(--ok-bg); color: var(--ok); }
.badge-notavail { background: var(--danger-bg); color: var(--danger); }
.badge-notfound { background: var(--warn-bg); color: var(--warn); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab {
  padding: 10px 18px;
  cursor: pointer;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  font-size: 14px;
  font-weight: 500;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.job-list-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); }
.job-list-row a { color: var(--accent); text-decoration: none; font-weight: 500; }
.job-list-row a:hover { text-decoration: underline; }

.note { color: var(--muted); font-size: 13.5px; font-style: italic; margin: 8px 0 16px; }
.section-title { font-size: 15px; font-weight: 600; margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }

.feedback-box { position: fixed; bottom: 20px; right: 20px; }
.feedback-box textarea { width: 260px; height: 60px; font-size: 13px; padding: 8px; border-radius: 6px; border: 1px solid var(--border); display: block; margin-bottom: 6px; }
.feedback-toggle { background: var(--ink); }

/* ── Two-column job layout: report on the left, plain-language explainer on the right ── */
main.job-page { max-width: 1600px; }
.job-layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 28px; align-items: stretch; position: relative; }
.job-main { min-width: 0; }
.annot-col { position: relative; }

/* Red leader lines connecting each note to the exact section it explains. */
.annot-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; overflow: visible; }
.annot-group { display: none; }
.annot-group.active { display: block; }
.annot {
  position: absolute; right: 0; width: 384px; z-index: 2;
  background: var(--card); border: 1px solid var(--border);
  border-left: 3px solid #d64545; border-radius: 8px;
  padding: 12px 15px; box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.annot-title { font-size: 13px; font-weight: 700; color: var(--ink); margin: 0 0 8px; }
.annot dl { margin: 0; }
.annot dt { font-size: 10px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: #d64545; margin-top: 8px; }
.annot dd { margin: 1px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--ink); }
.annot .draft-email { margin-top: 6px; max-height: 260px; }

/* On a narrow window the notes drop inline under the report and the lines hide. */
@media (max-width: 1180px) {
  .job-layout { grid-template-columns: 1fr; }
  .annot-lines { display: none; }
  .annot { position: static !important; width: auto !important; margin-bottom: 12px; }
}

.rail-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
}
.rail-card h3 { font-size: 14px; font-weight: 700; margin: 0 0 10px; color: var(--ink); }
.rail-card p { font-size: 13px; line-height: 1.55; color: var(--ink); margin: 0 0 10px; }
.rail-card p:last-child { margin-bottom: 0; }
.rail-card .lead { font-weight: 600; color: var(--accent); }
.rail-card .muted { color: var(--muted); }
.rail-block { display: none; }
.rail-block.active { display: block; }

/* Little labelled definition rows for a glossary ("this code means…") */
.gloss { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 10px; }
.gloss dt { font-weight: 700; font-size: 12.5px; color: var(--ink); margin-top: 8px; }
.gloss dd { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }

/* Steps: what it means / how to check / how to fix */
.rail-steps { list-style: none; padding: 0; margin: 4px 0 0; counter-reset: step; }
.rail-steps li { position: relative; padding: 0 0 10px 26px; font-size: 13px; line-height: 1.5; color: var(--ink); }
.rail-steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* Copyable draft email */
.draft-email {
  background: #fbfcfb; border: 1px solid var(--border); border-radius: 8px;
  padding: 14px; font-size: 12.5px; line-height: 1.55; color: var(--ink);
  white-space: pre-wrap; word-wrap: break-word; margin-top: 8px;
  max-height: 340px; overflow-y: auto;
}
.copy-btn { font-size: 12px; padding: 7px 14px; margin-top: 10px; }
.copy-btn.copied { background: var(--ok); }

/* Inline explained term — dotted underline + hover tooltip */
.term { border-bottom: 1px dotted var(--muted); cursor: help; position: relative; }
.term:hover::after {
  content: attr(data-explain);
  position: absolute; left: 0; bottom: 140%; z-index: 20;
  width: 240px; background: var(--ink); color: #fff;
  font-size: 12px; font-weight: 400; line-height: 1.45; font-style: normal;
  padding: 8px 10px; border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
}
