@font-face {
  font-family: Kelson;
  src: url('/fonts/Kelson-Sans-Regular.ttf') format('truetype');
  font-display: swap
}

@font-face {
  font-family: Xirod;
  src: url('/fonts/AA-Xirod-Regular.ttf') format('truetype');
  font-display: swap
}

:root {
  --yellow: #ffd400;
  --yellow-2: #ffea70;
  --bg: #07080a;
  --surface: #111318;
  --surface-2: #171a20;
  --text: #f6f4ea;
  --muted: #96989f;
  --line: rgba(255, 212, 0, .2);
  --danger: #ff5d62;
  --success: #76e6a2;
  --shadow: 0 24px 80px rgba(0, 0, 0, .34);
  --radius: 18px;
  --max: 1440px;
  color-scheme: dark
}

html[data-theme=light] {
  --bg: #f4f2e9;
  --surface: #fff;
  --surface-2: #eceae1;
  --text: #111216;
  --muted: #66686e;
  --line: rgba(126, 102, 0, .22);
  --shadow: 0 24px 70px rgba(33, 30, 15, .12);
  color-scheme: light
}

* {
  box-sizing: border-box
}

html {
  scroll-behavior: smooth
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 Kelson, system-ui, sans-serif;
  transition: background .25s, color .25s
}

a {
  color: inherit;
  text-decoration: none
}

img {
  max-width: 100%
}

button,
input,
select,
textarea {
  font: inherit
}

.space {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
  background: radial-gradient(circle at 74% 14%, rgba(255, 212, 0, .08), transparent 27%), linear-gradient(135deg, transparent 0 49.8%, rgba(255, 212, 0, .035) 50%, transparent 50.2%)
}

.space i {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 10vw 12vh var(--yellow), 23vw 72vh #fff, 39vw 22vh #fff, 57vw 63vh var(--yellow), 74vw 32vh #fff, 91vw 82vh var(--yellow), 5vw 90vh #fff, 68vw 92vh #fff;
  opacity: .45
}

.space i:nth-child(2) {
  left: 13%;
  top: 34%;
  transform: scale(.6) rotate(28deg)
}

.space i:nth-child(3) {
  left: 31%;
  top: 7%;
  transform: scale(1.4) rotate(67deg)
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 34px;
  width: min(calc(100% - 32px), var(--max));
  margin: 16px auto;
  padding: 12px 14px 12px 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .14)
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: auto
}

.brand img {
  width: 76px;
  height: auto
}

.brand span {
  font-size: 10px;
  line-height: 1.05;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted)
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 5px
}

.site-nav a {
  padding: 10px 13px;
  border-radius: 10px;
  color: var(--muted);
  transition: .2s
}

.site-nav a:hover {
  background: var(--surface-2);
  color: var(--yellow)
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 9px
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: 700
}

.button:hover {
  transform: translateY(-1px);
  border-color: var(--yellow)
}

.button-primary {
  border-color: var(--yellow);
  background: var(--yellow);
  color: #111
}

.button-danger {
  border-color: rgba(255, 93, 98, .4);
  color: var(--danger)
}

.theme-toggle,
.nav-toggle {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--yellow);
  cursor: pointer
}

.nav-toggle {
  display: none
}

.account-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 10px 5px 5px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface)
}

.account-chip b {
  font: 8px Xirod;
  color: var(--yellow)
}

.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border-radius: 9px;
  background: var(--yellow);
  color: #111;
  font-weight: 800
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover
}

main,
.page-shell {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto 64px
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr);
  gap: 16px;
  padding: 70px 0 34px
}

.hero-copy {
  padding: 30px 0
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--yellow);
  font: 12px Xirod;
  letter-spacing: .14em;
  text-transform: uppercase
}

.hero h1,
.page-title {
  max-width: 950px;
  margin: 0;
  font: clamp(42px, 7vw, 104px)/.94 Xirod;
  letter-spacing: -.05em;
  text-transform: uppercase
}

.hero h1 em {
  color: var(--yellow);
  font-style: normal
}

.hero-copy>p:not(.eyebrow) {
  max-width: 660px;
  margin: 28px 0;
  color: var(--muted);
  font-size: 20px
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap
}

.signal-card {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--surface);
  box-shadow: var(--shadow)
}

.signal-card:before {
  content: "";
  position: absolute;
  inset: 10%;
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: 0 0 80px rgba(255, 212, 0, .13)
}

.signal-orbit {
  position: absolute;
  inset: 18%;
  border: 2px dashed rgba(255, 212, 0, .24);
  border-radius: 50%;
  animation: orbit 25s linear infinite
}

.signal-core {
  position: absolute;
  inset: 38%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 70px rgba(255, 212, 0, .45);
  color: #111;
  font: 22px Xirod
}

.signal-meta {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 22px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .12em
}

@keyframes orbit {
  to {
    transform: rotate(360deg)
  }
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
  gap: 16px
}

.panel,
.card {
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  background: var(--surface) !important;
  color: var(--text) !important;
  box-shadow: none !important
}

.panel {
  padding: 18px
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px
}

.panel-head h2 {
  margin: 0;
  font: 18px Xirod;
  text-transform: uppercase
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase
}

.status:before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 12px var(--success)
}

.video-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/9;
  border-radius: 12px;
  background: #000
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  border: 0
}

.chat-frame {
  width: 100%;
  height: 100%;
  min-height: 360px;
  border: 0;
  border-radius: 12px;
  background: var(--surface-2)
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px
}

.stat {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px
}

.stat b {
  display: block;
  color: var(--yellow);
  font: 24px Xirod
}

.stat span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase
}

.content-header {
  padding: 58px 0 30px
}

.content-header .page-title {
  font-size: clamp(36px, 6vw, 74px)
}

.content-header p {
  max-width: 700px;
  color: var(--muted);
  font-size: 18px
}

.profile-grid,
.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px
}

.stack {
  display: grid;
  gap: 16px
}

.field {
  display: grid;
  gap: 7px
}

.field label {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em
}

.field input,
.field select,
.field textarea,
.form-control,
.form-select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line) !important;
  border-radius: 11px !important;
  background: var(--surface-2) !important;
  color: var(--text) !important
}

.form-hint {
  color: var(--muted);
  font-size: 13px
}

