:root {
  color-scheme: light;
  --page: #f6f6fb;
  --surface: #ffffff;
  --surface-muted: #eff0f8;
  --text: #17172a;
  --text-soft: #72728b;
  --line: #e6e5f0;
  --accent: #6959e8;
  --accent-strong: #5142cb;
  --accent-soft: #efedff;
  --hero-text: #ffffff;
  --shadow: 0 16px 42px rgb(38 32 91 / 9%);
  font-family: "DM Sans", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #11111b;
  --surface: #191925;
  --surface-muted: #222233;
  --text: #f0effa;
  --text-soft: #aaa8c2;
  --line: #303044;
  --accent: #a398ff;
  --accent-strong: #b5acff;
  --accent-soft: #282443;
  --hero-text: #ffffff;
  --shadow: 0 18px 45px rgb(0 0 0 / 26%);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--page);
  color: var(--text);
  transition: background-color 180ms ease, color 180ms ease;
}

body::before {
  position: fixed;
  z-index: -1;
  top: -260px;
  right: -200px;
  width: 580px;
  height: 580px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 10%, transparent), transparent 68%);
  content: "";
  pointer-events: none;
}

button,
input {
  font: inherit;
}

textarea {
  font: inherit;
}

[hidden] {
  display: none !important;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.skip-link,
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.skip-link:focus {
  z-index: 20;
  top: 12px;
  left: 12px;
  width: auto;
  height: auto;
  padding: 10px 14px;
  background: var(--surface);
  clip: auto;
  clip-path: none;
}

.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--page) 92%, transparent);
  backdrop-filter: blur(16px);
}

.header-inner,
.page-shell,
.footer-inner {
  width: min(1240px, calc(100% - 64px));
  margin-inline: auto;
}

.header-inner {
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 11px;
  font-family: Manrope, sans-serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.8px;
}

.brand-mark {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 24%);
  border-radius: 13px;
  background: linear-gradient(145deg, #8274ff, #5142ca);
  box-shadow: 0 7px 17px rgb(105 89 232 / 25%);
  color: #fff;
}

.brand-mark svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.brand-word {
  white-space: nowrap;
  font-weight: 800;
}

.brand-accent {
  color: var(--accent);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
}

.nav-link {
  position: relative;
  padding: 29px 0 27px;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: color 160ms ease;
}

.nav-link::after {
  position: absolute;
  right: 0;
  bottom: 17px;
  left: 0;
  height: 2px;
  border-radius: 4px;
  background: var(--accent);
  content: "";
  transform: scaleX(0);
  transition: transform 160ms ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--text);
}

.nav-link.is-active::after {
  transform: scaleX(1);
}

.header-tools {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.account-button,
.admin-button {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.admin-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.account-button:hover,
.admin-button:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.admin-button:hover {
  background: var(--accent-strong);
}

.telegram-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  transition: color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.telegram-link:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  color: var(--accent);
}

.telegram-link svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.search-box {
  display: flex;
  width: clamp(160px, 17vw, 218px);
  height: 40px;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text-soft);
}

.search-box svg,
.theme-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
}

.search-box input::placeholder {
  color: var(--text-soft);
  opacity: 0.8;
}

.search-box kbd {
  display: grid;
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: inherit;
  font-size: 10px;
}

