/* /vis/fedimap: the graph page and its embedded form (ADR 0056).
 *
 * The three group colours are a categorical palette run through the dataviz
 * validator for a scatter (all pairs, not only neighbours) in both schemes.
 * Three is the most that clears every pairwise floor there, which is why the
 * servers are three plus a grey "Andre serverar", and why every colour also
 * has a label in the legend and a row in a table. Light aqua sits at 2.7:1 on
 * the white surface; the legend and the tables carry it (docs/tilgjenge.md). */

:root {
  --fm-g0: #2a78d6;
  --fm-g1: #eb6834;
  --fm-g2: #1baf7a;
  --fm-anna: #9aa0a6;
  --fm-flate: #ffffff;
  --fm-linje: rgba(28, 29, 33, 0.055);
}
@media (prefers-color-scheme: dark) {
  :root {
    --fm-g0: #3987e5;
    --fm-g1: #d95926;
    --fm-g2: #199e70;
    --fm-anna: #6b7177;
    --fm-flate: #1e242b;
    --fm-linje: rgba(238, 240, 242, 0.05);
  }
}

.fm-tal { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px 20px; margin: 18px 0 0; }
.fm-tal div { display: flex; flex-direction: column; }
.fm-tal dt { order: 2; color: var(--muted); font-size: 0.875rem; }
.fm-tal dd { order: 1; margin: 0; font-family: var(--font-disp); font-weight: 600; font-size: 1.75rem; font-variant-numeric: tabular-nums; }

.fm-graf { margin: 24px 0 0; }
.fm-styring { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; margin: 0 0 10px; }
.fm-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.fm-seg button { font: inherit; font-size: 0.875rem; padding: 6px 12px; border: 0; background: var(--panel); color: var(--muted); cursor: pointer; }
.fm-seg button + button { border-left: 1px solid var(--line); }
.fm-seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.fm-glid { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 0.875rem; color: var(--muted); }
.fm-glid input { width: 160px; }
.fm-glid output { min-width: 15em; font-variant-numeric: tabular-nums; }

.fm-boks {
  position: relative; height: min(72vh, 640px); min-height: 360px;
  background: var(--fm-flate); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.fm-boks canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.fm-boks.fm-drar canvas { cursor: grabbing; }

.fm-teikn {
  position: absolute; left: 12px; bottom: 12px; margin: 0; padding: 8px 12px; list-style: none;
  display: flex; flex-direction: column; gap: 3px; font-size: 0.8125rem;
  background: color-mix(in srgb, var(--fm-flate) 90%, transparent); border: 1px solid var(--line); border-radius: 8px;
}
.fm-teikn li { display: flex; align-items: center; gap: 8px; }
.fm-n { color: var(--muted); font-variant-numeric: tabular-nums; margin-left: auto; padding-left: 10px; }
.fm-prikk { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; margin-right: 6px; vertical-align: -1px; }
.fm-teikn .fm-prikk { margin-right: 0; }
.fm-g0, .fm-s0 { background: var(--fm-g0); }
.fm-g1, .fm-s1 { background: var(--fm-g1); }
.fm-g2, .fm-s2 { background: var(--fm-g2); }
.fm-s3 { background: var(--fm-anna); }

.fm-zoom { position: absolute; right: 12px; bottom: 12px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel); }
.fm-zoom button { width: 34px; height: 34px; border: 0; background: transparent; color: var(--ink); font-size: 1rem; cursor: pointer; }
.fm-zoom button + button { border-top: 1px solid var(--line); }

.fm-tips {
  position: absolute; pointer-events: none; max-width: 240px; padding: 7px 10px; border-radius: 8px;
  background: var(--tip-bg); color: var(--tip-fg); font-size: 0.8125rem; line-height: 1.4;
  display: flex; flex-direction: column;
}
.fm-tips[hidden] { display: none; }
.fm-tips span { color: var(--tip-sub); }

.fm-feil { margin: 16px 0 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.fm-feil[hidden] { display: none; }

.fm-rull { overflow-x: auto; }
.fm-tabell { border-collapse: collapse; width: 100%; font-size: 0.9375rem; }
.fm-tabell th, .fm-tabell td { padding: 6px 10px; border-bottom: 1px solid var(--rutenett); text-align: left; white-space: nowrap; }
.fm-tabell thead th { color: var(--muted); font-weight: 500; font-size: 0.8125rem; }
.fm-tal-k { text-align: right !important; font-variant-numeric: tabular-nums; }

.fm-innebygd-lenke { display: none; }

/* Embedded on markus.plus: the graph alone, filling the frame. */
html.fm-innebygd body { background: var(--fm-flate); }
html.fm-innebygd .fm-utanfor, html.fm-innebygd .skip-link, html.fm-innebygd .vis-merknad { display: none; }
html.fm-innebygd .vis-ramme { max-width: none; padding: 8px; }
html.fm-innebygd .fm-graf { margin: 0; }
html.fm-innebygd .fm-boks { height: calc(100vh - 92px); min-height: 280px; }
html.fm-innebygd .fm-innebygd-lenke { display: block; margin: 6px 0 0; font-size: 0.8125rem; }

@media (max-width: 560px) {
  .fm-glid input { width: 100%; }
  .fm-glid output { min-width: 0; }
  .fm-teikn { font-size: 0.75rem; padding: 6px 8px; }
}