.identity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px
}

.identity strong {
  display: block
}

.identity small {
  color: var(--muted)
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius)
}

table,
.table {
  width: 100%;
  margin: 0 !important;
  border-collapse: collapse;
  color: var(--text) !important
}

th,
td {
  padding: 14px 16px !important;
  border-bottom: 1px solid var(--line) !important;
  background: transparent !important;
  color: inherit !important;
  text-align: left
}

th {
  color: var(--yellow) !important;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em
}

.rank {
  color: var(--yellow);
  font: 18px Xirod
}

.current-row {
  background: rgba(255, 212, 0, .07) !important
}

.badge {
  background: var(--yellow) !important;
  color: #111 !important
}

.alert,
.toast {
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text)
}

.toast {
  position: fixed;
  z-index: 300;
  top: 92px;
  right: 24px;
  max-width: 380px;
  box-shadow: var(--shadow)
}

.toast-error {
  border-color: rgba(255, 93, 98, .55)
}

.toast-success {
  border-color: rgba(118, 230, 162, .55)
}

.dialog {
  width: min(520px, calc(100% - 24px));
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow)
}

.dialog::backdrop {
  background: rgba(0, 0, 0, .74);
  backdrop-filter: blur(6px)
}

.dialog h2 {
  margin: 0;
  font: 26px Xirod;
  text-transform: uppercase
}

.dialog-close {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 24px;
  cursor: pointer
}

.auth-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 24px 0
}

.auth-button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 18px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  cursor: pointer
}

.auth-button small {
  font-size: 12px;
  font-weight: 400;
  opacity: .75
}

.auth-vk {
  background: #2787f5
}

.auth-tg {
  background: #229ed9
}

.auth-button:disabled {
  filter: grayscale(1);
  cursor: not-allowed;
  opacity: .45
}

.site-footer {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 32px;
  align-items: start;
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
  padding: 34px 0 26px;
  border-top: 1px solid var(--line);
  color: var(--muted)
}

.site-footer img {
  width: 72px
}

.site-footer p {
  max-width: 300px
}

.site-footer nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px
}

.site-footer a:hover {
  color: var(--yellow)
}

.site-footer small {
  grid-column: 1/-1
}

.social-row {
  display: flex;
  gap: 8px
}

.social-row a {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--yellow)
}

/* Compatibility layer for existing content editors */
.container-fluid,
.container {
  width: min(calc(100% - 32px), var(--max));
  margin-inline: auto
}

.navbar {
  display: none !important
}

.modal-content,
.dropdown-menu {
  background: var(--surface) !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important
}

.modal-header,
.modal-footer {
  border-color: var(--line) !important
}

.btn-warning,
.bg-warning {
  background: var(--yellow) !important;
  color: #111 !important;
  border-color: var(--yellow) !important
}

.text-muted {
  color: var(--muted) !important
}

.alert-warning {
  background: var(--surface) !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important
}

.card-header {
  background: var(--surface-2) !important;
  color: var(--yellow) !important
}

.row {
  --bs-gutter-x: 1rem
}

@media(max-width:900px) {
  .site-header {
    gap: 10px
  }

  .brand span {
    display: none
  }

  .nav-toggle {
    display: block;
    order: 2
  }

  .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    display: none;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow)
  }

  .site-nav.is-open {
    display: grid
  }

  .header-actions {
    order: 1
  }

  .hero,
  .dashboard-grid,
  .profile-grid,
  .admin-grid {
    grid-template-columns: 1fr
  }

  .signal-card {
    min-height: 320px
  }

  .site-footer {
    grid-template-columns: 1fr 1fr
  }

  .social-row {
    justify-content: flex-start
  }
}

@media(max-width:560px) {
  .site-header {
    width: calc(100% - 16px);
    margin: 8px auto;
    padding: 9px
  }

  .brand img {
    width: 62px
  }

  .account-chip>span:nth-child(2),
  .account-chip b {
    display: none
  }

  .hero {
    padding-top: 35px
  }

  .hero h1 {
    font-size: 40px
  }

  .hero-copy>p:not(.eyebrow) {
    font-size: 17px
  }

  .signal-card {
    min-height: 280px
  }

  .stats {
    grid-template-columns: 1fr
  }

  .auth-options {
    grid-template-columns: 1fr
  }

  .site-footer {
    grid-template-columns: 1fr
  }

  .site-footer nav {
    grid-template-columns: 1fr 1fr
  }
}

@media(prefers-reduced-motion:reduce) {
  * {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important
  }
}

.database-error {
  min-height: 100vh;
  align-items: center
}

.database-help {
  max-width: 720px;
  margin: 24px 0
}

.database-help p {
  margin: 0;
  color: var(--muted);
  font-size: 15px
}

.database-help code {
  padding: .15em .4em;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--yellow)
}

/* Editorial pages */
.home-main {
  padding-top: 34px
}

.broadcast-grid {
  min-height: auto; /* Позволяем контенту задавать высоту */
  align-items: stretch; /* Правая колонка будет растягиваться под высоту левой */
}

.broadcast-panel,
.chat-panel {
  display: flex;
  flex-direction: column;
  padding: 22px
}

.broadcast-panel .panel-head h1,
.chat-panel .panel-head h2 {
  margin: 0;
  font: 1.2vw Xirod;
  text-transform: uppercase
}

.broadcast-panel .video-frame {
  flex: 0 0 auto; /* Запрещаем растягиваться по высоте */
  width: 100%;
  aspect-ratio: 16 / 9; /* Жестко фиксируем пропорции */
}

.chat-panel .chat-frame {
  flex: 1;
  min-height: 420px
}

.panel-head .eyebrow {
  margin-bottom: 8px
}

.about-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  gap: 18px;
  padding: 76px 0 84px
}

.about-intro {
  padding: 30px 0
}

.about-intro h1 {
  max-width: 980px;
  margin: 0;
  font: clamp(46px, 7vw, 72px)/.94 Xirod;
  letter-spacing: -.055em;
  text-transform: uppercase
}

.about-intro h1 em {
  color: var(--yellow);
  font-style: normal
}

.about-intro>p:not(.eyebrow) {
  max-width: 760px;
  margin: 28px 0;
  color: var(--muted);
  font-size: 21px
}

