/* The home page's top line and service rows with a 24-hour graph (owner 22 Nov 2026, final design; _radar_minigraph.html).
   Plain flat colours: no badges, pills, glow or gradients. The marks keep the given hex in both themes; the text colours that
   are too dark on a dark page have a lighter value in the site's own dark-mode pattern (light, dark via the toggle, dark via the system). */
:root { --mg-orange: #D85A30; --mg-ok: #1D9E75; --mg-part: #EF9F27; --mg-bad: #E24B4A; --mg-maint: #378ADD;
  --mg-t-major: #A32D2D; --mg-t-partial: #BA7517; --mg-t-maint: #185FA5; --mg-t-people: #993C1D; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --mg-t-major: #F09595; --mg-t-partial: #EF9F27; --mg-t-maint: #85B7EB; --mg-t-people: #F0997B; } }
:root[data-theme="dark"] { --mg-t-major: #F09595; --mg-t-partial: #EF9F27; --mg-t-maint: #85B7EB; --mg-t-people: #F0997B; }

/* top line: search, Search, Report a problem */
.rd-home .rd-searchline { display: flex; align-items: flex-start; gap: 10px 12px; margin: 14px 0 6px; }
.rd-home .rd-searchline .idn-search { flex: 1 1 auto; min-width: 0; max-width: none; margin: 0; }
.rd-home .rd-searchline .rd-search-field { flex: 1 1 auto; min-width: 0; }
.rd-home .rd-searchline-report { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; height: 44px; padding: 0 20px; border: 0; border-radius: var(--r, 8px); background: #D85A30; color: #fff; font-size: 16px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.rd-home .rd-searchline-report:hover { background: #C24E27; color: #fff; }
@media (max-width: 640px) {
  .rd-home .rd-searchline { flex-wrap: wrap; }
  .rd-home .rd-searchline .idn-search { flex: 1 1 100%; }
  .rd-home .rd-searchline-report { flex: 1 1 100%; }
}

/* the card */
.mg-card { min-width: 0; margin: 14px 0 18px; padding: 14px 16px 8px; border: 1px solid var(--line); border-radius: var(--r-l, 10px); background: var(--surface); }
.mg-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 8px; }
.mg-card-head h2 { margin: 0; font-size: 20px; line-height: 1.25; }
.mg-muted { color: var(--muted); font-size: 13px; white-space: nowrap; }
.mg-list { list-style: none; margin: 0; padding: 0; }
.mg-row { min-width: 0; padding: 8px 0 6px; border-top: 1px solid var(--line); }
.mg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.mg-head .rd-who { min-width: 0; }
.mg-name { font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.mg-report { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border: 1.5px solid #D85A30; border-radius: 6px; background: transparent; color: #D85A30; font-size: 13px; font-weight: 600; text-decoration: none; }
.mg-report:hover { background: transparent; text-decoration: underline; }

/* the graph */
.mg-graph { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: center; gap: 3px 8px; max-width: 500px; margin: 4px 0 0; }
.mg-lab { font-size: 12px; color: var(--muted); line-height: 1.2; }
.mg-short { display: none; }
.mg-plot { --pad: 32px; position: relative; display: block; min-width: 0; padding-right: var(--pad); }
.mg-has-peak { padding-top: 10px; }
.mg-peak { position: absolute; top: 0; left: clamp(10px, calc((100% - var(--pad)) * var(--x) / 100), calc(100% - var(--pad) - 10px)); transform: translateX(-50%); font-size: 11px; line-height: 1; color: var(--mg-t-people); pointer-events: none; }
.mg-total { position: absolute; right: 0; bottom: 3px; font-size: 12px; font-weight: 600; line-height: 1; color: var(--mg-t-people); }
.mg-line { display: block; width: 100%; height: 34px; overflow: visible; }
.mg-area { fill: #D85A30; fill-opacity: .22; stroke: none; }
.mg-stroke { fill: none; stroke: #D85A30; stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.mg-base { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.mg-hit { fill: transparent; }
.mg-cells, .mg-dots { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 2px; }
.mg-c { display: block; height: 14px; background: var(--line); border-radius: 1px; }
.mg-s-ok { background: #1D9E75; } .mg-s-minor { background: #EF9F27; } .mg-s-major { background: #E24B4A; } .mg-s-maint { background: #378ADD; } .mg-s-none { background: var(--line); }
.mg-d { display: block; width: min(7px, 100%); height: auto; aspect-ratio: 1 / 1; margin: 0; align-self: start; justify-self: center; border-radius: 50%; background: transparent; }
.mg-d-ok { background: #1D9E75; } .mg-d-part { background: #EF9F27; } .mg-d-none { background: #E24B4A; }
.mg-axis { grid-column: 2; margin-top: -1px; display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
/* empty until a slot is touched */
.mg-tip { grid-column: 1 / -1; margin: 0; min-height: 0;  font-size: 12px; line-height: 1.4; color: var(--muted); overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .mg-graph { grid-template-columns: 62px minmax(0, 1fr); max-width: none; }
  .mg-long { display: none; } .mg-short { display: inline; }
  .mg-line { height: 28px; }
  .mg-c { height: 12px; }
  .mg-d { width: min(6px, 100%); }
  .mg-card { padding: 12px 12px 6px; }
  .mg-plot { --pad: 30px; }
  .mg-card-head h2 { font-size: 19px; }
}

/* status and detail */
.mg-status { margin: 2px 0 0; font-size: 15px; font-weight: 600; line-height: 1.35; }
.mg-k-major { color: var(--mg-t-major); } .mg-k-partial { color: var(--mg-t-partial); } .mg-k-maint { color: var(--mg-t-maint); } .mg-k-people { color: var(--mg-t-people); }
.mg-detail { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); overflow-wrap: anywhere; }
.mg-more { margin: 0; padding: 4px 0 0; border-top: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.mg-more a { display: inline-flex; align-items: center; min-height: 40px; }
.mg-how { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.mg-how summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.mg-how p { margin: 4px 0; line-height: 1.5; }

/* The card version (owner 22 Nov, "everything gets new bars"): the same three rows in a service card, 180 px up to a phone's width.
   Everything is sized from the card: the label column is short words until the card is wide enough for the full ones (container
   query), a dot is as wide as its cell (never more than 7 px), the total keeps its own space beside the line's end, and each
   piece has min-width 0 and clips rather than push the card wider. */
.mgc { display: block; width: 100%; min-width: 0; max-width: 100%; margin: 8px 0 2px; container-type: inline-size; }
.rd-card-graph { grid-column: 1 / -1; justify-self: stretch; width: 100%; min-width: 0; }
.mgc-in { display: grid; grid-template-columns: 46px minmax(0, 1fr); align-items: center; gap: 3px 6px; min-width: 0; max-width: 100%; }
.mgc .mg-lab { min-width: 0; overflow: hidden; white-space: nowrap; font-size: 11px; }
.mgc .mg-long { display: none; } .mgc .mg-short { display: inline; }
.mgc .mg-plot { --pad: 26px; max-width: 100%; }
.mgc .mg-total { font-size: 11px; }
.mgc .mg-peak { font-size: 10px; }
.mgc .mg-line { height: 30px; max-width: 100%; }
.mgc .mg-cells, .mgc .mg-dots { gap: 1px; min-width: 0; max-width: 100%; }
.mgc .mg-c { height: 12px; min-width: 0; }
.mgc .mg-axis { min-width: 0; white-space: nowrap; font-size: 10px; overflow: hidden; }
.mgc .mg-tip { grid-column: 1 / -1; display: block; font-size: 11px; line-height: 1.35; min-width: 0; }
.mgc-old .mg-cells, .mgc-old .mg-dots, .mgc-old .mg-line { opacity: .5; }
@container (min-width: 250px) {
  .mgc-in { grid-template-columns: 98px minmax(0, 1fr); column-gap: 8px; }
  .mgc .mg-long { display: inline; } .mgc .mg-short { display: none; }
  .mgc .mg-cells, .mgc .mg-dots { gap: 2px; }
  .mgc .mg-plot { --pad: 30px; }
}
/* phones: the card's grid puts the graph on its own row under the name, then the status */
@media (max-width: 560px) {
  .rd-overview-card > .mgc { grid-column: 1 / -1; grid-row: 2; margin: 4px 0 2px; }
  .rd-overview-card > .rd-overview-evidence { grid-row: 3; }
}
/* owner 23 Nov ("bit small"): in narrow cards the labels sit above their row instead of in a column beside it, so the bars,
   dots and line get the whole card width and are taller. Wide cards (250 px and up) keep the label column. */
@container (max-width: 249.98px) {
  .mgc-in { grid-template-columns: minmax(0, 1fr); row-gap: 1px; }
  .mgc .mg-lab { font-size: 10px; line-height: 1.2; margin-top: 3px; }
  .mgc .mg-axis, .mgc .mg-tip { grid-column: 1 / -1; }
}
.mgc .mg-line { height: 36px; }
.mgc .mg-c { height: 16px; }
.mgc .mg-d { width: min(8px, 100%); }
/* owner 23 Nov ("the check dots must stay", "square cards more"): in the wider 4-a-row cards the graph is taller so the card is
   closer to square; the website dots stay, a little larger */
@container (min-width: 250px) {
  .mgc .mg-line { height: 52px; }
  .mgc .mg-c { height: 22px; }
  .mgc .mg-d { width: min(9px, 100%); }
  .mgc-in { row-gap: 6px; }
}
/* labels above the rows in every card, so the graph always uses the full card width */
.mgc .mgc-in { grid-template-columns: minmax(0, 1fr) !important; }
.mgc .mg-lab { font-size: 11px; line-height: 1.2; margin-top: 4px; }
.mgc .mg-axis, .mgc .mg-tip { grid-column: 1 / -1; }
/* owner 23 Nov ("more squared cards also top, can't we fit 2 in a row"): the top lists ("problems happening now", "Most
   reported by people") as cards, two a row on wider screens; the graph fills each card */
@media (min-width: 900px) {
  .mg-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-top: 4px; }
  .mg-list > .mg-row { border: 1px solid var(--line); border-radius: var(--r-l, 10px); padding: 12px 14px 10px; background: var(--surface-2, transparent); display: flex; flex-direction: column; }
  .mg-list > .mg-row .mg-graph { max-width: none; width: 100%; }
  .mg-list > .mg-row .mg-detail { margin-top: auto; }
}
/* owner 23 Nov ("cards can't be more squared"): trim the card's height so it is about as tall as it is wide */
@container (min-width: 250px) {
  .mgc .mg-line { height: 40px; }
  .mgc .mg-c { height: 16px; }
  .mgc-in { row-gap: 2px; }
}
.mgc { margin: 6px 0 0; }
.mgc .mg-lab { margin-top: 2px; font-size: 11px; }
.mgc .mg-tip:empty { display: none; }
.mgc .mg-tip { margin-top: 2px; }
@container (min-width: 250px) {
  .mgc .mg-line { height: 32px; }
  .mgc .mg-c { height: 14px; }
  .mgc .mg-d { width: min(8px, 100%); }
}
.mgc .mg-lab { font-size: 10.5px; line-height: 1.1; margin-top: 1px; }
.mgc .mg-axis { margin-top: 0; line-height: 1.1; }

/* owner 23 Nov ("too busy, not sure and misaligned"): in cards the three rows end at the same edge (the total sits in the label,
   not beside the line), slots we have not checked yet are faint grey dots so the dot row spans the full width, and the source
   line and the last-reading note stay on the service page */
.mgc .mg-total { display: none; }
.mgc .mg-plot { --pad: 0px; }
.mgc .mg-ltot { color: var(--report, #D85A30); font-weight: 600; }
.mgc .mg-d:not(.mg-d-ok):not(.mg-d-part):not(.mg-d-none) { background: var(--line); }
.rd-overview-card:has(.mgc) .rd-overview-source, .rd-overview-card:has(.mgc) .rd-overview-freshness { display: none; }
/* owner 23 Nov ("flapping size, must stay constant size"): the hover/tap line no longer pushes the card taller; it floats over
   the top of the graph instead, so a card never changes size */
.mgc { position: relative; }
.mgc .mg-tip { position: absolute; left: 0; right: 0; bottom: 100%; z-index: 3; margin: 0 0 4px; padding: 4px 6px;
  background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 6px; font-size: 11px; line-height: 1.35; pointer-events: none; }
.mgc .mg-tip:empty { display: none; }
.mg-graph { position: relative; }
.mg-graph .mg-tip { position: absolute; left: 0; right: 0; bottom: 100%; z-index: 3; margin: 0 0 4px; padding: 4px 6px;
  background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 6px; pointer-events: none; }
.mg-graph .mg-tip:empty { display: none; }
