/* Internet dial. The site's own stylesheet is inlined in every page's <head>, so the
   tokens (--ink, --oxide, --rule, --concrete) are already defined here; this file only
   adds what the test page and the map need. Serif for reading, sans for instruments,
   same as the rest of the site. */

.dial-nav {
  margin: 1.2rem 0 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.no-ads {
  margin: 1.6rem 0 0;
  padding: .7rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  color: var(--ink-soft);
  font-family: Arial, Helvetica, sans-serif;
  font-size: .72rem;
  letter-spacing: .04em;
  max-width: 720px;
}

.dial { margin: 2.6rem 0 0; }

.dial-button {
  padding: .95rem 2.1rem;
  background: var(--oxide);
  border: 0;
  color: #f7f5f1;
  font-family: Arial, Helvetica, sans-serif;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
}
.dial-button[disabled] { opacity: .55; cursor: progress; }

.dial-number {
  margin: 1.4rem 0 .2rem;
  font-size: clamp(3.4rem, 12vw, 6.5rem);
  line-height: 1;
  letter-spacing: -.05em;
}
.dial-unit {
  margin-left: .5rem;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.dial-phase {
  margin: 0;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: .72rem;
  letter-spacing: .08em;
}

.result { margin: 2rem 0 0; padding-top: 1rem; border-top: 2px solid var(--ink); }
.result-sentence { max-width: 720px; font-size: 1.15rem; line-height: 1.6; }
.result [data-slot] { color: var(--oxide); }

.test-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1.1rem 1.6rem;
  margin: 2.6rem 0 0;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
}
.test-form .form-note,
.test-form .check { grid-column: 1 / -1; }
.form-note { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.5; }

.field { display: grid; gap: .35rem; font-family: Arial, Helvetica, sans-serif; }
.field > span {
  color: var(--muted);
  font-size: .6rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.field input,
.field select {
  padding: .55rem .6rem;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink);
  font-family: inherit;
  font-size: .95rem;
}
.check { display: flex; gap: .7rem; align-items: flex-start; max-width: 720px; }
.check span { color: var(--ink-soft); font-size: .92rem; line-height: 1.5; }

.map-controls { margin: 2.2rem 0 1rem; max-width: 20rem; }
.map {
  position: relative;
  width: 100%;
  height: clamp(20rem, 60vh, 34rem);
  background: var(--concrete-deep);
  border: 1px solid var(--rule);
  overflow: hidden;
}
.map svg { display: block; width: 100%; height: 100%; }

.isp-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 0;
  margin: 1.6rem 0 0;
  border-top: 1px solid var(--ink);
}
.isp-card {
  padding: 1rem 1.2rem 1.3rem 0;
  border-bottom: 1px solid var(--rule);
}
.isp-card + .isp-card { padding-left: 1.2rem; border-left: 1px solid var(--rule); }
.isp-card h3 { margin: 0 0 .7rem; font-size: 1.1rem; font-weight: 400; }
.isp-card p { margin: 0 0 .55rem; font-size: .95rem; line-height: 1.4; }
.isp-card .label {
  display: block;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: .58rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

/* "Se cayó mi internet": the same form furniture as the test, one step quieter so the
   measurement stays the page's main verb. */
.outage { margin: 2.8rem 0 0; padding-top: 1.4rem; border-top: 2px solid var(--ink); }
.outage h2 { margin: 0 0 .4rem; }
.outage .test-form { margin-top: 1.2rem; align-items: end; }
.dial-button-quiet {
  padding: .7rem 1.4rem;
  background: transparent;
  border: 1px solid var(--oxide);
  color: var(--oxide);
  font-size: .7rem;
}
.dial-button-quiet[disabled] { opacity: .55; }
#outage-status { margin: .9rem 0 0; min-height: 1.2em; }
#outage-restored { margin: .6rem 0 0; }

/* The 24-hour outage strip: one row per ISP per municipio, 96 quarter-hour boxes. */
.outage-strip { margin: 1.2rem 0 0; }
.strip-row {
  display: grid;
  grid-template-columns: minmax(8rem, 14rem) 1fr;
  gap: .3rem .9rem;
  align-items: center;
  padding: .6rem 0;
  border-bottom: 1px solid var(--rule);
}
.strip-name {
  font-family: Arial, Helvetica, sans-serif;
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.strip-cells { display: flex; gap: 1px; height: 1.5rem; }
.strip-cell { display: block; flex: 1 1 0; min-width: 2px; height: 100%; }
.strip-count,
.strip-axis,
.strip-legend {
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: .64rem;
  letter-spacing: .06em;
}
.strip-count { grid-column: 2; }
.strip-axis { margin: .7rem 0 0; }
.strip-legend { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; margin: .5rem 0 0; }
.strip-key { display: inline-flex; gap: .4rem; align-items: center; }
.strip-key .strip-cell { width: .9rem; height: .9rem; flex: 0 0 .9rem; }

@media (max-width: 720px) {
  .strip-row { grid-template-columns: 1fr; }
  .strip-count { grid-column: 1; }
  .isp-card + .isp-card { padding-left: 0; border-left: 0; }
  .test-form { grid-template-columns: 1fr; }
}

/* Respect hidden even on grid forms, and keep the measurement controls compact. */
[hidden] { display: none !important; }
.test-intro { max-width: 42rem; font-size: 1rem; line-height: 1.5; }
.dial { margin-top: 1.2rem; }
.dial-button + .dial-button { margin-left: .5rem; }
.result-summary { font-family: Arial, Helvetica, sans-serif; line-height: 1.8; }

/* Result first, then exploration and optional participation. */
.test-page h1 { font-size: clamp(2rem, 4vw, 3.2rem); max-width: 22ch; }
.test-page .dial-number { font-size: clamp(5rem, 15vw, 9rem); }
.test-page .dial { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.test-page .dial > .eyebrow, .test-page .dial-number, .test-page .dial-phase { width: 100%; }
.test-page .dial > .eyebrow { order: 0; margin-bottom: 0; }
.test-page .dial-number { order: 1; margin: .2rem 0; }
.test-page .dial-phase { order: 2; }
.test-page .dial-button { order: 3; margin-top: .6rem; }
.nearby, .invite { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.nearby-search { display: flex; flex-wrap: wrap; gap: 1rem; align-items: end; }
.nearby-search input { max-width: 12rem; }
.compare-row { margin: 1rem 0; font-family: Arial, sans-serif; font-size: .9rem; }
.compare-track { height: .7rem; background: var(--rule); margin-top: .4rem; }
.compare-fill { height: 100%; background: var(--oxide); }
.compare-row.personal .compare-fill { background: var(--ink); }
.map-link { display: inline-block; margin-top: 1rem; }
#share-copy { width: 100%; padding: .8rem; }

/* Landing: connection instrument beside geographic exploration. */
.test-page { max-width: 1440px; }
.test-page .section-index { display: none; }
.test-page { display: block; }
.test-page article { display: grid; grid-template-columns: minmax(240px, .7fr) minmax(0, 1.3fr); gap: 0 2.5rem; }
.test-page article > * { grid-column: 1 / -1; }
.test-page article > .connection-card { grid-column: 1; grid-row: 5; align-self: start; position: sticky; top: 1rem; }
.test-page article > .nearby { grid-column: 2; grid-row: 5; margin-top: 1rem; padding-top: 0; border-top: 0; min-width: 0; }
.test-page .test-intro { max-width: 60rem; }
.test-page h1 { max-width: 30ch; }
.landing-map { height: 410px; min-height: 300px; border-radius: 3px; }
.location-tools { display: flex; flex-wrap: wrap; gap: .5rem; }
.location-tools .dial-button { padding: .8rem 1rem; font-size: .68rem; }
.map-loading { padding: 2rem; max-width: 28rem; color: #242421; }
.map-legend { font: .72rem/1.5 Arial, sans-serif; padding-top: .8rem; border-top: .5rem solid transparent; border-image: linear-gradient(to right,#f2e6de,#e0b79e,#cf8a68,#a74426,#6d2a17) 1; }
.area-reading { font: .95rem/1.6 Arial, sans-serif; border-left: 3px solid var(--oxide); padding-left: 1rem; }
.cp-fallback { margin: 1.2rem 0; }
.cp-fallback summary { cursor: pointer; text-decoration: underline; }
.cp-fallback form { margin-top: 1rem; }
@media(max-width: 900px) {
 .test-page article { display: block; }
 .test-page article > .connection-card { position: static; }
 .test-page article > .nearby { margin-top: 2rem; }
 .landing-map { height: 360px; }
}
.test-page { padding-top: 2rem; max-width: 1280px; margin-inline: auto; }
.test-page article > .nearby h2 { margin-top: 0; }
.test-page .map-controls { margin-top: 1rem; }
.test-page .nearby > p { margin-block: .7rem; }
.test-page .dial-number { white-space: nowrap; }
@media(min-width: 901px) {
 .test-page article > .connection-card { padding: 1.2rem; border: 1px solid var(--rule); margin-top: 1rem; }
 .test-page .connection-card .dial { margin-top: 0; }
 .test-page .connection-card .dial-number { font-size: clamp(4rem, 7vw, 7rem); }
}

/* Keep the geographic canvas aligned with the instrument; explanation follows. */
.test-page article > .nearby .landing-map { margin: 0 0 1.5rem; }
.basemap-place { color: #27302b; font: 600 12px/1.2 Arial, sans-serif; white-space: nowrap; pointer-events: none; text-shadow: -1px -1px 2px #fff, 1px 1px 2px #fff, 0 0 4px #fff; }

.map-heading { display: flex; align-items: baseline; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.test-page .map-heading h2 { font-size: 1.2rem; margin: 0; }
.map-heading > span { font: .7rem Arial,sans-serif; color: var(--muted); }
.speed-legend { display: flex; margin: .7rem 0 .9rem; gap: 3px; font: .7rem Arial,sans-serif; }
.speed-legend span { flex: 1; border-top: 6px solid var(--swatch); padding-top: .35rem; text-align: center; }
.user-location-dot { width: 17px; height: 17px; border-radius: 50%; background: #2477ef; border: 3px solid white; box-shadow: 0 0 0 8px #2477ef30, 0 1px 5px #0006; }
.speed-popup { color: #202b32; font: 12px/1.5 Arial,sans-serif; }
.speed-popup strong { display: block; font-size: 23px; }
.speed-popup span { display: block; max-width: 220px; }
#locate-area { background: #286dc0; }
.test-page .result [data-slot] { color: #6ec8bd; }

.map-loading { color: #ecece7; font: 1rem/1.5 Arial,sans-serif; }
.test-page .dial-number[hidden] + .dial-phase { font-size: 1rem; line-height: 1.5; padding: 1.2rem 0; color: var(--ink); }
/* Phone ergonomics: readable fields, generous targets, no sideways scrolling. */
@media (max-width: 600px) {
 .test-page { padding-top: 1.2rem; }
 .test-page h1 { font-size: clamp(1.8rem, 7.5vw, 2.5rem); }
 .test-page .dial-number { font-size: clamp(3rem, 16vw, 6rem); }
 .test-page .dial-unit { font-size: .75rem; letter-spacing: .05em; }
 .test-page .dial-button { min-height: 44px; padding: .85rem 1rem; }
 .test-page .dial-button + .dial-button { margin-left: 0; }
 .location-tools { display: grid; grid-template-columns: 1fr; }
 .location-tools .dial-button { width: 100%; }
 .field, .test-form, .nearby-search { min-width: 0; }
 .test-page input, .test-page select { box-sizing: border-box; min-height: 44px; font-size: 16px; max-width: 100%; width: 100%; }
 .test-page .check input { width: 24px; min-height: 24px; flex-shrink: 0; }
 .test-page .nearby-search { display: grid; grid-template-columns: 1fr; }
 .test-page .nearby-search input { max-width: 100%; }
 .landing-map { height: clamp(280px, 48svh, 390px); min-height: 280px; }
 .map-heading { gap: .35rem; }
 .speed-legend { font-size: .65rem; }
 .maplibregl-ctrl-group button { width: 44px; height: 44px; }
 .maplibregl-popup { max-width: min(240px, 75vw) !important; }
 .cp-fallback summary { padding-block: .8rem; }
 .result-summary { overflow-wrap: anywhere; }
 .test-page .receipt { overflow-wrap: anywhere; }
}

/* Bound the sticky card to the map row, above an opaque theme surface. */
.test-page article > .connection-column { grid-column: 1; grid-row: 5; min-width: 0; margin-top: 1rem; }
.connection-column > .connection-card { background: var(--concrete); position: sticky; top: 1rem; z-index: 2; padding: 1.2rem; border: 1px solid var(--rule); box-shadow: 0 4px 16px #0002; }
@media(max-width: 900px) {
 .connection-column > .connection-card { position: static; padding: 0; border: 0; box-shadow: none; }
}

/* Enrichment stays in normal flow so expanded results never obscure the map. */
.connection-column > .connection-card { position: static; }
.connection-quality { margin-top: 1rem; }
.activity-grid { display: grid; gap: .7rem; }
.activity-card, .context-card { padding: 1rem; border: 1px solid var(--rule); background: var(--concrete); min-width: 0; }
.activity-card h4 { margin: 0 0 .5rem; }
.activity-card p, .context-card p { font: .9rem/1.55 Arial,sans-serif; }
.activity-card strong { color: var(--oxide); font: 600 .85rem/1.5 Arial,sans-serif; }
.activity-card a, .context-card a { font: .8rem/1.5 Arial,sans-serif; }
.test-page article > .internet-context { grid-column: 1 / -1; display:grid; grid-template-columns:1fr 1fr; gap:1rem; margin-top:2rem; }
.history-table { width:100%; border-collapse:collapse; font:.85rem/1.5 Arial,sans-serif; }
.history-table caption { text-align:left; padding-bottom:.7rem; }
.history-table th, .history-table td { text-align:right; padding:.45rem .25rem; border-bottom:1px solid var(--rule); }
.history-table th:first-child, .history-table td:first-child { text-align:left; }
@media(max-width:700px) { .test-page article > .internet-context { grid-template-columns:1fr; } }

.activity-details summary { cursor:pointer; min-height:44px; display:flex; align-items:center; font:600 .9rem/1.4 Arial,sans-serif; color:var(--oxide); }

@media(max-width:600px) { .speed-popup { width:150px; } .speed-popup span { max-width:150px; overflow-wrap:anywhere; white-space:normal; } }