.about-manifesto {
  display: grid;
  grid-template-columns: 56px 1fr;
  align-content: center;
  gap: 8px 16px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface)
}

.about-manifesto>span {
  grid-row: span 2;
  color: var(--yellow);
  font: 22px Xirod
}

.about-manifesto strong {
  font: 16px Xirod;
  text-transform: uppercase
}

.about-manifesto p {
  margin: 0 0 22px;
  color: var(--muted)
}

.history-section {
  padding-bottom: 70px
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px
}

.section-heading h2 {
  margin: 0;
  font: clamp(32px, 5vw, 68px)/1 Xirod;
  text-transform: uppercase
}

.timeline {
  border-top: 1px solid var(--line)
}

.timeline-year {
  display: grid;
  grid-template-columns: 190px 1fr;
  border-bottom: 1px solid var(--line)
}

.timeline-year-label {
  position: relative;
  padding: 30px 20px 30px 0
}

.timeline-year-label span {
  position: sticky;
  top: 110px;
  color: var(--yellow);
  font: 3vh/1 Xirod
}

.timeline-events {
  padding: 18px 0;
  border-left: 1px solid var(--line)
}

.timeline-event {
  position: relative;
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 20px;
  padding: 24px 30px
}

.timeline-event:before {
  content: "";
  position: absolute;
  left: -6px;
  top: 34px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 18px rgba(255, 212, 0, .6)
}

.timeline-date {
  color: var(--yellow);
  text-transform: uppercase;
  letter-spacing: .1em
}

.timeline-event h3 {
  margin: 0 0 8px;
  font: 20px Xirod;
  text-transform: uppercase
}

.timeline-event p {
  max-width: 760px;
  margin: 0;
  color: var(--muted)
}

.editor-actions,
.project-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px
}

.editor-actions .button,
.project-actions .button {
  min-height: 38px;
  padding: 0 13px;
  font-size: 13px
}

.editor-dialog {
  width: min(680px, calc(100% - 24px))
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px
}

.projects-header {
  position: relative
}

.projects-header .button {
  margin-top: 12px
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding-bottom: 70px
}

.project-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  transition: transform .25s, border-color .25s
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 212, 0, .55)
}

.project-media {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: #050505
}

.project-media:after {
  content: "";
  position: absolute;
  inset: 45% 0 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, .72))
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s
}

.project-card:hover .project-media img {
  transform: scale(1.035)
}

.project-status,
.project-year {
  position: absolute;
  z-index: 1;
  top: 14px;
  padding: 6px 9px;
  border-radius: 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em
}

.project-status {
  left: 14px;
  background: var(--yellow);
  color: #111
}

.project-year {
  right: 14px;
  background: rgba(0, 0, 0, .68);
  color: #fff
}

.project-body {
  padding: 22px
}

.project-body h2 {
  margin: 0 0 12px;
  font: 21px Xirod;
  text-transform: uppercase
}

.project-body p {
  min-height: 72px;
  margin: 0;
  color: var(--muted)
}

.schedule-header {
  padding-bottom: 22px
}

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px
}

.day-chip {
  display: grid;
  place-items: center;
  padding: 13px 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--muted);
  transition: .2s
}

.day-chip span {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .12em
}

.day-chip strong {
  color: var(--text);
  font: 25px Xirod
}

.day-chip small {
  font-size: 11px
}

.day-chip:hover,
.day-chip.is-active {
  border-color: var(--yellow);
  background: var(--yellow);
  color: #111
}

.day-chip.is-active strong {
  color: #111
}

.day-chip.is-today:not(.is-active) {
  box-shadow: inset 0 -3px var(--yellow)
}

.schedule-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 24px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface)
}

.schedule-toolbar>div {
  text-align: center
}

.schedule-toolbar strong,
.schedule-toolbar span {
  display: block
}

.schedule-toolbar span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase
}

.schedule-list {
  position: relative;
  display: grid;
  gap: 10px;
  padding-left: 0
}

.schedule-item {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px 20px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
}

/* Время не сжимается, имеет минимальную ширину и не переносится на новую строку */
.schedule-item time {
    color: var(--yellow);
    font: 22px Xirod;
    flex-shrink: 0;
    min-width: 74px; /* Используем min-width вместо width */
    white-space: nowrap; /* Запрещаем перенос текста */
}

/* Картинка тоже не сжимается */
.schedule-item > img {
    flex-shrink: 0;
    width: 92px;
    height: 64px;
    border-radius: 10px;
    object-fit: cover;
}

.schedule-item > .editor-actions {
    flex-shrink: 0;
    margin-left: auto;
}

.schedule-copy {
    flex: 1;
    min-width: 0;
}

.schedule-copy span {
  color: var(--yellow);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em
}

.schedule-copy h2 {
  margin: 3px 0;
  font: 18px Xirod;
  text-transform: uppercase
}

.schedule-copy p {
  margin: 5px 0 0;
  color: var(--muted)
}

.schedule-add {
  margin: 20px 0 70px
}

.empty-state {
  grid-column: 1/-1;
  padding: 54px 24px;
  border: 1px dashed var(--line);
  border-radius: 20px;
  text-align: center;
  color: var(--muted)
}

.empty-state strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font: 20px Xirod;
  text-transform: uppercase
}

.empty-state p {
  margin: 0
}

.social-row svg {
  width: 21px;
  height: 21px;
  fill: currentColor
}

.social-row a {
  transition: .2s
}

.social-row a:hover {
  border-color: var(--yellow);
  background: var(--yellow);
  color: #111;
  transform: translateY(-2px)
}

@media(max-width:1050px) {
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }

  .about-hero {
    grid-template-columns: 1fr
  }

  .about-manifesto {
    grid-template-columns: 52px 1fr
  }

 .schedule-item time { min-width: 68px; }
  .schedule-item > img { width: 76px; }
}

