:root {
  --bg: #f1f4fa;
  --surface: #ffffff;
  --ink: #0f1b34;
  --muted: #6b7690;
  --muted-2: #8b96ad;
  --line: #e5e9f2;
  --line-soft: #eef1f8;
  --accent: #2f5bff;
  --accent-soft: #eef2ff;
  --navy: #0e1a33;
  --navy-2: #1b2c4f;
  --good: #0f9960;
  --warn: #c98a13;
  --danger: #c8352f;
  --radius: 18px;
  --shadow: 0 14px 44px rgba(15, 27, 52, 0.07);
  --shadow-sm: 0 2px 8px rgba(15, 27, 52, 0.06);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
body.wide .wrap { max-width: 1440px; }
main.wrap { padding-bottom: 48px; }

.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* ------------------------------------------------------------- шапка */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: linear-gradient(120deg, #0c172d 0%, #142647 60%, #1a3059 100%);
  color: #fff;
  box-shadow: 0 6px 24px rgba(9, 17, 33, 0.22);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 68px;
}

.brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.brand:hover { text-decoration: none; }

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(150deg, #4d78ff, #2f5bff 55%, #2443c4);
  display: grid;
  place-items: center;
  box-shadow: 0 6px 16px rgba(47, 91, 255, 0.38);
  flex: none;
}
.brand-mark svg { width: 22px; height: 22px; display: block; }

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-title { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.brand-sub { font-size: 11.5px; color: #9db0d6; letter-spacing: 0.01em; }

.topnav { display: flex; align-items: center; gap: 4px; }
.topnav a {
  color: #c3cfe8;
  font-size: 13.5px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 9px;
  transition: background 0.15s, color 0.15s;
}
.topnav a:hover { color: #fff; background: rgba(255, 255, 255, 0.08); text-decoration: none; }
.topnav a.active { color: #fff; background: rgba(255, 255, 255, 0.12); }

.admin-link {
  background: #d92d20 !important;
  color: #fff !important;
  font-weight: 650;
}
.admin-link:hover { background: #b42318 !important; color: #fff !important; }
.admin-link.active { background: #b42318 !important; }

.nav-icon {
  appearance: none;
  border: 0;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: inline-grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  color: #c3cfe8;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.nav-icon:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
.nav-icon svg { width: 15px; height: 15px; }

.role-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #eaf7f0;
  color: #0d8a5c;
  font-size: 11.5px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  vertical-align: middle;
}

/* Удаление доступно только администратору; редактору кнопки не показываем. */
[data-delete-city],
[data-delete-building] { display: none !important; }

body[data-role='admin'] [data-delete-city],
body[data-role='admin'] [data-delete-building] { display: inline-grid !important; }

/* ------------------------------------------------------------- вход */

.login-wrap { max-width: 420px; margin: 56px auto 20px; }

.login-card { padding: 28px 28px 26px; }

.login-card h1 { margin: 0 0 6px; font-size: 22px; letter-spacing: -0.02em; }
.login-sub { margin: 0 0 20px; color: var(--muted); font-size: 13.5px; }
.login-form { display: grid; gap: 14px; }
.login-submit { width: 100%; margin-top: 4px; }

/* ------------------------------------------------------------- заголовок */

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 40px 0 24px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(25px, 3.1vw, 34px);
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 750;
}

.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
  max-width: 640px;
}
.hero p b { color: var(--ink); font-weight: 600; }
.hero p + p { margin-top: 6px; }

.live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 8px 12px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px rgba(15, 153, 96, 0.14); }
.live.offline .live-dot { background: var(--warn); box-shadow: 0 0 0 3px rgba(201, 138, 19, 0.16); }
.live.updated .live-dot { animation: pulse 0.9s ease-out 2; }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(15, 153, 96, 0.5); }
  100% { box-shadow: 0 0 0 10px rgba(15, 153, 96, 0); }
}

/* ------------------------------------------------------------- вкладки */

.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 5px;
  background: #e4e9f4;
  border-radius: 14px;
  margin-bottom: 0;
}

.tabs-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.base-control {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px 7px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  font-size: 12.5px;
  color: var(--muted);
  cursor: text;
}

.base-control span { white-space: nowrap; }

.base-control input {
  width: 64px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faff;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
  text-align: center;
  outline: none;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  -moz-appearance: textfield;
  appearance: textfield;
}

.base-control input::-webkit-outer-spin-button,
.base-control input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.base-control input:focus {
  background: #fff;
  border-color: #b9c8ff;
  box-shadow: 0 0 0 3px rgba(47, 91, 255, 0.12);
}

.filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.select-control {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px 7px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  font-size: 12.5px;
  color: var(--muted);
}

.select-control span { white-space: nowrap; }

.select-control select {
  appearance: none;
  padding: 6px 26px 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%236b7690' stroke-width='2.6'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 9px center;
  font: inherit;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--ink);
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.select-control select:focus {
  background-color: #fff;
  border-color: #b9c8ff;
  box-shadow: 0 0 0 3px rgba(47, 91, 255, 0.12);
}

.tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: #5b6884;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.16s, color 0.16s, box-shadow 0.16s;
  white-space: nowrap;
}

