:root {
  color-scheme: light;
  --ink: #172026;
  --muted: #63717d;
  --line: #d8e0e5;
  --soft: #f6f9fa;
  --teal: #0f766e;
  --teal-2: #2f7f7a;
  --orange: #b84418;
  --orange-2: #ee6b35;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: var(--teal);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 32px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
}

.topbar h1 {
  margin: 0;
  font-size: 1.55rem;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--muted);
}

.official-link {
  border: 1px solid var(--teal);
  border-radius: 8px;
  color: var(--teal);
  padding: 9px 12px;
  text-decoration: none;
  white-space: nowrap;
}

.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 10px 32px 0;
  border-bottom: 1px solid var(--line);
}

.tab-button {
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  padding: 11px 14px;
}

.tab-button.active {
  border-bottom-color: var(--teal);
  color: var(--ink);
  font-weight: 700;
}

main {
  padding: 24px 32px 42px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.readme-wrap {
  max-width: 980px;
}

.lead {
  font-size: 1.08rem;
}

.warning,
.note {
  border-left: 4px solid var(--orange);
  background: #fff8f4;
  margin: 16px 0;
  padding: 12px 14px;
}

.note {
  border-left-color: var(--teal);
  background: #f5fbfa;
}

.links a {
  display: inline-block;
  font-weight: 700;
  margin-right: 18px;
  text-decoration: none;
}

.section-head {
  max-width: 980px;
  margin-bottom: 18px;
}

.section-head h2 {
  margin: 0 0 4px;
}

.section-head p {
  color: var(--muted);
  margin: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 1040px;
}

.full {
  grid-column: 1 / -1;
}

label {
  display: block;
  color: var(--ink);
  font-weight: 700;
}

input,
textarea,
button {
  font: inherit;
}

input[type="text"],
input[type="search"],
input[type="file"],
textarea {
  display: block;
  width: 100%;
  border: 1px solid #cbd5dc;
  border-radius: 8px;
  margin-top: 6px;
  padding: 10px 11px;
}

textarea {
  resize: vertical;
}

.help,
.status {
  color: var(--muted);
  display: block;
  font-size: 0.92rem;
  margin-top: 6px;
}

.status.error {
  color: var(--orange);
  font-weight: 700;
}

.status.ok {
  color: var(--teal);
  font-weight: 700;
}

.status.busy {
  color: var(--orange);
  font-weight: 700;
}

.status.busy::before {
  animation: spin 0.8s linear infinite;
  border: 2px solid rgba(184, 68, 24, 0.22);
  border-top-color: var(--orange);
  border-radius: 50%;
  content: "";
  display: inline-block;
  height: 0.9em;
  margin-right: 8px;
  vertical-align: -0.12em;
  width: 0.9em;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 12px 0 16px;
}

.controls label {
  min-width: 150px;
}

.controls input[type="range"] {
  display: block;
  width: 150px;
  margin-top: 6px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  border-collapse: collapse;
  min-width: 1180px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--soft);
  position: sticky;
  top: 0;
  z-index: 1;
}

td.small {
  white-space: nowrap;
}

td.conflicts {
  min-width: 260px;
  white-space: normal;
}

.agenda-day {
  margin: 18px 0 24px;
}

.agenda-day h3 {
  margin-bottom: 10px;
}

.agenda-item {
  border-top: 1px solid var(--line);
  padding: 12px 0;
}

.agenda-title {
  font-weight: 800;
}

.meta {
  color: var(--muted);
  font-size: 0.93rem;
}

.map-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 14px;
}

.map-sidebar {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 12px;
  min-height: 740px;
}

.map-sidebar label + label {
  margin-top: 14px;
}

#network {
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 740px;
}

.search-results {
  max-height: 210px;
  overflow: auto;
  margin: 10px 0;
  border-bottom: 1px solid var(--line);
}

.result-button {
  display: block;
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  color: var(--ink);
  padding: 8px 0;
  text-align: left;
}

.result-button:hover {
  color: var(--teal);
}

.map-details {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.neighbor {
  border-top: 1px solid var(--line);
  padding: 8px 0;
}

.strength {
  color: var(--teal);
  font-weight: 800;
}

@media (max-width: 900px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px;
  }

  .tabs,
  main {
    padding-left: 18px;
    padding-right: 18px;
  }

  .form-grid,
  .map-layout {
    grid-template-columns: 1fr;
  }

  .map-sidebar {
    min-height: auto;
  }

  #network {
    height: 620px;
  }
}