@media(max-width:700px) {
  .home-main {
    padding-top: 12px
  }

  .broadcast-grid {
    min-height: 0
  }

  .about-hero {
    padding: 38px 0 58px
  }

  .about-intro h1 {
    font-size: 40px
  }

  .about-intro>p:not(.eyebrow) {
    font-size: 17px
  }

  .timeline-year {
    grid-template-columns: 1fr
  }

  .timeline-year-label {
    padding: 26px 0 10px
  }

  .timeline-year-label span {
    position: static;
    font-size: 3vh
  }

  .timeline-events {
    border-left: 0
  }

  .timeline-event {
    grid-template-columns: 1fr;
    padding: 20px 0 24px 20px;
    border-left: 1px solid var(--line)
  }

  .timeline-event:before {
    left: -6px
  }

  .project-grid {
    grid-template-columns: 1fr
  }

  .form-grid {
    grid-template-columns: 1fr
  }

  .week-strip {
    display: flex;
    overflow-x: auto;
    padding-bottom: 5px
  }

  .day-chip {
    min-width: 78px
  }

  .schedule-toolbar {
    flex-wrap: wrap
  }

  .schedule-toolbar>div {
    order: -1;
    width: 100%
  }

  .schedule-toolbar .button {
    flex: 1;
    padding: 0 10px;
    font-size: 12px
  }

  .schedule-item { gap: 12px; }
  .schedule-item time { min-width: 58px; }
  .schedule-item > img { display: none; }

  .section-heading {
    align-items: start;
    flex-direction: column
  }
}

.error-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 32px
}

.error-card {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  gap: 34px;
  align-items: center;
  width: min(1100px, 100%);
  padding: clamp(28px, 5vw, 68px);
  border: 1px solid var(--line);
  border-radius: 32px;
  background: var(--surface);
  box-shadow: var(--shadow)
}

.error-copy h1 {
  max-width: 760px;
  margin: 0;
  font: clamp(38px, 6vw, 82px)/.96 Xirod;
  text-transform: uppercase
}

.error-copy>p:not(.eyebrow) {
  max-width: 650px;
  margin: 24px 0;
  color: var(--muted);
  font-size: 19px
}

.error-visual {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 212, 0, .18), transparent 65%)
}

.error-visual strong {
  color: var(--yellow);
  font: clamp(48px, 8vw, 100px)/1 Xirod
}

.error-visual span {
  position: absolute;
  bottom: 16%;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .18em
}

.error-orbit {
  position: absolute;
  inset: 9%;
  border: 1px dashed var(--yellow);
  border-radius: 50%;
  animation: orbit 20s linear infinite
}

@media(max-width:720px) {
  .error-page {
    padding: 12px
  }

  .error-card {
    grid-template-columns: 1fr;
    padding: 28px
  }

  .error-visual {
    max-width: 280px;
    width: 100%;
    margin: auto
  }
}

/* Administration, previews, live schedule and resilient service pages */
.admin-section {
  margin-top: 16px
}

.project-image-picker {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  align-items: center
}

.project-image-picker img {
  width: 140px;
  aspect-ratio: 16/10;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #050505
}

.schedule-item.is-live {
  border-color: var(--yellow);
  box-shadow: inset 3px 0 var(--yellow)
}

.live-badge {
  display: inline-block;
  margin-right: 8px;
  padding: 4px 7px;
  border-radius: 6px;
  background: var(--yellow);
  color: #111;
  font-size: 10px;
  letter-spacing: .08em
}

.footer-brand {
  display: grid;
  gap: 10px
}

.site-footer {
  padding-top: 42px
}

.site-footer nav a {
  padding: 3px 0
}

.maintenance-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px
}

.maintenance-card {
  display: grid;
  grid-template-columns: 180px minmax(0, 680px);
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  width: min(980px, 100%);
  padding: clamp(28px, 6vw, 72px);
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--surface);
  box-shadow: var(--shadow)
}

.maintenance-card h1 {
  margin: 0;
  font: clamp(30px, 5vw, 64px)/1 Xirod;
  text-transform: uppercase
}

.maintenance-card p:not(.eyebrow) {
  max-width: 620px;
  margin: 22px 0;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 20px);
  overflow-wrap: anywhere
}

.maintenance-icon {
  display: grid;
  place-items: center;
  width: 180px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 212, 0, .2), transparent 66%)
}

.maintenance-icon span {
  color: var(--yellow);
  font: 34px Xirod;
  letter-spacing: .12em
}

@media(max-width:700px) {
  .project-image-picker {
    grid-template-columns: 1fr
  }

  .project-image-picker img {
    width: 100%;
    max-width: 260px
  }

  .maintenance-card {
    grid-template-columns: 1fr;
    text-align: center
  }

  .maintenance-icon {
    width: 120px;
    margin: auto
  }

  .maintenance-card .button {
    margin: auto
  }

  .footer-brand {
    justify-items: start
  }
}

/* Mobile navigation, wide-display typography and regional auth states */
.nav-toggle {
  position: relative;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 0
}

.nav-toggle span {
  display: block;
  width: 21px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .2s, opacity .2s
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg)
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg)
}

.auth-button:disabled,
.auth-button[aria-disabled="true"],
body[data-telegram-allowed="0"] .auth-tg {
  background: #5f6268 !important;
  color: #d4d5d7 !important;
  filter: none !important;
  opacity: .62 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  box-shadow: none !important
}

.hero h1,
.page-title,
.about-intro h1,
.error-copy h1,
.maintenance-card h1,
.section-heading h2,
.dialog h2,
.project-body h2,
.schedule-copy h2,
.panel-head h1,
.panel-head h2 {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
  letter-spacing: -.025em
}

.hero h1,
.page-title {
  font-size: clamp(34px, 5.2vw, 78px);
  line-height: 1.02
}

.content-header .page-title {
  font-size: clamp(32px, 4.6vw, 64px)
}

.about-intro h1 {
  font-size: 4vw;
  line-height: 1.02
}

.error-copy h1 {
  font-size: clamp(32px, 4.6vw, 58px);
  line-height: 1.04
}

.maintenance-card h1 {
  font-size: clamp(29px, 4.2vw, 52px);
  line-height: 1.05
}

.section-heading h2 {
  font-size: clamp(28px, 4vw, 52px)
}

.dialog h2 {
  font-size: clamp(21px, 2.6vw, 28px);
  line-height: 1.12
}

.project-body h2,
.schedule-copy h2 {
  font-size: clamp(15px, 1.5vw, 20px);
  line-height: 1.15
}

.empty-state strong {
  font-size: clamp(16px, 1.8vw, 20px)
}

