/* modhistory.1102tools.com. Light federal-report aesthetic (shared with contracttype). */

:root {
  --bg: #ffffff;
  --surface: #f7f8fa;
  --surface-2: #f1f3f7;
  --border: #e1e4ea;
  --rule: #c9d2e0;
  --ink: #0b1f33;
  --ink-soft: #4a5568;
  --muted: #8892a4;
  --navy: #1a3a6c;
  --navy-deep: #102545;
  --navy-soft: #e8eef7;
  --navy-mid: #5b7aaa;
  --warn: #b54708;
  --good: #176b3b;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --serif: "Source Serif 4", "Source Serif Pro", "Charter", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; min-width: 0; }
html, body { overflow-x: hidden; max-width: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.neg { color: #9a3030; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 32px 80px; }
a { color: var(--navy); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--navy-deep); }

/* --- Masthead --- */
header.masthead {
  border-bottom: 2px solid var(--ink);
  padding: 36px 0 22px;
}
header.masthead h1 {
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.1;
  color: var(--ink);
}
header.masthead h1 .accent { color: var(--navy); }
header.masthead .tag {
  margin-top: 10px;
  font-size: 15px;
  color: var(--ink-soft);
  max-width: 760px;
}
header.masthead .src {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--muted);
  font-family: var(--mono);
}

/* --- Search --- */
.search { margin: 28px 0 10px; }
.ctl-label {
  display: block;
  font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px;
  font-weight: 600; color: var(--muted); margin-bottom: 8px;
}
.search-row { display: flex; gap: 0; max-width: 620px; }
.search-row input[type=search] {
  flex: 1; font: inherit; font-size: 16px;
  font-family: var(--mono); letter-spacing: 0.4px;
  padding: 12px 14px; border: 1px solid var(--rule); border-right: none;
  background: var(--bg); color: var(--ink); border-radius: 0;
}
.search-row input[type=search]:focus {
  outline: none; border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy);
}
.search-row button {
  font: inherit; font-size: 14px; font-weight: 600; letter-spacing: 0.3px;
  padding: 12px 24px; border: 1px solid var(--navy); background: var(--navy);
  color: #fff; cursor: pointer; border-radius: 0;
}
.search-row button:hover { background: var(--navy-deep); border-color: var(--navy-deep); }
.search .hint { margin-top: 8px; font-size: 12.5px; color: var(--muted); }

/* --- Status / loading / errors --- */
.status {
  margin: 18px 0; padding: 12px 16px; font-size: 14px;
  border: 1px solid var(--border); background: var(--surface);
}
.status.loading { color: var(--navy); border-left: 3px solid var(--navy); }
.status.error { color: #8a2020; background: #fdf3f2; border-color: #f0cccc; border-left: 3px solid #b54040; }
.status.info { border-left: 3px solid var(--navy); }

/* Disambiguation picker */
.picker { display: grid; gap: 8px; margin-top: 12px; }
.pick {
  display: flex; flex-direction: column; gap: 3px; text-align: left;
  padding: 10px 14px; background: var(--bg); border: 1px solid var(--rule);
  cursor: pointer; font: inherit;
}
.pick:hover { background: var(--navy-soft); border-color: var(--navy-mid); }
.pick-piid { font-size: 13.5px; font-weight: 600; color: var(--navy); }
.pick-meta { font-size: 12.5px; color: var(--ink-soft); }

/* --- Section headers (shared with contracttype) --- */
section { margin-top: 14px; }
h2.sec {
  font-family: var(--serif);
  font-size: 22px; font-weight: 700; letter-spacing: -0.2px;
  color: var(--ink);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
  margin: 36px 0 18px;
}
h2.sec .num {
  color: var(--navy); font-family: var(--mono); font-size: 12px;
  font-weight: 600; margin-right: 10px; letter-spacing: 0.6px;
  vertical-align: 2px;
}
h2.sec .ext {
  float: right; font-size: 12.5px; font-weight: 600; font-family: var(--sans);
  text-decoration: none; border-bottom: 1px solid var(--navy); padding-bottom: 1px;
}
h2.sec .ext:hover { color: var(--navy-deep); border-bottom-color: var(--navy-deep); }
#csvBtn { font-weight: 600; }
.sec-desc { font-size: 13.5px; color: var(--ink-soft); margin-bottom: 18px; max-width: 760px; }

/* --- Key/value award panel --- */
.kv {
  border: 1px solid var(--border);
  display: grid; grid-template-columns: 1fr;
}
.kv-row {
  display: grid; grid-template-columns: 210px 1fr;
  border-bottom: 1px solid var(--border);
}
.kv-row:last-child { border-bottom: none; }
.kv-k {
  background: var(--surface-2); padding: 10px 14px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.7px;
  font-weight: 700; color: var(--muted);
  border-right: 1px solid var(--border);
  display: flex; align-items: center;
}
.kv-v { padding: 10px 14px; font-size: 14px; color: var(--ink); }
.kv-v .neg { font-family: var(--mono); }

.desc {
  margin-top: 14px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--navy);
}
.desc-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
  font-weight: 700; color: var(--muted); margin-bottom: 6px;
}
.desc p { font-size: 14px; color: var(--ink); white-space: pre-wrap; }

/* --- Mods table (shares contracttype .data styling) --- */
.tablewrap { overflow-x: auto; border: 1px solid var(--border); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td {
  padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border);
  vertical-align: top; line-height: 1.35;
}
table.data th {
  background: var(--surface-2); font-weight: 700; color: var(--ink);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.7px;
  position: sticky; top: 0; white-space: nowrap;
}
table.data th.num, table.data td.num { text-align: right; }
table.data td.num {
  font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap;
}
table.data td.mono { font-family: var(--mono); white-space: nowrap; }
table.data td.desc-cell { min-width: 280px; }
table.data tr.focal td { background: var(--navy-soft); }
table.data tr:hover td { background: var(--surface); }
table.data tr.focal:hover td { background: var(--navy-soft); }
.tag-base {
  display: inline-block; font-family: var(--sans); font-size: 9.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px; color: #fff; background: var(--navy);
  padding: 1px 5px; vertical-align: 1px; margin-left: 4px;
}

/* Column widths for the mods table */
table.data th:nth-child(1), table.data td:nth-child(1) { width: 70px; }
table.data th:nth-child(2), table.data td:nth-child(2) { width: 100px; }
table.data th:nth-child(3), table.data td:nth-child(3) { width: 22%; }
table.data th:nth-child(4), table.data td:nth-child(4) { width: 120px; }

/* --- Methodology footer (shared) --- */
footer.method {
  margin-top: 48px; padding-top: 22px;
  border-top: 2px solid var(--ink);
  font-size: 13px; color: var(--ink-soft);
  display: grid; gap: 18px 24px;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  align-items: start;
}
footer.method h3 { font-family: var(--serif); font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
footer.method ul { padding-left: 18px; }
footer.method li { margin: 3px 0; }

/* --- Mobile --- */
@media (max-width: 760px) {
  .wrap { padding: 0 16px 60px; }
  header.masthead { padding: 22px 0 16px; }
  header.masthead h1 { font-size: 28px; }
  .search-row { flex-direction: column; }
  .search-row input[type=search] { border-right: 1px solid var(--rule); }
  .search-row button { padding: 12px; }
  .kv-row { grid-template-columns: 130px 1fr; }
  h2.sec { font-size: 19px; }
}