.theme-toggle {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.page-shell {
  padding-top: 42px;
  padding-bottom: 72px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.section-heading .eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.3px;
  text-transform: none;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d7785b;
  box-shadow: 0 0 0 4px rgb(215 120 91 / 12%);
}

.section-heading h1,
.section-title-row h2 {
  margin: 0;
  font-family: Manrope, sans-serif;
  letter-spacing: -1.5px;
}

.section-heading h1 {
  font-size: clamp(26px, 3.2vw, 38px);
  line-height: 1.2;
}

.section-heading h1 span {
  color: var(--accent);
}

.heading-note {
  margin: 0 0 5px;
  color: var(--text-soft);
  font-size: 13px;
}

.hero-card {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 21px;
  background:
    radial-gradient(ellipse at 82% 18%, rgb(119 105 255 / 66%), transparent 32%),
    radial-gradient(ellipse at 75% 100%, rgb(31 171 201 / 32%), transparent 38%),
    linear-gradient(120deg, #17162d 5%, #34305f 60%, #4f4b8a);
  box-shadow: var(--shadow);
  color: var(--hero-text);
}

.hero-image,
.hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-image {
  object-fit: cover;
  object-position: center 46%;
  transition: transform 600ms ease;
}

.hero-card:hover .hero-image {
  transform: scale(1.025);
}

.hero-shade {
  background: linear-gradient(90deg, rgb(16 15 34 / 88%) 0%, rgb(16 15 34 / 66%) 43%, rgb(16 15 34 / 9%) 100%),
    linear-gradient(0deg, rgb(16 15 34 / 40%), transparent 60%);
}

.hero-content {
  position: relative;
  display: flex;
  width: min(700px, 76%);
  min-height: 430px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 48px 52px;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  line-height: 1;
  padding: 8px 11px;
}

.category-pill-light {
  border: 1px solid rgb(255 255 255 / 19%);
  background: rgb(255 255 255 / 12%);
  color: #fff;
  backdrop-filter: blur(8px);
}

.hero-content h2 {
  max-width: 610px;
  margin: 18px 0 12px;
  font-family: Manrope, sans-serif;
  font-size: clamp(32px, 4.2vw, 52px);
  font-weight: 700;
  letter-spacing: -2px;
  line-height: 1.12;
}

.hero-content > p {
  max-width: 545px;
  margin: 0;
  color: rgb(255 255 255 / 82%);
  font-size: 14px;
  line-height: 1.7;
}

.hero-meta {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  margin-top: 23px;
  color: rgb(255 255 255 / 78%);
  font-size: 11px;
}

.meta-separator {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  transition: gap 160ms ease;
}

.hero-link:hover {
  gap: 12px;
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: start;
  gap: 42px;
  margin-top: 55px;
}

.section-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.section-title-row .eyebrow {
  margin-bottom: 5px;
}

.section-title-row h2 {
  font-size: 24px;
  letter-spacing: -0.9px;
}

.news-count {
  padding-bottom: 4px;
  color: var(--text-soft);
  font-size: 11px;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.news-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.news-card:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  box-shadow: var(--shadow);
}

.news-card-image-wrap {
  position: relative;
  height: 205px;
  overflow: hidden;
  background: var(--surface-muted);
}

.news-card-image-placeholder {
  background:
    radial-gradient(ellipse at 25% 35%, rgb(143 127 255 / 48%), transparent 30%),
    radial-gradient(ellipse at 75% 65%, rgb(47 189 213 / 30%), transparent 35%),
    linear-gradient(135deg, #262344, #514b8c);
}

.news-card-image-placeholder::after {
  position: absolute;
  right: 24px;
  bottom: -50px;
  width: 150px;
  height: 150px;
  border: 1px solid rgb(255 255 255 / 25%);
  border-radius: 34px;
  content: "";
  transform: rotate(38deg);
}

.news-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}

.news-card:hover .news-card-image {
  transform: scale(1.04);
}

.news-card-image-wrap .category-pill {
  position: absolute;
  top: 13px;
  left: 13px;
  background: var(--surface);
}

.news-card-content {
  padding: 18px 18px 15px;
}

.news-card h3 {
  min-height: 64px;
  margin: 0 0 16px;
  font-family: Manrope, sans-serif;
  font-size: 16px;
  letter-spacing: -0.5px;
  line-height: 1.45;
}

.news-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-soft);
  font-size: 10px;
}

.news-card-content h3 a:hover {
  color: var(--accent);
}

.news-card-description {
  display: -webkit-box;
  overflow: hidden;
  margin: 11px 0 0;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.news-card-author {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  padding: 30px 20px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--text-soft);
  text-align: center;
}

.feed-error {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid #d88a76;
  border-radius: 9px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
}