@media(max-width:900px) {
  .nav-toggle {
    display: flex
  }

  .site-nav a {
    padding: 13px 14px;
    font-size: 17px
  }

  .site-nav.is-open {
    max-height: calc(100vh - 90px);
    overflow: auto
  }
}

@media(max-width:560px) {
  body {
    font-size: 15px
  }

  main,
  .page-shell {
    width: min(calc(100% - 20px), var(--max))
  }

  .site-header {
    gap: 7px
  }

  .brand {
    margin-right: auto
  }

  .theme-toggle,
  .nav-toggle {
    width: 40px;
    height: 40px
  }

  .header-actions {
    gap: 6px
  }

  .header-actions .button-primary {
    min-height: 40px;
    padding: 0 13px
  }

  .hero h1,
  .page-title,
  .content-header .page-title {
    font-size: clamp(28px, 9vw, 40px);
    line-height: 1.06
  }

  .about-intro h1 {
    font-size: clamp(29px, 9vw, 41px);
    line-height: 1.05
  }

  .error-copy h1,
  .maintenance-card h1 {
    font-size: clamp(27px, 8vw, 38px);
    line-height: 1.08
  }

  .error-copy>p:not(.eyebrow),
  .maintenance-card p:not(.eyebrow),
  .content-header p {
    font-size: 16px
  }

  .section-heading h2 {
    font-size: clamp(25px, 7.5vw, 34px)
  }

  .broadcast-panel .panel-head h1,
  .chat-panel .panel-head h2 {
    font-size: clamp(18px, 5.7vw, 25px)
  }

  .eyebrow {
    font-size: 10px;
    line-height: 1.4;
    letter-spacing: .1em
  }

  .panel,
  .broadcast-panel,
  .chat-panel {
    padding: 14px
  }

  .dialog {
    padding: 26px 18px
  }

  .dialog h2 {
    padding-right: 34px
  }

  .error-card {
    padding: 24px 18px;
    border-radius: 22px
  }

  .error-visual {
    max-width: 210px
  }

  .maintenance-card {
    padding: 26px 18px;
    border-radius: 22px
  }

  .site-footer {
    width: calc(100% - 20px);
    gap: 22px
  }

  .auth-button {
    font-size: 18px
  }
}

/* Project filtering, compact schedule navigation and responsive overflow guards */
.project-browser {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 18px
}

.project-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px
}

.project-filter,
.project-page {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: 700
}

.project-filter:hover,
.project-filter.is-active,
.project-page:hover,
.project-page.is-active {
  border-color: var(--yellow);
  background: var(--yellow);
  color: #111
}

.project-results {
  margin: 0;
  color: var(--muted);
  white-space: nowrap
}

.project-grid[data-project-grid] {
  padding-bottom: 0
}

.project-card[hidden] {
  display: none !important
}

.project-grid.is-empty-filter:after {
  content: "В этой категории пока нет проектов";
  grid-column: 1/-1;
  padding: 48px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center
}

.project-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 12px 0 24px
}

.project-pages {
  display: flex;
  gap: 7px
}

.project-page {
  min-width: 42px;
  padding: 0 10px
}

.project-page-arrow:disabled {
  opacity: .35;
  pointer-events: none
}

.schedule-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px
}

.schedule-date-picker {
  position: relative;
  display: grid;
  justify-items: end;
  min-width: 210px;
  cursor: pointer
}

.schedule-date-label {
  color: var(--text);
  font: clamp(20px, 2.2vw, 30px) Xirod
}

.schedule-date-picker input {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer
}

.schedule-date-picker small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px
}

.schedule-list {
  margin-top: 24px
}

.week-strip {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 52px;
  align-items: stretch;
  gap: 10px
}

.week-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  min-width: 0
}

.week-arrow {
  display: grid;
  place-items: center;
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--yellow);
  font-size: 24px;
  font-weight: 800
}

.week-arrow:hover {
  border-color: var(--yellow);
  transform: translateY(-1px)
}

.video-placeholder {
  display: grid;
  place-content: center;
  height: 100%;
  padding: 24px;
  text-align: center
}

.video-placeholder strong {
  font: clamp(18px, 2.2vw, 28px) Xirod;
  overflow-wrap: anywhere
}

.video-placeholder p {
  max-width: 520px;
  margin: 12px auto 0;
  color: var(--muted)
}

.panel,
.content-header,
.project-card,
.schedule-item,
.identity,
.field,
.table-wrap {
  min-width: 0
}

.project-body p,
.schedule-copy p,
.identity span,
.field small,
.form-hint {
  overflow-wrap: anywhere
}

.field input,
.field select,
.field textarea {
  max-width: 100%
}

@media(max-width:900px) {
  .project-browser {
    align-items: flex-start;
    flex-direction: column
  }

  .project-results {
    white-space: normal
  }

  .week-strip {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 7px
  }

  .week-days {
    gap: 7px
  }

  .day-chip {
    min-width: 0;
    padding-inline: 6px
  }

  .day-chip small {
    font-size: 10px
  }
}

@media(max-width:700px) {
  .project-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%
  }

  .project-filter {
    padding: 0 10px
  }

  .project-grid {
    display: block
  }

  .project-card:not([hidden]) {
    display: block;
    width: 100%
  }

  .project-pagination {
    justify-content: space-between;
    margin-top: 10px
  }

  .project-pages {
    display: none
  }

  .project-page-arrow {
    width: 58px;
    padding: 0
  }

  .schedule-heading-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px
  }

  .schedule-date-picker {
    justify-items: start;
    min-width: 0
  }

  .week-strip {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    overflow: visible
  }

  .week-days {
    display: flex;
    overflow-x: auto;
    scrollbar-width: thin;
    padding-bottom: 5px
  }

  .day-chip {
    flex: 0 0 76px
  }

  .week-arrow {
    min-height: 72px
  }

  .schedule-item {
    overflow: hidden
  }

  .schedule-copy h2 {
    font-size: clamp(15px, 5vw, 20px)
  }

  .admin-grid,
  .dashboard-grid,
  .broadcast-grid {
    grid-template-columns: minmax(0, 1fr)
  }

  .panel-head {
    min-width: 0
  }

  .table-wrap {
    overflow-x: auto
  }

  .identity {
    gap: 10px
  }

  .identity span {
    min-width: 0
  }
}

