/* LoRa APRS Monitor 2.7.1
   One stylesheet, scoped to .laprs. Values use a monospace face because they are
   instrument readings and column alignment matters more than prose texture. */

.laprs {
  --laprs-line: #dcdfe4;
  --laprs-soft: #f6f7f9;
  --laprs-ink: #1f2328;
  --laprs-dim: #5f6672;
  --laprs-accent: #2b6cb0;
  --laprs-warn: #b4530a;
  --laprs-pad: 1.5rem;
  --laprs-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  box-sizing: border-box;
  width: 100%;
  max-width: 1280px;
  margin: 1.5rem auto;
  padding: var(--laprs-pad);
  border: 1px solid var(--laprs-line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  color: var(--laprs-ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
.laprs *, .laprs *::before, .laprs *::after { box-sizing: border-box; }

/* banner ------------------------------------------------------------- */

.laprs-banner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin: calc(var(--laprs-pad) * -1) calc(var(--laprs-pad) * -1) 1.25rem;
  padding: 1.6rem var(--laprs-pad);
  border-radius: 9px 9px 0 0;
  background: linear-gradient(105deg, #22303f 0%, #1a2531 45%, #151e28 100%);
  color: #fff;
}
.laprs-banner-logo {
  flex: none;
  width: 74px;
  height: 74px;
  object-fit: contain;
  border-radius: 8px;
}
.laprs-banner-text { flex: 1 1 auto; min-width: 0; }
.laprs-banner-org {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .045em;
  color: #93a4b6;
}
.laprs-banner-call {
  margin: .18rem 0 .12rem;
  padding: 0;
  font-size: clamp(2rem, 5.4vw, 3.4rem);
  font-weight: 300;
  letter-spacing: .012em;
  line-height: 1.03;
  color: #fff;
  overflow-wrap: anywhere;
}
.laprs-banner-sub {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: #c7d2de;
}

/* status pill -------------------------------------------------------- */

.laprs-pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .34rem .85rem;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .085em;
  text-transform: uppercase;
  white-space: nowrap;
}
.laprs-pill i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.laprs-pill.is-ok   { color: #6ee7a8; }
.laprs-pill.is-warn { color: #fcd34d; }
.laprs-pill.is-bad  { color: #fca5a5; }
.laprs-pill.is-none { color: #9fb0c0; }

/* KPI cards ---------------------------------------------------------- */

.laprs-cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: .6rem;
  margin: 1rem 0;
}
.laprs-cards > div {
  padding: .7rem .8rem;
  border: 1px solid var(--laprs-line);
  border-radius: 8px;
  background: var(--laprs-soft);
  min-width: 0;
}
.laprs-cards small {
  display: block;
  margin-bottom: .3rem;
  font-size: 11px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--laprs-dim);
}
.laprs-cards strong {
  display: block;
  font-family: var(--laprs-mono);
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.laprs-cards em {
  display: block;
  margin-top: .15rem;
  font-family: var(--laprs-mono);
  font-size: 11px;
  font-style: normal;
  color: var(--laprs-dim);
  overflow-wrap: anywhere;
}

/* panels ------------------------------------------------------------- */

.laprs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.laprs-panel {
  padding: 1rem 1.1rem 1.2rem;
  border: 1px solid var(--laprs-line);
  border-radius: 8px;
  background: #fff;
  min-width: 0;
}
.laprs-panel--wide { grid-column: 1 / -1; }
.laprs-panel[hidden] { display: none; }
.laprs-igates { max-height: 320px; overflow-y: auto; }
.laprs-panel h3 {
  margin: 0 0 .6rem;
  padding: 0;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--laprs-ink);
}
.laprs-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: .5rem;
}
.laprs-panel-head h3 { margin: 0; }

.laprs-hint, .laprs-stats {
  margin: .4rem 0 .6rem;
  font-size: 13px;
  color: var(--laprs-dim);
}
.laprs-warn { color: var(--laprs-warn); }

/* buttons ------------------------------------------------------------ */

.laprs-tabs { display: flex; flex-wrap: wrap; gap: .35rem; }
.laprs-btn {
  padding: .35rem .75rem;
  border: 1px solid var(--laprs-line);
  border-radius: 6px;
  background: #fff;
  color: var(--laprs-ink);
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
}
.laprs-btn:hover { background: var(--laprs-soft); }
.laprs-btn:focus-visible { outline: 2px solid var(--laprs-accent); outline-offset: 2px; }
.laprs-btn.is-active {
  border-color: var(--laprs-accent);
  background: var(--laprs-accent);
  color: #fff;
}

/* map ---------------------------------------------------------------- */

.laprs-map {
  height: 520px;
  border: 1px solid var(--laprs-line);
  border-radius: 8px;
  background: var(--laprs-soft);
  overflow: hidden;
}
.laprs .leaflet-container { font: inherit; }
.laprs .leaflet-popup-content { line-height: 1.5; font-size: 13px; }
.laprs-comment { color: var(--laprs-dim); font-style: italic; }

.laprs-me-icon span {
  display: block;
  width: 18px;
  height: 18px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #d93025;
  box-shadow: 0 0 0 2px #d93025, 0 1px 4px rgba(0, 0, 0, .35);
}

.laprs-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1rem;
  margin-top: .6rem;
  font-size: 12px;
  color: var(--laprs-dim);
}
.laprs-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.laprs-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.laprs-dot--me    { background: #d93025; }
.laprs-dot--igate { background: #4285f4; }
.laprs-dot--digi  { background: #34a853; }
.laprs-dot--node  { background: #fbbc04; }
.laprs-line { width: 18px; height: 3px; border-radius: 2px; display: inline-block; }
.laprs-line--good { background: #1e8e3e; }
.laprs-line--bad  { background: #d93025; }

.laprs-osm { font-size: 13px; }

.laprs-findu-link { margin: .4rem 0 .8rem; font-size: 13px; }
.laprs-findu-link a { color: var(--laprs-accent); }

.laprs-source {
  margin: .5rem 0 .6rem;
  padding-left: .7rem;
  border-left: 2px solid var(--laprs-line);
  font-size: 12px;
  line-height: 1.45;
  color: var(--laprs-dim);
}
.laprs-source a { color: var(--laprs-accent); }

/* charts ------------------------------------------------------------- */

/* The box owns the geometry. The canvas is pinned inside it with !important so
   theme rules such as `canvas { height: auto !important }` cannot stretch it. */
.laprs-chart-box--short { height: 180px; }
.laprs-chart-box {
  position: relative;
  width: 100%;
  height: 260px;
  border: 1px solid var(--laprs-line);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}
.laprs-chart {
  position: absolute;
  top: 0;
  left: 0;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
}

/* iGate list --------------------------------------------------------- */

.laprs-igate {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--laprs-line);
  font-size: 14px;
}
.laprs-igate:last-child { border-bottom: 0; }
.laprs-igate strong { font-family: var(--laprs-mono); }
.laprs-igate span { color: var(--laprs-dim); font-size: 13px; white-space: nowrap; }

/* tables ------------------------------------------------------------- */

.laprs-table-wrap { overflow-x: auto; }
.laprs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.laprs-table th, .laprs-table td {
  padding: .55rem .5rem;
  border-bottom: 1px solid var(--laprs-line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}
.laprs-table th {
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--laprs-dim);
  white-space: nowrap;
}
.laprs-table td { font-family: var(--laprs-mono); }
.laprs-table td:first-child { color: var(--laprs-dim); }
.laprs-msg-text {
  white-space: normal;
  min-width: 240px;
  font-family: inherit !important;
  font-weight: 500;
}
.laprs-table a { color: var(--laprs-accent); }

.laprs-tag {
  display: inline-block;
  padding: .05rem .4rem;
  border-radius: 4px;
  background: var(--laprs-soft);
  border: 1px solid var(--laprs-line);
  font-family: var(--laprs-mono);
  font-size: 11px;
  color: var(--laprs-dim);
}
.laprs-tag--tx { border-color: #b7d3f2; background: #eaf2fd; color: #1a56b0; }
.laprs-tag--fi { border-color: #cbb7e8; background: #f2ecfb; color: #5b3a99; }

.laprs-table details { max-width: 460px; }
.laprs-table details summary { cursor: pointer; color: var(--laprs-accent); }
.laprs-table details code {
  display: block;
  margin-top: .4rem;
  padding: .5rem;
  border-radius: 4px;
  background: var(--laprs-soft);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 11px;
}

/* compose form -------------------------------------------------------- */


@media (max-width: 600px) {
}




@media (max-width: 600px) {
}

/* diagnostics + footer ------------------------------------------------ */

.laprs-diag { margin-top: 1rem; font-size: 13px; }
.laprs-diag summary { cursor: pointer; }
.laprs-diag h4 { margin: .8rem 0 .3rem; font-family: var(--laprs-mono); }
.laprs-diag ul { margin: 0; padding-left: 1.2rem; }
.laprs-diag li { margin-bottom: .35rem; overflow-wrap: anywhere; }
.laprs-diag code { font-size: 11px; }

.laprs-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem;
  margin-top: 1rem;
  padding-top: .8rem;
  border-top: 1px solid var(--laprs-line);
  font-size: 12px;
  color: var(--laprs-dim);
}

/* admin + responsive -------------------------------------------------- */

.laprs-admin { margin-top: 1.25rem; max-width: none; }

@media (max-width: 1000px) {
  .laprs-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .laprs-grid { grid-template-columns: 1fr; }
  .laprs-panel--wide { grid-column: auto; }
  .laprs-map { height: 420px; }
  .laprs-chart-box { height: 240px; }
  .laprs-chart-box--short { height: 170px; }
}
@media (max-width: 780px) {
  .laprs-banner { flex-wrap: wrap; gap: 1rem; }
  .laprs-pill { order: 3; width: auto; }
}
@media (max-width: 600px) {
  .laprs { --laprs-pad: 1rem; }
  .laprs-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .laprs-banner { padding: 1.15rem var(--laprs-pad); }
  .laprs-banner-logo { width: 52px; height: 52px; }
  .laprs-banner-sub { font-size: 13.5px; }
  .laprs-map { height: 340px; }
  .laprs-chart-box { height: 220px; }
  .laprs-chart-box--short { height: 160px; }
}
@media (prefers-reduced-motion: reduce) {
  .laprs * { transition: none !important; animation: none !important; }
}
