/* Connectivity map: the legend swatches. The shell, controls and map frame
 * come from live_map.css. Squares, not dots, so the swatches are squares.
 *
 * These literals are the same five colours connectivity.js paints with; a
 * MapLibre paint expression cannot read a custom property, so the two lists
 * agree by hand. Teal to red rather than green to red: the ramp has to read
 * for colour-blind viewers, and lightness falls steadily down it as well.
 */
.viz-root {
  --conn-good: #2a9d8f;
  --conn-fair: #e9c46a;
  --conn-weak: #f4a261;
  --conn-poor: #e76f51;
  --conn-bad: #9b2226;
}

.map-legend .sq i {
  border-radius: 2px;
  width: 12px;
  height: 12px;
}
.map-legend .good i { background: var(--conn-good); }
.map-legend .fair i { background: var(--conn-fair); }
.map-legend .weak i { background: var(--conn-weak); }
.map-legend .poor i { background: var(--conn-poor); }
.map-legend .bad i { background: var(--conn-bad); }

.conn-card { font-size: 12.5px; line-height: 1.45; color: #1f1f1d; }
.conn-card strong { font-size: 13.5px; }
.conn-card .muted { color: #6b6a65; }
.maplibregl-popup-content { padding: 9px 11px; }

/* Author display rules beat the hidden attribute; say so explicitly. */
.ctl[hidden], .map-toggle-label[hidden], .conn-ramp[hidden], .tieup[hidden] { display: none; }

/* Postcode search. min-width:0 on the flex children so a phone does not get a
 * sideways-scrolling page out of the input's intrinsic width. */
.lookup { display: flex; gap: 10px; align-items: flex-end; margin: 10px 0 6px; }
.lookup-field { flex: 1 1 auto; min-width: 0; }
.lookup-field input { width: 100%; min-width: 0; box-sizing: border-box; font: inherit; padding: 7px 9px; }
.lookup button { flex: 0 0 auto; font: inherit; padding: 8px 14px; cursor: pointer; }
.lookup-error { color: #9b2226; margin: 4px 0; font-size: 13.5px; }
.lookup-error[hidden], .lookup-result[hidden] { display: none; }

.lookup-result { margin: 8px 0 12px; padding: 12px 14px; border: 1px solid #d9d6cc; border-radius: 8px; background: #fff; }
.lookup-result h2 { margin: 0 0 2px; font-size: 16px; }
.lookup-result .muted { color: #6b6a65; font-size: 12.5px; }
.lookup-nets { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 10px 0; }
.lookup-net { border: 1px solid #e6e3da; border-radius: 6px; padding: 8px 10px; min-width: 0; }
.lookup-net b { display: block; font-size: 13px; }
.lookup-net span { display: block; font-size: 12.5px; line-height: 1.4; }
/* Colour and words together: the chip never carries the meaning on its own. */
.conn-chip { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 12px; font-weight: 600; margin: 3px 0; }
.conn-chip.good { background: #d8efec; color: #14574f; }
.conn-chip.fair { background: #f6ebc4; color: #6b5410; }
.conn-chip.poor { background: #fbdcd1; color: #8a3318; }
.conn-chip.bad  { background: #efc9ca; color: #6e1519; }
.lookup-silence { margin: 6px 0 0; font-size: 13.5px; }
.lookup-net .conn-chip { display: inline-block; }

/* Legend for the smooth surface: a gradient bar with the same five colours. */
.conn-ramp { display: block; min-width: 220px; }
.conn-ramp .bar { height: 10px; border-radius: 5px; margin: 4px 0 2px;
  background: linear-gradient(to right, var(--conn-good) 0%, var(--conn-fair) 10%, var(--conn-weak) 25%, var(--conn-poor) 50%, var(--conn-bad) 100%); }
.conn-ramp .ticks { display: flex; justify-content: space-between; font-size: 11.5px; color: #6b6a65; }

/* Ring marker for "Ofcom predicts weak": indigo, outside the teal-to-red ramp. */
.map-legend .ring i { width: 12px; height: 12px; box-sizing: border-box; border-radius: 50%;
  border: 2px solid #2b3a8c; background: rgba(43, 58, 140, 0.15); }

.tieup { margin: 18px 0 8px; }
.tieup h2 { font-size: 16px; margin: 0 0 4px; }
.tieup-sum { margin: 4px 0 10px; font-size: 14px; line-height: 1.5; }
.tieup-wrap { overflow-x: auto; max-width: 100%; }
.tieup-table { border-collapse: collapse; font-size: 13px; width: 100%; min-width: 520px; }
.tieup-table th, .tieup-table td { padding: 6px 10px; border-bottom: 1px solid #e6e3da; text-align: right; }
.tieup-table th:first-child, .tieup-table td:first-child { text-align: left; }
.tieup-table th { font-weight: 600; color: #4a4943; vertical-align: bottom; }
.tieup-table .bar { display: inline-block; height: 8px; border-radius: 4px; background: #2b3a8c; vertical-align: middle; margin-left: 6px; }