@media(max-width:420px) {
  .project-filters {
    grid-template-columns: 1fr
  }

  .week-strip {
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    gap: 5px
  }

  .day-chip {
    flex-basis: 70px
  }

 .schedule-item { gap: 8px; }
  .schedule-item time { min-width: 48px; font-size: 18px; } 

  .schedule-date-label {
    font-size: 19px
  }

  .account-chip>span:nth-child(2),
  .account-chip b {
    display: none
  }
}

/* Search, one-click schedule picker and cosmic page loading screen */
body.is-loading {
  overflow: hidden
}

.page-preloader {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 28px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 45%, rgba(255, 221, 0, .12), transparent 24%), radial-gradient(circle at 20% 20%, rgba(91, 118, 255, .16), transparent 26%), #07080c;
  color: #fff;
  opacity: 1;
  visibility: visible;
  transition: opacity .55s ease, visibility .55s ease
}

.page-preloader:before,
.page-preloader:after {
  content: "";
  position: absolute;
  inset: -50%;
  background-image: radial-gradient(circle, #fff 0 1px, transparent 1.5px);
  background-size: 54px 54px;
  opacity: .22;
  animation: preloader-stars 12s linear infinite
}

.page-preloader:after {
  background-size: 93px 93px;
  opacity: .12;
  animation-duration: 20s;
  animation-direction: reverse
}

.page-preloader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none
}

.page-preloader p {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0 20px;
  color: #f5f5f7;
  font: clamp(14px, 2vw, 20px) Xirod;
  text-align: center;
  letter-spacing: .04em
}

.preloader-orbit {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: clamp(150px, 24vw, 230px);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 50%;
  box-shadow: 0 0 80px rgba(255, 221, 0, .09)
}

.preloader-orbit:before,
.preloader-orbit:after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 221, 0, .25);
  border-radius: 50%;
  inset: 14%;
  animation: preloader-spin 3.4s linear infinite
}

.preloader-orbit:after {
  inset: 2% 26%;
  border-color: rgba(112, 139, 255, .34);
  animation-duration: 2.5s;
  animation-direction: reverse
}

.preloader-orbit img {
  width: 58%;
  height: auto;
  filter: drop-shadow(0 0 22px rgba(255, 221, 0, .28));
  animation: preloader-pulse 1.8s ease-in-out infinite
}

.preloader-orbit span {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 16px var(--yellow);
  animation: preloader-float 2s ease-in-out infinite
}

.preloader-orbit span:nth-child(1) {
  top: 4%;
  left: 48%
}

.preloader-orbit span:nth-child(2) {
  right: 9%;
  bottom: 22%;
  animation-delay: -.7s;
  background: #8297ff;
  box-shadow: 0 0 16px #8297ff
}

.preloader-orbit span:nth-child(3) {
  left: 8%;
  bottom: 27%;
  animation-delay: -1.3s
}

.project-browser {
  display: grid;
  align-items: stretch
}

.project-browser-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px
}

.project-search {
  position: relative;
  display: block;
  width: min(100%, 520px)
}

.project-search input {
  width: 100%;
  min-height: 48px;
  padding: 0 48px 0 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--text);
  font: inherit
}

.project-search input:focus {
  outline: 2px solid color-mix(in srgb, var(--yellow) 65%, transparent);
  border-color: var(--yellow)
}

.project-search>span:last-child {
  position: absolute;
  top: 50%;
  right: 16px;
  color: var(--yellow);
  font-size: 24px;
  transform: translateY(-52%);
  pointer-events: none
}

.schedule-date-picker {
  position: relative;
  display: grid;
  justify-items: end;
  min-width: 210px
}

.schedule-date-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer
}

.schedule-date-trigger>span:last-child {
  color: var(--yellow);
  font-size: 24px;
  transition: transform .2s ease
}

.schedule-date-trigger[aria-expanded="true"]>span:last-child {
  transform: rotate(180deg)
}

.schedule-date-picker input {
  position: static;
  inset: auto;
  width: auto;
  height: auto;
  margin-top: 8px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  opacity: 1;
  cursor: pointer
}

.schedule-date-picker input[hidden] {
  display: none
}

.schedule-date-picker small {
  grid-row: auto
}

.project-grid.is-empty-filter:after {
  content: attr(data-empty-message)
}

@keyframes preloader-spin {
  to {
    transform: rotate(1turn)
  }
}

@keyframes preloader-pulse {
  50% {
    transform: scale(1.05);
    filter: drop-shadow(0 0 34px rgba(255, 221, 0, .48))
  }
}

@keyframes preloader-float {
  50% {
    transform: scale(1.65);
    opacity: .55
  }
}

@keyframes preloader-stars {
  to {
    transform: translate3d(54px, 54px, 0)
  }
}

@media(max-width:900px) {
  .project-browser-row {
    align-items: flex-start;
    flex-direction: column;
    width: 100%
  }

  .project-search {
    width: 100%
  }
}

@media(max-width:700px) {
  .schedule-date-picker {
    justify-items: start
  }

  .project-browser {
    gap: 12px
  }

  .project-browser-row {
    gap: 12px
  }

  .page-preloader {
    gap: 20px
  }

  .preloader-orbit {
    width: 150px
  }

  .page-preloader p {
    font-size: 13px;
    line-height: 1.5
  }
}

@media(prefers-reduced-motion:reduce) {

  .page-preloader:before,
  .page-preloader:after,
  .preloader-orbit:before,
  .preloader-orbit:after,
  .preloader-orbit img,
  .preloader-orbit span {
    animation: none
  }
}
/* === Broadcast indicator for week strip day chips === */
.day-chip {
  position: relative
}

.day-chip[data-has-broadcast="1"]::after {
  content: "";
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 8px rgba(255, 212, 0, .7);
  pointer-events: none;
  z-index: 1
}

.day-chip.is-active[data-has-broadcast="1"]::after {
  background: #111;
  box-shadow: none
}

.day-chip.is-today:not(.is-active)[data-has-broadcast="1"]::after {
  background: var(--yellow)
}

@media(max-width:900px) {
  .day-chip[data-has-broadcast="1"]::after {
    top: 6px;
    right: 6px;
    width: 7px;
    height: 7px
  }
}

