:root {
  --ink: #10293b;
  --muted: #647786;
  --paper: #f7f4ee;
  --white: #fff;
  --ice: #dff5fb;
  --blue: #176b86;
  --blue-dark: #0d526b;
  --lime: #b8d65d;
  --coral: #f47d63;
  --line: #d8e1e4;
  --shadow: 0 22px 55px rgba(20, 54, 70, .11);
  --radius: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.site-header {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 5vw, 76px);
  background: var(--white);
  border-bottom: 1px solid rgba(16, 41, 59, .08);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; letter-spacing: .02em; }
.brand-mark {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  background: var(--ink); color: white; font-weight: 900; font-size: 14px;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 14px; }
.brand small { color: var(--blue); font-size: 9px; letter-spacing: .2em; margin-top: 2px; }
.header-link { font-size: 13px; font-weight: 750; color: var(--blue); text-underline-offset: 5px; }

.hero {
  min-height: 0;
  position: relative;
  overflow: hidden;
  padding: 26px clamp(20px, 7vw, 112px) 20px;
  background:
    radial-gradient(circle at 78% 42%, rgba(255,255,255,.65) 0 2%, transparent 2.2%),
    linear-gradient(112deg, #dff5fb 0%, #c7ecf4 56%, #e7f6f4 100%);
}
.hero::after {
  content: ""; position: absolute; width: 540px; height: 540px; right: -90px; top: -180px;
  border: 1px solid rgba(23,107,134,.2); border-radius: 50%; box-shadow: 0 0 0 70px rgba(255,255,255,.13), 0 0 0 140px rgba(255,255,255,.1);
}
.hero-copy { position: relative; z-index: 2; max-width: 790px; }
.eyebrow { margin: 0 0 12px; color: var(--blue); font-size: 12px; font-weight: 850; letter-spacing: .15em; text-transform: uppercase; }
h1, h2 { margin: 0; letter-spacing: -.045em; line-height: .98; }
h1 { max-width: 700px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(42px, 5vw, 62px); font-weight: 500; }
h1 em { color: var(--blue); font-weight: 400; }
.hero-lede { max-width: 570px; margin: 12px 0 0; font-size: clamp(15px, 1.5vw, 18px); color: #385666; }
.ice-orbit {
  position: absolute; right: 14%; top: 64px; z-index: 1; display: grid; place-items: center;
  width: 130px; height: 130px; border-radius: 50%; color: var(--ink); background: rgba(255,255,255,.78);
  box-shadow: var(--shadow); transform: rotate(-9deg);
}
.ice-orbit::before { content: ""; position: absolute; inset: 16px; border: 1px dashed rgba(23,107,134,.34); border-radius: inherit; }
.ice-orbit span { font-size: 50px; filter: grayscale(1); }
.stats {
  position: relative; z-index: 2; display: flex; gap: 0; width: fit-content; margin-top: 12px;
  background: rgba(255,255,255,.78); border: 1px solid rgba(255,255,255,.9); border-radius: 18px; backdrop-filter: blur(10px);
}
.stats div { min-width: 145px; padding: 10px 18px; border-right: 1px solid rgba(16,41,59,.1); }
.stats div:last-child { border: 0; }
.stats strong, .stats span { display: block; }
.stats strong { font-family: Georgia, serif; font-size: 23px; }
.stats span { color: var(--muted); font-size: 11px; }

.workspace { max-width: 1240px; margin: 0 auto; padding: 24px 24px 90px; }
.workspace-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; }
h2 { font-family: Georgia, serif; font-size: clamp(32px, 4vw, 48px); font-weight: 500; }
.view-switch { display: flex; padding: 4px; background: #e8e4dc; border-radius: 14px; }
.view-button { border: 0; padding: 11px 16px; border-radius: 11px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 750; }
.view-button.active { background: var(--white); color: var(--ink); box-shadow: 0 2px 10px rgba(16,41,59,.08); }

.filters {
  display: grid; grid-template-columns: minmax(200px, 1.4fr) 1fr 1.35fr .9fr auto; gap: 12px; align-items: end;
  margin: 24px 0 14px; padding: 16px; background: var(--white); border-radius: 20px; box-shadow: 0 12px 35px rgba(16,41,59,.06);
}
.filters label span { display: block; margin: 0 0 7px 3px; color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.filters input, .filters select {
  width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 12px; padding: 0 13px; color: var(--ink); background: #fbfcfc; outline: none;
}
.filters input:focus, .filters select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23,107,134,.11); }
.primary-button {
  min-height: 48px; border: 0; border-radius: 12px; padding: 0 22px; background: var(--ink); color: white; font-weight: 800; cursor: pointer;
}
.primary-button:hover { background: var(--blue-dark); }
.filter-toggle { display: none; white-space: nowrap; }
.quick-dates { display: flex; gap: 8px; margin-bottom: 8px; }
.quick-dates button { border: 1px solid var(--line); border-radius: 999px; background: white; padding: 7px 14px; cursor: pointer; font-size: 13px; font-weight: 750; }
.quick-dates button.active { border-color: var(--blue); background: var(--blue); color: white; }

.date-strip { display: flex; gap: 8px; overflow-x: auto; padding: 5px 1px 10px; scrollbar-width: thin; }
.date-button {
  flex: 0 0 auto; min-width: 88px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: transparent; color: var(--muted); cursor: pointer;
}
.date-button strong, .date-button span { display: block; }
.date-button strong { color: var(--ink); font-size: 14px; }
.date-button span { font-size: 11px; margin-top: 2px; }
.date-button.active { border-color: var(--blue); background: var(--blue); color: white; }
.date-button.active strong { color: white; }
.date-button .day-count { display: block; margin-top: 4px; color: var(--blue-dark); font-size: 11px; font-weight: 750; }
.date-button .day-count.none { color: var(--muted); font-weight: 500; }
.date-button.active .day-count { color: white; }
.calendar-jump { display: flex; align-items: center; gap: 12px; width: fit-content; margin: 0 0 12px; color: var(--muted); font-size: 13px; font-weight: 700; }
.calendar-jump input { min-height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; color: var(--ink); background: var(--white); font: inherit; }
.calendar-jump input:focus { outline: 2px solid var(--blue); outline-offset: 2px; }

.result-head { display: flex; justify-content: space-between; gap: 20px; margin: 16px 0 8px; color: var(--muted); font-size: 13px; }
.result-head p { margin: 0; }
.freshness-note span { display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 50%; background: var(--lime); }
.freshness-note.is-stale span { background: #b84a36; }
.tag.source-error { background: #fde8e3; color: #a13b2b; }
.schedule-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 9px 0 15px; color: var(--muted); font-size: 12px; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--blue-dark); cursor: pointer; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.cards { display: grid; gap: 14px; }
.schedule-card, .rink-card {
  position: relative; display: grid; background: var(--white); border: 1px solid rgba(16,41,59,.08); border-radius: var(--radius); overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.schedule-card:hover, .rink-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.schedule-card { grid-template-columns: 98px minmax(220px, 1.5fr) minmax(150px, .8fr) auto; align-items: center; padding: 16px 20px; gap: 18px; }
.time { font-family: Georgia, serif; font-size: 27px; }
.time small { display: block; margin-top: 3px; color: var(--muted); font: 11px Inter, sans-serif; text-transform: uppercase; letter-spacing: .06em; }
.card-title { margin: 0; font-size: 17px; line-height: 1.2; }
.card-address { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { padding: 5px 9px; border-radius: 999px; background: var(--ice); color: var(--blue-dark); font-size: 11px; font-weight: 750; }
.tag.available { background: #edf5d3; color: #536f08; }
.tag.cancelled, .tag.sold-out { background: #fee8e2; color: #9b3d2b; }
.tag.ended { background: #e9edf0; color: #637483; }
.tag.muted { background: #f1f3f4; color: #4d5f6c; }
.tag.kind-figure { background: #e9f3d2; color: #4c6a07; }
.tag.kind-hockey { background: #e6ebf6; color: #34507d; }
.tag.kind-school, .tag.kind-restricted { background: #f3ece0; color: #7a5a22; }
.schedule-card.ended { opacity: .65; }
.source-meta { color: var(--muted); font-size: 12px; }
.source-meta strong { display: block; color: var(--ink); margin-bottom: 3px; }
.card-action { display: inline-grid; place-items: center; min-height: 42px; padding: 0 17px; border: 1px solid var(--ink); border-radius: 12px; text-decoration: none; font-size: 13px; font-weight: 800; }
.card-action:hover { background: var(--ink); color: white; }
.card-actions { display: grid; gap: 7px; min-width: 132px; }
.map-card-link { border: 0; background: transparent; color: var(--blue-dark); cursor: pointer; font-size: 12px; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }

.rink-card { grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding: 23px 25px; }
.rink-card .card-action { background: transparent; cursor: pointer; }
.rink-status { margin-top: 10px; font-size: 12px; color: var(--muted); }
.rink-status b { color: var(--blue); }

.notice { padding: 22px; margin: 14px 0; border-radius: 16px; background: #fff8df; color: #705c14; }
.hidden { display: none !important; }
.load-more { display: block; margin: 26px auto 0; border: 1px solid var(--line); border-radius: 14px; padding: 12px 22px; background: white; color: var(--ink); cursor: pointer; font-weight: 750; }
.empty { padding: 62px 24px; border: 1px dashed #b7c6cc; border-radius: var(--radius); text-align: center; color: var(--muted); }
.empty strong { display: block; margin-bottom: 8px; color: var(--ink); font-family: Georgia, serif; font-size: 25px; }
.empty .load-more { display: inline-block; margin: 16px 5px 0; }
.empty > span { display: block; max-width: 560px; margin: 0 auto; }
.nearest-days { margin-top: 18px; }
.nearest-title { margin: 0 0 8px; color: var(--ink); font-size: 13px; font-weight: 750; }
.nearest-day { margin: 4px; padding: 9px 14px; border: 1px solid var(--blue); border-radius: 999px; background: var(--ice); color: var(--blue-dark); cursor: pointer; font-size: 13px; font-weight: 750; }
.channel-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; margin-top: 30px; padding: 20px 22px; border-radius: 20px; background: var(--white); border: 1px solid rgba(16,41,59,.08); }
.channel-cta strong, .channel-cta span { display: block; }
.channel-cta strong { font-size: 16px; }
.channel-cta span { margin-top: 4px; color: var(--muted); font-size: 13px; }
.channel-links { display: flex; gap: 10px; }
.order-switch { display: inline-flex; padding: 3px; border-radius: 10px; background: #e8e4dc; }
.order-switch button { border: 0; padding: 6px 12px; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 750; }
.order-switch button.active { background: var(--white); color: var(--ink); box-shadow: 0 1px 6px rgba(16,41,59,.08); }
.rink-day-card { background: var(--white); border: 1px solid rgba(16,41,59,.08); border-radius: var(--radius); padding: 18px 20px; }
.rink-day-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.session-list { margin-top: 12px; }
.session-row { display: grid; grid-template-columns: minmax(180px, 260px) minmax(0, 1fr); gap: 8px 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.session-kind { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.session-note { flex-basis: 100%; color: var(--muted); font-size: 12px; }
.time-chips { display: flex; flex-wrap: wrap; gap: 6px; align-content: start; }
.time-chip { padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfc; color: var(--ink); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; text-decoration: none; }
a.time-chip.bookable { border-color: var(--blue); color: var(--blue-dark); }
a.time-chip.bookable:hover { background: var(--ice); }
.time-chip.ended { opacity: .45; text-decoration: line-through; }
.rink-day-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 16px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.rink-day-foot .card-action { min-height: 38px; color: var(--ink); }
.rink-day-head .map-card-link { white-space: nowrap; }
.source-warning { color: #a13b2b; font-weight: 700; }
.rental-list { display: grid; gap: 14px; margin-top: 18px; }
.rental-title { margin: 8px 0 0; font-family: Georgia, serif; font-size: 26px; font-weight: 500; }
.rental-terms { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: #f3f7f7; font-size: 13px; }
.rental-terms strong { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.rental-terms p { margin: 6px 0 8px; }
.rental-terms small { display: block; margin-top: 6px; color: var(--muted); }
.rental-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.rental-links .rink-phone { margin-top: 0; }

.map-view { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 16px; min-height: 570px; }
.map-list-wrap, .map-detail { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: white; }
.map-list-wrap { display: flex; flex-direction: column; }
.map-intro { margin: 0; padding: 16px; color: var(--muted); font-size: 12px; font-weight: 700; }
.map-list { overflow-y: auto; max-height: 560px; padding: 0 9px 9px; }
.map-place { display: block; width: 100%; margin-bottom: 6px; padding: 12px; border: 1px solid transparent; border-radius: 12px; background: #f6f9f9; color: var(--ink); text-align: left; cursor: pointer; }
.map-place.active { border-color: var(--blue); background: var(--ice); }
.map-place strong, .map-place small, .map-place span { display: block; }
.map-place strong { font-size: 14px; }
.map-place small { margin: 3px 0; color: var(--blue-dark); font-size: 12px; font-weight: 700; }
.map-place span { color: var(--muted); font-size: 11px; }
.map-detail { display: flex; flex-direction: column; }
.map-detail-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 14px 18px; }
.map-detail-head h3 { width: 100%; margin: 0; font-size: 17px; }
.map-detail-head p { flex: 1; min-width: 180px; margin: 0; color: var(--muted); font-size: 12px; }
.map-detail-head .card-action { min-height: 36px; padding: 0 12px; }
.yandex-map { width: 100%; flex: 1; min-height: 450px; border: 0; background: var(--ice); }
.map-fallback { display: grid; place-items: center; flex: 1; min-height: 360px; padding: 30px; color: var(--muted); text-align: center; }

:is(button, a, input, select):focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }

dialog { width: min(700px, calc(100% - 28px)); max-height: 88vh; padding: 0; border: 0; border-radius: 26px; color: var(--ink); box-shadow: 0 30px 90px rgba(10,35,50,.28); }
dialog::backdrop { background: rgba(8,29,42,.55); backdrop-filter: blur(3px); }
.dialog-close { position: absolute; right: 16px; top: 13px; z-index: 2; width: 38px; height: 38px; border: 0; border-radius: 50%; background: #edf2f3; cursor: pointer; font-size: 24px; }
.dialog-content { padding: 38px; }
.dialog-content h3 { margin: 5px 45px 10px 0; font-family: Georgia, serif; font-size: 34px; line-height: 1.05; }
.dialog-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 26px 0; }
.dialog-grid div { padding: 14px; border-radius: 14px; background: #f3f7f7; }
.dialog-grid span, .dialog-grid strong { display: block; }
.dialog-grid span { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.dialog-grid strong { margin-top: 5px; font-size: 13px; }
.dialog-note { padding: 16px; border-left: 3px solid var(--lime); background: #f7faed; font-size: 13px; }
.dialog-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.dialog-subtitle { margin: 24px 0 8px; color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.dialog-status { margin: 22px 0; font-size: 15px; font-weight: 700; }
.dialog-events { margin: 0 0 20px; padding: 0; list-style: none; }
.dialog-events li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.dialog-events li:last-child { border-bottom: 0; }

footer { display: flex; justify-content: space-between; gap: 30px; padding: 34px clamp(20px, 5vw, 76px); color: #a9bbc5; background: var(--ink); font-size: 12px; }
footer p { margin: 0; }

@media (max-width: 900px) {
  .ice-orbit { opacity: .28; right: -35px; }
  .filters { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .schedule-card { grid-template-columns: 90px 1fr auto; }
  .schedule-card .source-meta { grid-column: 2; }
  .schedule-card .card-actions { grid-column: 3; grid-row: 1 / 3; }
  .map-view { grid-template-columns: 245px minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .site-header { height: 68px; padding: 0 16px; }
  .header-link { font-size: 11px; }
  .hero { min-height: auto; padding: 14px 20px 15px; }
  .hero h1 { font-size: 38px; }
  .hero-lede { margin-top: 10px; font-size: 14px; }
  .ice-orbit { display: none; }
  .stats { display: none; }
  .stats div { min-width: 0; flex: 1; padding: 12px; }
  .stats strong { font-size: 22px; }
  .workspace { padding: 20px 14px 70px; }
  .workspace-heading .eyebrow { display: none; }
  .workspace-heading { display: block; }
  .view-switch { margin-top: 16px; width: 100%; }
  .view-button { flex: 1; padding: 10px 6px; font-size: 12px; }
  .filters { grid-template-columns: 1fr 1fr; padding: 12px; margin-top: 16px; }
  .search-field { grid-column: auto; }
  .filters .search-field { grid-column: 1 / -1; }
  .filter-toggle { display: block; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--blue-dark); cursor: pointer; font-weight: 750; }
  .filters:not(.expanded) :is(#regionField, #activityField, #timeField) { display: none; }
  .filters.expanded :is(#regionField, #activityField, #timeField) { grid-column: 1 / -1; }
  .filters .primary-button { grid-column: 2; }
  .date-strip { margin: 0 -14px; padding: 5px 14px 10px; }
  .date-button { min-width: 82px; padding: 8px 10px; }
  .map-intro::after { content: " · листайте вбок →"; }
  .schedule-card { grid-template-columns: 72px minmax(0, 1fr); gap: 10px 12px; padding: 14px; }
  .schedule-card .source-meta { grid-column: 2; }
  .schedule-card .card-actions { grid-column: 1 / -1; grid-row: auto; display: flex; align-items: center; gap: 16px; }
  .schedule-card .card-action { flex: 1; }
  .map-view { grid-template-columns: 1fr; }
  .map-list { display: flex; gap: 7px; max-height: none; overflow-x: auto; }
  .map-place { flex: 0 0 220px; }
  .yandex-map { min-height: 370px; }
  .rink-card { grid-template-columns: 1fr; gap: 14px; padding: 18px; }
  .rink-day-card { padding: 14px; }
  .session-row { grid-template-columns: 1fr; }
  .rink-day-foot .card-action { width: 100%; }
  .channel-cta { padding: 16px; }
  .channel-links { width: 100%; }
  .channel-links .card-action { flex: 1; }
  .result-head { display: block; }
  .freshness-note { margin-top: 7px !important; }
  .dialog-content { padding: 30px 20px; }
  .dialog-grid { grid-template-columns: 1fr; }
  footer { display: block; }
  footer p + p { margin-top: 8px; }
}
.rink-phone { display: inline-block; margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--blue); text-decoration: none; }
.rink-phone:hover { text-decoration: underline; }