.sidebar {
  display: grid;
  gap: 18px;
}

.sidebar-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.sidebar-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--line);
}

.sidebar-heading h2 {
  margin: 0;
  font-family: Manrope, sans-serif;
  font-size: 16px;
  letter-spacing: -0.4px;
}

.sidebar-icon {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 16px;
}

.popular-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: popular;
}

.popular-list li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 5px 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  counter-increment: popular;
}

.popular-list li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.popular-list li::before {
  color: var(--accent);
  content: counter(popular, decimal-leading-zero);
  font-family: Manrope, sans-serif;
  font-size: 11px;
  font-weight: 800;
}

.popular-list li a {
  grid-column: 2;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.55;
  transition: color 160ms ease;
}

.popular-list li a:hover {
  color: var(--accent);
}

.telegram-card {
  padding: 22px;
  background: var(--accent-soft);
}

.newsletter-card {
  padding: 22px;
  background:
    radial-gradient(ellipse at 100% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 44%),
    var(--surface);
}

.newsletter-mark {
  display: grid;
  width: 38px;
  height: 38px;
  margin-bottom: 16px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}

.newsletter-mark svg {
  display: block;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.newsletter-card .eyebrow {
  margin-bottom: 7px;
}

.newsletter-card h2 {
  margin: 0;
  font-family: Manrope, sans-serif;
  font-size: 18px;
  letter-spacing: -0.6px;
  line-height: 1.4;
}

.newsletter-copy {
  margin: 8px 0 16px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.6;
}

.newsletter-form {
  display: grid;
  gap: 10px;
}

.newsletter-form > input[type="email"] {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--page);
  color: var(--text);
  font-size: 12px;
}

.newsletter-form > input[type="email"]::placeholder {
  color: var(--text-soft);
}

.newsletter-form button {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.newsletter-form button:hover {
  transform: translateY(-1px);
  background: var(--accent-strong);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 24%, transparent);
}

.telegram-mark {
  display: grid;
  width: 36px;
  height: 36px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 10px;
  background: var(--surface);
  color: var(--accent);
}

.telegram-mark svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.telegram-card .eyebrow {
  margin-bottom: 7px;
}

.telegram-card h2 {
  margin: 0;
  font-family: Manrope, sans-serif;
  font-size: 18px;
  letter-spacing: -0.6px;
  line-height: 1.4;
}

.telegram-copy {
  margin: 8px 0 17px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.6;
}

.telegram-button {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.telegram-button:hover {
  transform: translateY(-1px);
  background: var(--accent-strong);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 25%, transparent);
}

.telegram-card .privacy-note {
  margin-top: 14px;
}

.privacy-note {
  margin: 8px 0 0;
  color: var(--text-soft);
  font-size: 9px;
  line-height: 1.5;
}

.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text-soft);
  font-size: 10px;
  line-height: 1.45;
}

.consent-label input {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--accent);
}

.newsletter-form button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.form-message {
  min-height: 0;
  margin: 0;
  color: var(--accent-strong);
  font-size: 11px;
  line-height: 1.5;
}

