:root {
  --bg: #ffffff;
  --accent: #0078d4;
  --muted: #7a7a7a;
  --muted-2: #333;
  --gap: 12px;
  --max-width: 1100px;
  --radius: 8px;

  --font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  --base-size: 15px;
  --header-size: 13px;
  --title-size: 20px;

  --mobile-label-base: 80px;
  --mobile-label-width: calc(var(--mobile-label-base) * 1.1);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  font-family: var(--font-family);
  font-size: var(--base-size);
  color: var(--muted-2);
  background: var(--bg);
}

.container {
  max-width: var(--max-width);
  margin: 28px auto;
  padding: 16px;
}

.title {
  text-align: center;
  font-size: var(--title-size);
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 18px 0;
}

.branches {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Desktop */
@media (min-width: 900px) {

  .desktop-header,
  .branch-row {
    display: grid;
    grid-template-columns: 120px 1fr 220px 140px;
    gap: 12px;
    align-items: center;
  }

  .desktop-header {
    font-size: var(--header-size);
    font-weight: 600;
    color: var(--muted);
    border-bottom: 1px solid var(--muted);
    padding: 8px 10px;
  }

  .desktop-header > div {
    text-align: center;
  }

  .branch-row {
    border-bottom: 1px solid var(--muted);
    padding: 10px 14px;
  }

  .col-branch {
    text-align: center;
    font-weight: 700;
    color: var(--accent);
  }

  .col-address {
    text-align: left;
    font-size: var(--header-size);
    color: var(--muted);
    line-height: 1.3;
  }

  .col-schedule {
    text-align: center;
    font-size: var(--header-size);
    color: var(--muted);
    line-height: 1.3;
    white-space: pre-line;
  }

  .col-phone {
    text-align: center;
    font-size: var(--header-size);
    color: var(--muted);
    font-weight: 400;
    white-space: nowrap;
  }

  .mobile-table {
    display: none !important;
  }
}

/* Mobile */
@media (max-width: 899px) {
  .branch-row {
    display: block;
    border-bottom: 1px solid var(--muted);
    padding: 6px 0 10px;
  }

  .branch-row:last-child {
    padding-bottom: 6px;
    border-bottom: none;
  }

  .desktop-header,
  .col-branch,
  .col-address,
  .col-schedule,
  .col-phone {
    display: none;
  }

  .mobile-table {
    display: grid;
    grid-template-columns: var(--mobile-label-width) 1fr;
    grid-template-rows: auto auto;
    grid-template-areas:
      "label address"
      "empty bottom";
    gap: 6px 10px;
    width: 100%;
    align-items: start;
  }

  .mobile-label {
    grid-area: label;
    font-weight: 700;
    color: var(--accent);
    font-size: 15px;
    white-space: nowrap;
    padding-right: 8px;
  }

  .mobile-address {
    grid-area: address;
    font-size: 15px;
    color: var(--muted);
    line-height: 1.35;
    word-break: break-word;
  }

  .mobile-empty {
    grid-area: empty;
  }

  .mobile-bottom {
    grid-area: bottom;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 10px;
  }

  .mobile-schedule {
    font-size: 15px;
    color: var(--muted);
    white-space: pre-line;
    text-align: left;
  }

  .mobile-phone {
    font-size: 15px;
    color: var(--muted);
    text-align: right;
    font-weight: 400;
    white-space: nowrap;
  }
}

/* Pagination */
.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 18px 0 8px;
}

.pagination .button {
  min-width: 40px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  background: transparent;
  color: var(--muted-2);
  font-size: 14px;
  cursor: pointer;
  transition: all .12s;
}

.pagination .button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.pagination .button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

@media (max-width: 420px) {
  .pagination .button {
    min-width: 34px;
    height: 32px;
    font-size: 13px;
    padding: 0 8px;
  }

  .pagination {
    gap: 6px;
  }
}