@media(max-width:420px) {
  .day-chip[data-has-broadcast="1"]::after {
    top: 5px;
    right: 5px;
    width: 6px;
    height: 6px
  }
}

/* Copy button feedback */
.button.is-copied {
  border-color: var(--success);
  color: var(--success);
}
.button.is-copy-error {
  border-color: var(--danger);
  color: var(--danger);
}

/* === Home lower grid: releases + upcoming === */
.home-lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr);
  gap: 16px;
  margin-top: 16px;
}

.releases-panel,
.upcoming-panel {
  display: flex;
  flex-direction: column;
}

.releases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.release-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 150px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  font: inherit;
  transition: border-color .2s, transform .2s;
}

.release-card:hover:not(.is-empty) {
  border-color: var(--yellow);
  transform: translateY(-2px);
}

.release-link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  color: var(--text);
}

.release-badge {
  display: inline-block;
  width: fit-content;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--yellow);
  color: #111;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.release-link strong {
  margin-top: 4px;
  font: clamp(14px, 1.4vw, 17px) Xirod;
  line-height: 1.2;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.release-link small {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.release-open {
  margin-top: auto;
  color: var(--yellow);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.release-admin {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: flex;
  gap: 4px;
}

.release-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--yellow);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: .2s;
}

.release-icon:hover {
  border-color: var(--yellow);
  background: var(--yellow);
  color: #111;
}

.release-icon-danger { color: var(--danger); }
.release-icon-danger:hover {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}

.release-card.is-empty {
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-style: dashed;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

button.release-card.is-empty { cursor: pointer; }
button.release-card.is-empty:hover {
  border-color: var(--yellow);
  color: var(--yellow);
}

.release-plus {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--yellow);
  font-size: 22px;
  line-height: 1;
}

button.release-card.is-empty:hover .release-plus {
  border-color: var(--yellow);
  background: var(--yellow);
  color: #111;
}

.upcoming-list {
  display: grid;
  gap: 8px;
}

.upcoming-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.upcoming-item time {
  flex-shrink: 0;
  min-width: 58px;
  color: var(--yellow);
  font: 18px Xirod;
  white-space: nowrap;
}

.upcoming-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.upcoming-copy strong {
  font-size: 14px;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.upcoming-copy span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.upcoming-empty {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
}

.upcoming-empty strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
}

.upcoming-empty p {
  margin: 0;
  font-size: 13px;
}

.upcoming-more {
  margin-top: 12px;
  align-self: flex-start;
}

@media (max-width: 900px) {
  .home-lower-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .releases-grid { grid-template-columns: 1fr 1fr; }
  .release-card { min-height: 130px; padding: 12px; }
  .release-link strong { font-size: 13px; }
  .upcoming-item time { font-size: 16px; min-width: 48px; }
}

/* === Home lower grid: releases + upcoming (V2) === */
.home-lower-grid {
  display: grid;
  /* Выравниваем пропорции 1-в-1 с верхним dashboard-grid */
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.releases-panel,
.upcoming-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.releases-grid {
  display: flex;
  overflow-x: auto;
  gap: 12px;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

/* Скрываем скроллбар, если он не нужен, но оставляем функционал */
.releases-grid::-webkit-scrollbar {
  height: 6px;
}
.releases-grid::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 4px;
}

.release-card {
  position: relative;
  display: flex;
  flex-direction: column;
  /* Жесткая ширина для горизонтального скролла */
  flex: 0 0 200px;
  min-height: 180px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  font: inherit;
  scroll-snap-align: start;
  transition: border-color .2s, transform .2s;
}

.release-card:hover:not(.is-empty) {
  border-color: var(--yellow);
  transform: translateY(-2px);
}

/* Картинка превью */
.release-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  transition: transform .4s ease;
}

.release-card:hover .release-thumb {
  transform: scale(1.05);
}

/* Затемнение под текст */
.release-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
  z-index: 1;
  pointer-events: none;
}

.release-link {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  color: #fff; /* Для читаемости на фоне картинки */
}

.release-badge {
  display: inline-block;
  width: fit-content;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--yellow);
  color: #111;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.release-link strong {
  margin-top: auto; /* Прижимаем текст к низу */
  font: clamp(14px, 1.4vw, 16px) Xirod;
  line-height: 1.2;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.release-link small {
  color: #ccc;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.release-open {
  margin-top: 4px;
  color: var(--yellow);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.release-admin {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity .2s;
}

.release-card:hover .release-admin,
.release-card:focus-within .release-admin {
  opacity: 1;
}

@media (hover: none) {
  .release-admin { opacity: 1; }
}

.release-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 19, 24, 0.85);
  backdrop-filter: blur(4px);
  color: var(--yellow);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: .2s;
}

.release-icon:hover {
  border-color: var(--yellow);
  background: var(--yellow);
  color: #111;
}

.release-icon-danger { color: var(--danger); }
.release-icon-danger:hover {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}

.release-card.is-empty {
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-style: dashed;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: transparent;
}

button.release-card.is-empty { cursor: pointer; }
button.release-card.is-empty:hover {
  border-color: var(--yellow);
  color: var(--yellow);
  transform: translateY(-2px);
}

.release-plus {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--yellow);
  font-size: 22px;
  line-height: 1;
}

button.release-card.is-empty:hover .release-plus {
  border-color: var(--yellow);
  background: var(--yellow);
  color: #111;
}

/* Правая колонка (эфиры) */
.upcoming-date-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(255, 212, 0, 0.1);
  color: var(--yellow);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.upcoming-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1; /* Растягивает список на всю доступную высоту */
}

.upcoming-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.upcoming-item time {
  flex-shrink: 0;
  min-width: 58px;
  color: var(--yellow);
  font: 18px Xirod;
  white-space: nowrap;
}

.upcoming-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.upcoming-copy strong {
  font-size: 14px;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.upcoming-copy span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.upcoming-empty {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1; /* Растягивается, чтобы заполнить пустоту */
  min-height: 120px;
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
}

.upcoming-empty strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
}

.upcoming-empty p {
  margin: 0;
  font-size: 13px;
}

.upcoming-more {
  margin-top: 16px;
  width: 100%; /* Кнопка на всю ширину для аккуратности */
}