.form-message:not(:empty) {
  margin-top: 10px;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.footer-inner {
  display: flex;
  min-height: 88px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-brand {
  font-size: 16px;
}

.footer-brand .brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.footer-brand .brand-mark svg {
  width: 21px;
  height: 21px;
}

.copyright,
.footer-links {
  color: var(--text-soft);
  font-size: 11px;
}

.footer-links {
  display: flex;
  gap: 18px;
}

.footer-links a:hover {
  color: var(--accent);
}

.app-dialog {
  width: min(460px, calc(100% - 28px));
  max-width: none;
  max-height: min(90vh, 900px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 30px 100px rgb(0 0 0 / 25%);
}

.app-dialog::backdrop {
  background: rgb(14 13 29 / 62%);
  backdrop-filter: blur(5px);
}

.dialog-card {
  position: relative;
  display: grid;
  gap: 11px;
  padding: 34px;
}

.dialog-card h2 {
  margin: 0;
  font-family: Manrope, sans-serif;
  font-size: 25px;
  letter-spacing: -0.8px;
}

.dialog-description {
  margin: -4px 0 7px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.6;
}

.dialog-close {
  position: absolute;
  top: 15px;
  right: 16px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  font-size: 21px;
}

.field-label {
  margin-top: 4px;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

.form-input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--page);
  color: var(--text);
  font-size: 12px;
}

.form-textarea {
  min-height: 105px;
  resize: vertical;
  line-height: 1.5;
}

.dialog-submit {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  border: 0;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: background 160ms ease, transform 160ms ease;
}

.dialog-submit:hover {
  transform: translateY(-1px);
  background: var(--accent-strong);
}

.dialog-submit:disabled {
  cursor: wait;
  opacity: 0.65;
}

.dialog-switch,
.secondary-button,
.danger-button {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
}

.dialog-switch {
  justify-self: center;
  border: 0;
  color: var(--accent-strong);
}

.dialog-switch:hover,
.secondary-button:hover {
  color: var(--accent-strong);
  border-color: var(--accent);
}

.sign-out-button,
.danger-button {
  color: #bc4f52;
}

.dialog-message {
  min-height: 0;
  margin: 0;
  color: var(--accent-strong);
  font-size: 11px;
  line-height: 1.5;
}

.dialog-message.is-error {
  color: #bc4f52;
}

.admin-dialog {
  width: min(1120px, calc(100% - 28px));
}

.admin-card {
  padding: 34px;
}

.admin-settings-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 9px;
  margin: 8px 0 22px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--page);
}

.admin-settings-form h3 {
  grid-column: 1 / -1;
  margin: 0 0 3px;
  font-family: Manrope, sans-serif;
  font-size: 15px;
}

.admin-settings-form .field-label {
  grid-row: 2;
}

.admin-settings-form .form-input {
  grid-row: 3;
}

.admin-settings-form button {
  grid-row: 3;
  min-height: 42px;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(265px, 0.8fr) minmax(0, 1.2fr);
  align-items: start;
  gap: 25px;
  margin-top: 8px;
}

.admin-news-form,
.admin-content {
  min-width: 0;
}

.admin-news-form {
  display: grid;
  gap: 9px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--page);
}

.admin-news-form h3,
.admin-list-heading h3 {
  margin: 0;
  font-family: Manrope, sans-serif;
  font-size: 15px;
  letter-spacing: -0.3px;
}

.admin-checkbox {
  margin-top: 5px;
}

.admin-form-actions {
  display: grid;
  gap: 7px;
  margin-top: 5px;
}

.admin-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.admin-news-list,
.subscriber-list {
  display: grid;
  max-height: 310px;
  gap: 8px;
  overflow: auto;
}

.admin-news-item,
.subscriber-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.admin-news-item h4 {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
}

.admin-news-item p,
.subscriber-item time {
  margin: 5px 0 0;
  color: var(--text-soft);
  font-size: 9px;
}

.admin-item-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 5px;
}

.danger-button:hover {
  border-color: #bc4f52;
}

.subscribers-heading {
  margin-top: 25px;
}

.subscriber-list {
  max-height: 190px;
}

.subscriber-item {
  font-size: 10px;
}

.subscriber-item > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.subscriber-item time {
  flex: 0 0 auto;
  margin: 0;
}

.admin-empty {
  margin: 0;
  padding: 15px 3px;
  color: var(--text-soft);
  font-size: 11px;
}

@media (min-width: 1500px) {
  .header-inner,
  .page-shell,
  .footer-inner {
    width: min(1320px, calc(100% - 100px));
  }

  .hero-card,
  .hero-content {
    min-height: 440px;
  }

  .news-card-image-wrap {
    height: 205px;
  }
}

@media (max-width: 1050px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 0 22px;
    padding-block: 12px;
  }

  .main-nav {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .nav-link {
    padding: 12px 0 10px;
  }

  .nav-link::after {
    bottom: 3px;
  }

  .header-tools {
    margin-left: auto;
  }

  .content-layout {
    grid-template-columns: minmax(0, 1fr) 270px;
    gap: 25px;
  }

  .news-grid {
    gap: 14px;
  }
}