.tab:hover { color: var(--ink); }

.tab.active {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 4px 12px rgba(14, 26, 51, 0.25);
}

.tab .tab-count {
  font-weight: 600;
  font-size: 12px;
  opacity: 0.65;
  margin-left: 7px;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------- карточка */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
}

.search { position: relative; display: block; }
.search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--muted-2);
  pointer-events: none;
}
.search input {
  width: 290px;
  max-width: 100%;
  padding: 9px 14px 9px 37px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8faff;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.search input::placeholder { color: #9aa4ba; }
.search input:focus {
  background: #fff;
  border-color: #b9c8ff;
  box-shadow: 0 0 0 3px rgba(47, 91, 255, 0.12);
}

.card-meta { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.card-meta b { color: var(--ink); font-weight: 600; }

/* ------------------------------------------------------------- таблица */

.table-scroll { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

.cities-table th {
  text-align: left;
  font-size: 11.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #7d88a3;
  font-weight: 650;
  padding: 11px 20px;
  background: #fbfcff;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.cities-table td {
  padding: 13px 20px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 15px;
  vertical-align: middle;
}

.cities-table tbody tr:last-child td { border-bottom: 0; }

.col-rank { width: 66px; }
.col-num { text-align: right; white-space: nowrap; }
.cities-table th.col-num { text-align: right; }

.city-row { cursor: pointer; transition: background 0.14s; }
.city-row:hover { background: #f6f9ff; }
.city-row:focus-visible { outline: 2px solid #b9c8ff; outline-offset: -2px; }

.rank {
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
  font-size: 13.5px;
  width: 66px;
}

.city-name { display: flex; align-items: center; gap: 9px; font-weight: 600; letter-spacing: -0.005em; }

.chevron {
  color: #9aa5bd;
  transition: transform 0.2s ease, color 0.2s;
  flex: none;
  display: inline-flex;
}
.chevron svg { width: 15px; height: 15px; }
.city-row.open .chevron { transform: rotate(90deg); color: var(--accent); }
.city-row.open { background: #f4f7ff; }
.city-row.open:hover { background: #eef3ff; }

.num { text-align: right; font-variant-numeric: tabular-nums; }
.score-cell { font-weight: 700; color: var(--navy); }

.detail-row td { padding: 0; border-bottom: 1px solid var(--line); background: #f8faff; }

.detail {
  padding: 6px 20px 18px 66px;
  animation: slide-down 0.18s ease-out;
}

@keyframes slide-down {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

.detail-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  padding: 6px 0 8px;
}
.detail-head b { color: var(--ink); font-weight: 600; }
.detail-sort { margin-left: auto; font-size: 11.5px; color: var(--muted-2); }

.detail table { min-width: 520px; }

.detail table th {
  font-size: 10.5px;
  padding: 7px 10px;
  background: transparent;
  border-bottom: 1px solid #dfe6f5;
  color: #8490aa;
}

.detail table td {
  padding: 8px 10px;
  font-size: 13.5px;
  border-bottom: 1px solid #e7ecf8;
  background: transparent;
}

.detail table tbody tr:last-child td { border-bottom: 0; }
.detail table tbody tr:hover td { background: #f1f5ff; }

.b-name { font-weight: 600; }
.b-addr { color: var(--muted); }
.b-score { font-weight: 650; color: var(--navy); }

.d-rank { color: var(--muted-2); font-variant-numeric: tabular-nums; }
.d-num { text-align: right; font-variant-numeric: tabular-nums; }
.d-year { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }

.loading { color: var(--muted); font-size: 13.5px; padding: 12px 0; }
.empty { color: var(--muted); font-size: 13.5px; padding: 14px 0; }

/* ------------------------------------------------------------- подвал */

.footnote {
  margin: 18px 0 46px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footnote code { background: #e9eefb; padding: 1px 6px; border-radius: 6px; font-size: 12px; }

/* ------------------------------------------------------------- кнопки */

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 16px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: default; }

.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(47, 91, 255, 0.25); }
.btn-primary:hover { background: #2650e6; }

.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: #cdd6ea; background: #f8faff; }

.btn-danger { background: #fff; border-color: #f0cfcd; color: var(--danger); }
.btn-danger:hover { background: #fdf3f2; }

.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }

.icon-btn {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #5d6a86;
  cursor: pointer;
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}
.icon-btn:hover { background: #f3f6fd; color: var(--ink); border-color: #d3dbeb; }
.icon-btn.danger:hover { background: #fdf3f2; color: var(--danger); border-color: #f0cfcd; }
.icon-btn svg { width: 15px; height: 15px; }

.link-btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
.link-btn:hover { color: var(--accent); text-decoration: underline; }

/* ------------------------------------------------------------- админка */

.page-head { padding: 36px 0 8px; }
.page-head h1 { margin: 0 0 6px; font-size: clamp(24px, 2.8vw, 30px); letter-spacing: -0.02em; }
.page-head p { margin: 0; color: var(--muted); font-size: 14px; }

.admin-section { margin-top: 26px; }
.admin-section[id] { scroll-margin-top: 84px; }

.anchor-link {
  margin-left: 10px;
  font-size: 12.5px;
  color: var(--muted-2);
  white-space: nowrap;
}
.anchor-link:hover { color: var(--accent); }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.section-head h2 { margin: 0; font-size: 19px; letter-spacing: -0.01em; display: inline-block; }
.section-head .hint { font-size: 13px; color: var(--muted); margin-left: 8px; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.select {
  appearance: none;
  padding: 9px 34px 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7690' stroke-width='2.4'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  max-width: 100%;
}
.select:focus { outline: none; border-color: #b9c8ff; box-shadow: 0 0 0 3px rgba(47, 91, 255, 0.12); }

.admin-table th { padding: 10px 14px; }
.admin-table td { padding: 10px 14px; font-size: 14px; }
.admin-table td.actions { text-align: right; white-space: nowrap; }
.admin-table td.actions .icon-btn + .icon-btn { margin-left: 6px; }

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  white-space: nowrap;
}
.badge.moscow { background: #eaf7f0; color: #0d8a5c; }
.badge.spb { background: #fdf1e8; color: #bd5a1f; }
.badge.russia { background: #edf1ff; color: #2f5bff; }

.empty-state { padding: 40px 20px; text-align: center; color: var(--muted); font-size: 14px; }

.more-wrap { padding: 14px 20px; border-top: 1px solid var(--line-soft); text-align: center; }

/* ------------------------------------------------------------- модалка */

dialog.modal {
  border: 0;
  padding: 0;
  border-radius: 18px;
  width: min(480px, calc(100vw - 32px));
  box-shadow: 0 24px 70px rgba(9, 17, 33, 0.35);
  color: var(--ink);
}
dialog.modal form { margin: 0; }
dialog.modal::backdrop { background: rgba(9, 16, 31, 0.48); backdrop-filter: blur(2px); }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.modal-head h3 { margin: 0; font-size: 17px; letter-spacing: -0.01em; }
.modal-close { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 22px; line-height: 1; padding: 4px 6px; border-radius: 8px; }
.modal-close:hover { background: #f2f5fb; color: var(--ink); }

.modal-body { padding: 18px 22px; display: grid; gap: 14px; }
.modal-foot { padding: 14px 22px 20px; display: flex; justify-content: flex-end; gap: 10px; }

.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: #48546e; }
.field input, .field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-size: 14.5px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field select:focus { border-color: #b9c8ff; box-shadow: 0 0 0 3px rgba(47, 91, 255, 0.12); }
.field .hint { font-size: 12px; color: var(--muted-2); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.combo { position: relative; }

.combo-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 40;
  max-height: 232px;
  overflow: auto;
  padding: 5px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 44px rgba(15, 27, 52, 0.18);
}

.combo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.combo-item:hover,
.combo-item.active { background: var(--accent-soft); }

.combo-meta { font-size: 11.5px; color: var(--muted-2); white-space: nowrap; }
.combo-empty { padding: 10px; font-size: 13px; color: var(--muted); }

.form-error {
  display: none;
  background: #fdf3f2;
  border: 1px solid #f2d3d1;
  color: #a72a25;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13.5px;
}
.form-error.show { display: block; }

/* ------------------------------------------------------------- тосты */

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  background: var(--navy);
  color: #fff;
  font-size: 14px;
  padding: 11px 16px;
  border-radius: 11px;
  box-shadow: 0 16px 40px rgba(9, 17, 33, 0.3);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: none; }

/* ------------------------------------------------------------- о проекте */

.about-section { margin-top: 22px; max-width: 880px; }

.card.prose { padding: 26px 30px; }

.prose h2 { margin: 0 0 12px; font-size: 19px; letter-spacing: -0.01em; }
.prose h3 { margin: 22px 0 8px; font-size: 15px; color: var(--navy); }
.prose p { margin: 0 0 10px; color: #3d4a66; font-size: 14.5px; }
.prose b { color: var(--ink); }

.prose .prose-lead { margin-bottom: 2px; color: var(--muted); font-size: 13.5px; }

.prose ul { margin: 0 0 12px; padding-left: 20px; }
.prose li { margin: 7px 0; color: #3d4a66; font-size: 14.5px; }
.prose li::marker { color: #9fb0d6; }
.prose sup { color: var(--muted-2); }

.prose .note {
  margin: 10px 0 0;
  padding: 10px 14px;
  background: #f8faff;
  border-left: 3px solid #c9d5f5;
  border-radius: 0 10px 10px 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.link-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.link-row { display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; }
.link-label { min-width: 160px; font-size: 13px; color: var(--muted-2); }

.section-title { margin: 0 0 12px; font-size: 19px; letter-spacing: -0.01em; }

.authors { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.author {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.author .role { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted-2); }
.author .name { margin: 4px 0 6px; font-size: 18px; line-height: 1.35; font-weight: 750; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.author .name.multi { font-size: 18px; }
.author p { margin: 0 0 8px; font-size: 13.5px; color: var(--muted); }
.author a { font-size: 13.5px; }

.author.tool {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: linear-gradient(110deg, #0e1a33, #1b2f57);
  border-color: transparent;
  box-shadow: 0 12px 32px rgba(15, 27, 52, 0.18);
}
.author.tool .role { color: #9db0d6; }
.author.tool .name { margin: 2px 0 0; color: #fff; }
.author.tool p { margin: 0; max-width: 520px; color: #c3cfe8; }

/* ------------------------------------------------------------- сайдбар */

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}

.sidebar { min-width: 0; }

.widget + .widget { margin-top: 16px; }

.widget-head {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.widget-head h2 {
  margin: 0;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.widget-sub {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted-2);
}

.top-list { list-style: none; margin: 0; padding: 4px 0; }

.top-item {
  padding: 7px 16px;
  border-bottom: 1px solid #f1f4fb;
  font-size: 12.5px;
  line-height: 1.45;
  color: #3d4a66;
}

.top-item:last-child { border-bottom: 0; }

.top-rank { color: var(--muted-2); font-variant-numeric: tabular-nums; }
.top-name { font-weight: 600; color: var(--ink); }
.top-city { color: var(--muted); }
.top-meta { color: var(--muted-2); white-space: nowrap; }

.completed-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  max-height: 320px;
  overflow: auto;
}

.completed-item {
  padding: 6px 16px;
  border-bottom: 1px solid #f1f4fb;
  font-size: 12.5px;
  line-height: 1.4;
  color: #3d4a66;
}

.completed-item:last-child { border-bottom: 0; }
.completed-count { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

.recent { list-style: none; margin: 0; padding: 4px 0; }

.recent-item {
  padding: 8px 16px;
  border-bottom: 1px solid #f1f4fb;
  font-size: 12.5px;
  line-height: 1.45;
  color: #3d4a66;
}

.recent-item:last-child { border-bottom: 0; }

.recent-when { color: var(--muted-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.recent-name { font-weight: 600; color: var(--ink); }
.recent-city { color: var(--muted); }
.recent-user { color: var(--muted); font-style: italic; }
.recent-empty { padding: 14px 16px; font-size: 12.5px; color: var(--muted); }

.event-list { list-style: none; margin: 0; padding: 4px 0; }

.event-item {
  padding: 8px 16px;
  border-bottom: 1px solid #f1f4fb;
  font-size: 12.5px;
  line-height: 1.45;
  color: #3d4a66;
}

.event-item:last-child { border-bottom: 0; }
.event-date { color: var(--muted-2); font-variant-numeric: tabular-nums; white-space: nowrap; }

@media (max-width: 1100px) {
  .content-grid { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------- адаптив */

@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .topbar-inner { height: 60px; }
  .brand-sub { display: none; }
  .topnav a { padding: 8px 10px; font-size: 13px; }
  .hero { padding: 26px 0 18px; flex-direction: column; align-items: flex-start; gap: 12px; }
  .search input { width: 100%; }
  .search { flex: 1; }
  .filters { width: 100%; flex-direction: column; align-items: stretch; }
  .base-control, .select-control { justify-content: space-between; }
  .card-head { gap: 10px; }
  .card-meta { width: 100%; }
  .detail { padding-left: 20px; }
  .cities-table th, .cities-table td { padding-left: 14px; padding-right: 14px; }
  .col-rank, .rank { width: 46px; }
  .footnote { flex-direction: column; }
  .page-head { padding-top: 26px; }
  .admin-table td, .admin-table th { padding: 9px 10px; }
  .section-head .hint { display: block; margin: 2px 0 0; }
  .anchor-link { margin-left: 0; display: inline-block; margin-top: 4px; }
  .authors { grid-template-columns: 1fr; }
  .author.tool { flex-direction: column; align-items: flex-start; gap: 10px; }
  .card.prose { padding: 20px; }
  .link-label { min-width: 100%; }
}

@media (max-width: 560px) {
  .brand-text { display: none; }
  .topnav a { padding: 7px 9px; font-size: 12.5px; }
}