@media (max-width: 900px) {
  .home-lower-grid {
    grid-template-columns: 1fr;
  }
  .upcoming-empty {
    min-height: 80px;
  }
}

/* === Home lower grid: V3 Tweaks === */

/* 1. Дата эфира во всю ширину */
.upcoming-date-badge {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 0;
  margin-bottom: 12px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 212, 0, 0.1);
  color: var(--yellow);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-sizing: border-box;
}

/* 2. Карусель вместо скроллбара */
.releases-carousel {
  position: relative;
  display: flex;
  align-items: stretch; /* Растягиваем контент по высоте */
  flex: 1;
  min-height: 0;
}

.releases-grid {
  display: flex;
  overflow-x: auto;
  gap: 12px;
  padding-bottom: 0; /* Убрали отступ для скроллбара */
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  height: 100%;
}

.releases-grid::-webkit-scrollbar {
  display: none; /* Chrome/Safari/Opera */
}

/* 3. Растягивание плиток по высоте */
.release-card {
  flex: 0 0 210px; /* Фиксированная ширина */
  height: auto; /* Позволяет растягиваться по высоте родителя */
  min-height: 180px;
  scroll-snap-align: start;
}

/* Кнопки карусели */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--yellow);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: .2s;
}

.carousel-btn:hover {
  background: var(--yellow);
  color: #111;
  border-color: var(--yellow);
}

.carousel-prev { left: -12px; }
.carousel-next { right: -12px; }

/* Класс для скрытия кнопок */
.carousel-btn.is-hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

/* Защита от вылезания кнопок за пределы панели на мобилках */
@media (max-width: 1200px) {
  .carousel-prev { left: 0; }
  .carousel-next { right: 0; }
}

/* === V4: Live Status, Release Dates, Badges === */
.release-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.release-date {
  color: #ccc;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.live-badge {
  display: inline-block;
  margin-right: 6px;
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--yellow);
  color: #111;
  font-size: 10px;
  letter-spacing: .08em;
  vertical-align: middle;
}

.live-badge.is-hidden {
  display: none;
}

.upcoming-item.is-live {
  border-color: var(--yellow);
  box-shadow: inset 3px 0 var(--yellow);
}

/* === V5: UI Tweaks for Releases === */

/* 1. Уменьшаем шрифт заголовка */
.release-link strong {
  font-size: clamp(12px, 1.2vw, 14px);
  line-height: 1.25;
}

/* 2. Кнопка "Заменить" */
.release-replace-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--yellow);
  border-radius: 8px;
  background: rgba(17, 19, 24, 0.85);
  backdrop-filter: blur(4px);
  color: var(--yellow);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: .2s;
  white-space: nowrap;
}

.release-replace-btn:hover {
  background: var(--yellow);
  color: #111;
}

/* Чуть сдвигаем иконку удаления, чтобы встала в ряд с новой кнопкой */
.release-admin {
  gap: 6px;
  align-items: center;
}

/* === V6: Perfect Squares, Project Links & Highlighting === */

/* 1. Квадратные релизы */
.release-card {
  flex: 0 0 auto;
  height: 100%;
  aspect-ratio: 1 / 1;
  min-height: 180px;
}

/* 2. Ссылки на проекты */
.upcoming-project-link, .schedule-project-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}
.upcoming-project-link:hover, .schedule-project-link:hover {
  color: var(--yellow);
}
.schedule-image-link {
  display: block;
  flex-shrink: 0;
}

/* 3. Подсветка карточки проекта */
.project-card.is-highlighted {
  border-color: var(--yellow) !important;
  box-shadow: 0 0 24px rgba(255, 212, 0, 0.25) !important;
  transform: translateY(-2px);
}

/* 4. Скрытие прошедших эфиров в блоке на главной */
.upcoming-item.is-hidden-past,
.upcoming-item.is-hidden-overflow {
  display: none !important;
}

/* === Fix: Schedule Project Image Link === */
.schedule-image-link {
  display: block;
  flex-shrink: 0;
  width: 92px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
}

.schedule-image-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.schedule-image-link:hover img {
  transform: scale(1.05);
}

/* Адаптивность (повторяем старые правила для новой обертки) */
@media (max-width: 1050px) {
  .schedule-image-link {
    width: 76px;
  }
}

@media (max-width: 700px) {
  .schedule-image-link {
    display: none !important;
  }
}









/* === Projects sorting patch (v9 - Autopilot) === */

.project-browser {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  gap: 16px;
  margin-bottom: 24px;
}

.project-browser-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  width: 100%;
}

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

.project-sort-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-left: auto;
}

.project-sort {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.project-sort-label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.project-sort-btn {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  font-family: inherit;
  transition: border-color .2s, background .2s, color .2s;
}

.project-sort-btn:hover {
  border-color: var(--yellow);
}

.project-sort-btn.is-active {
  background: var(--yellow);
  color: #111;
  border-color: var(--yellow);
}

.project-sort-btn.is-active:hover {
  background: var(--yellow-2);
  border-color: var(--yellow-2);
}

.project-sort-btn[data-project-sort="year"]::after,
.project-sort-btn[data-project-sort="last_year"]::after,
.project-sort-btn[data-project-sort="relevance"]::after,
.project-sort-btn[data-project-sort="name"]::after {
  content: "↕";
  display: inline-block;
  margin-left: 6px;
  font-size: 14px;
  line-height: 1;
  opacity: 0.4;
  transition: opacity 0.2s;
}

.project-sort-btn:hover::after {
  opacity: 0.8;
}

.project-sort-btn.is-active::after {
  opacity: 1;
}

.project-sort-btn.is-active[data-dir="desc"]::after { content: "↓"; }
.project-sort-btn.is-active[data-dir="asc"]::after  { content: "↑"; }

@media (max-width: 1200px) {
  .project-sort-wrap {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 900px) {
  .project-browser-row {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
  }

  .project-filters-wrap,
  .project-sort-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    margin-left: 0;
  }

  .project-filters {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    width: 100%;
  }

  .project-sort {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }

  .project-sort-btn {
    flex: 1 1 auto;
    justify-content: center;
    padding: 0 10px;
    font-size: 13px;
    min-height: 38px;
  }
}

@media (max-width: 420px) {
  .project-filters {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .project-sort-btn {
    padding: 0 8px;
    font-size: 12px;
  }
}