@media (max-width: 760px) {
  .header-inner,
  .page-shell,
  .footer-inner {
    width: min(100% - 36px, 600px);
  }

  .header-inner {
    min-height: auto;
    gap: 12px;
    padding-block: 13px 10px;
  }

  .brand {
    font-size: 17px;
  }

  .header-tools {
    gap: 7px;
  }

  .account-button,
  .admin-button {
    min-width: 40px;
    padding-inline: 8px;
  }

  .account-button {
    font-size: 10px;
  }

  .telegram-link {
    width: 40px;
    justify-content: center;
    padding: 0;
  }

  .telegram-link span {
    display: none;
  }

  .search-box {
    width: min(38vw, 195px);
  }

  .search-box kbd {
    display: none;
  }

  .theme-toggle {
    min-width: 40px;
    padding-inline: 9px;
  }

  .theme-toggle span {
    display: none;
  }

  .main-nav {
    justify-content: flex-start;
    gap: 22px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .main-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-link {
    flex: 0 0 auto;
    font-size: 12px;
  }

  .page-shell {
    padding-top: 30px;
    padding-bottom: 48px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
  }

  .heading-note {
    margin: 0;
  }

  .hero-card,
  .hero-content {
    min-height: 390px;
  }

  .hero-content {
    width: 100%;
    padding: 30px 27px;
  }

  .hero-shade {
    background: linear-gradient(90deg, rgb(16 15 34 / 82%), rgb(16 15 34 / 30%)),
      linear-gradient(0deg, rgb(16 15 34 / 54%), transparent 70%);
  }

  .hero-content h2 {
    font-size: clamp(28px, 7vw, 38px);
  }

  .hero-content > p {
    font-size: 13px;
  }

  .content-layout {
    grid-template-columns: 1fr;
    gap: 35px;
    margin-top: 40px;
  }

  .sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

@media (max-width: 520px) {
  .header-inner,
  .page-shell,
  .footer-inner {
    width: calc(100% - 30px);
  }

  .header-inner {
    column-gap: 8px;
  }

  .brand {
    gap: 7px;
    font-size: 15px;
  }

  .brand-mark {
    width: 29px;
    height: 29px;
  }

  .account-button {
    width: 40px;
    overflow: hidden;
    padding-inline: 0;
    font-size: 0;
  }

  .account-button::after {
    content: "Вхід";
    font-size: 10px;
  }

  .admin-button {
    padding-inline: 7px;
    font-size: 9px;
  }

  .brand-mark svg {
    width: 22px;
    height: 22px;
  }

  .search-box {
    width: min(40vw, 165px);
    justify-content: flex-start;
    padding: 0 9px;
  }

  .search-box input {
    display: block;
  }

  .hero-card,
  .hero-content {
    min-height: 420px;
  }

  .hero-content {
    padding: 26px 21px;
  }

  .hero-meta {
    flex-wrap: wrap;
    gap: 8px;
  }

  .hero-link {
    flex-basis: 100%;
    margin: 6px 0 0;
  }

  .news-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .news-card-image-wrap {
    height: 195px;
  }

  .news-card h3 {
    min-height: 0;
  }

  .sidebar {
    grid-template-columns: 1fr;
  }

  .dialog-card,
  .admin-card {
    padding: 28px 20px 22px;
  }

  .admin-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .admin-settings-form {
    grid-template-columns: 1fr;
  }

  .admin-settings-form .field-label,
  .admin-settings-form .form-input,
  .admin-settings-form button {
    grid-row: auto;
  }

  .admin-settings-form h3 {
    grid-column: auto;
  }

  .admin-news-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-item-actions {
    width: 100%;
  }

  .footer-inner {
    min-height: auto;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 12px 20px;
    padding-block: 20px;
  }

  .copyright {
    margin: 0 0 0 auto;
    text-align: right;
  }

  .footer-links {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}