/* ---------------------------------------------------------------------------
   IPSDatedSites — stylesheet for the interactive talk page.
   Shares the design tokens of the n4o-kg-profile / wdt-* family verbatim, so
   this page and the rest of the publication read as one thing. Only the
   chart block at the bottom is new.
   --------------------------------------------------------------------------- */

:root {
  --ink: #1a1a1a;
  --muted: #5b6470;
  --rule: #d7dce2;
  --head-bg: #f4f6f8;
  --zebra: #fafbfc;
  --accent: #2a5d8f;
  --accent-dk: #1d3f63;
  --maxw: 1100px;
  --font:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  color: var(--ink);
  background: #ffffff;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
}
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

/* ---- header ------------------------------------------------------------ */
.page-head {
  margin-bottom: 1.5rem;
}
.page-head h1 {
  margin: 0 0 0.4rem;
  font-size: 1.55rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.intro {
  margin: 0.25rem 0 0;
  color: var(--muted);
  max-width: 70ch;
}
.note {
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  max-width: 75ch;
}
code {
  font-family: var(--mono);
  font-size: 0.95em;
}

/* ---- status ------------------------------------------------------------ */
.status {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  background: var(--zebra);
  font-size: 0.88rem;
  color: var(--muted);
  margin: 1rem 0;
}
.dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
}
.dot.busy {
  background: #d99000;
}
.dot.ok {
  background: #2e7d32;
}
.dot.err {
  background: #c0392b;
}

/* ---- the three thresholds ---------------------------------------------- */
.dials {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.9rem 1.5rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  margin: 1.25rem 0 0;
}
.dial label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.1rem;
}
.dial .why {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.dial input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}
.dial output {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent-dk);
}

.dial .ceiling {
  display: block;
  font-size: 0.74rem;
  color: var(--muted);
  margin-top: 0.2rem;
  min-height: 1em;
}
.tally {
  margin: 0.7rem 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-dk);
}
.tally.empty {
  color: #b03a2e;
}

/* ---- query ------------------------------------------------------------- */
.query {
  border-top: 1px solid var(--rule);
  padding-top: 1.25rem;
  margin-top: 1.75rem;
}
.query h2 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}
textarea.sparql {
  width: 100%;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.5;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 0.7rem 0.8rem;
  background: #fbfcfd;
  color: var(--ink);
  resize: vertical;
  tab-size: 2;
}
textarea.sparql:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  background: #fff;
}
.query-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.55rem 0 0;
  flex-wrap: wrap;
}
.query-bar button {
  font: inherit;
  font-size: 0.85rem;
  border-radius: 5px;
  padding: 0.32rem 0.9rem;
  cursor: pointer;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
}
.query-bar button:hover:not(:disabled) {
  background: var(--accent-dk);
  border-color: var(--accent-dk);
}
.query-bar button:disabled {
  opacity: 0.45;
  cursor: default;
}
.query-bar button.reset {
  background: #fff;
  color: var(--muted);
  border-color: var(--rule);
}
.query-bar button.reset:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: #fff;
}
.timing {
  font-size: 0.8rem;
  color: var(--muted);
}
a.rq {
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: 0.3rem 0.6rem;
}
a.rq:hover {
  color: var(--accent);
  border-color: var(--accent);
}
pre.error {
  margin: 0.7rem 0 0;
  padding: 0.7rem 0.85rem;
  border: 1px solid #e6b7b0;
  border-left: 3px solid #c0392b;
  border-radius: 6px;
  background: #fdf6f5;
  color: #8c2f22;
  font-family: var(--mono);
  font-size: 12px;
  white-space: pre-wrap;
}

/* ---- the chart --------------------------------------------------------- */
.chart-wrap {
  margin-top: 1.1rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 0.9rem 1rem 0.6rem;
  overflow-x: auto;
}
.chart-wrap svg {
  display: block;
  max-width: 100%;
  height: auto;
}
.chart-wrap .empty {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0.4rem 0;
}
.legend {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.5rem;
}
.legend .ramp {
  width: 120px;
  height: 9px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: linear-gradient(
    to right,
    #a50026,
    #f46d43,
    #fee08b,
    #a6d96a,
    #1a9850
  );
}
.legend .rep {
  width: 26px;
  height: 9px;
  background: #4a6b96;
  opacity: 0.85;
  border-radius: 2px;
}

/* ---- table ------------------------------------------------------------- */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: 6px;
  margin-top: 0.9rem;
}
table.layer-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  margin: 0;
}
table.layer-table th,
table.layer-table td {
  text-align: left;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
table.layer-table thead th {
  background: var(--head-bg);
  font-weight: 600;
}
table.layer-table tbody tr:nth-child(even) {
  background: var(--zebra);
}
td.num {
  font-family: var(--mono);
  text-align: right;
}

/* ---- footer ------------------------------------------------------------ */
.page-foot {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.82rem;
}
.page-foot a {
  color: var(--accent);
  text-decoration: none;
}
.page-foot a:hover {
  text-decoration: underline;
}
