:root {
  --portal-bg: #0b0d12;
  --portal-surface: #151922;
  --portal-surface-2: #10141c;
  --portal-surface-3: rgba(18, 22, 32, 0.84);
  --portal-text: #ffffff;
  --portal-muted: #c2c8d6;
  --portal-line: rgba(255, 255, 255, 0.08);
  --portal-accent: #ff8a00;
  --portal-accent-2: #ff3d00;
  --portal-accent-3: #ffffff;
  --portal-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
  --media-position: center;
  --media-offset-x: 0%;
  --media-offset-y: 0%;
  --media-scale: 1;
}

body.portal-page {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  font-family: "Space Grotesk", "Manrope", "Segoe UI", system-ui, sans-serif;
  color: var(--portal-text);
  background:
    radial-gradient(1200px 820px at 12% 12%, rgba(255, 142, 63, 0.22), transparent 72%),
    radial-gradient(1100px 720px at 84% 10%, rgba(255, 90, 135, 0.16), transparent 74%),
    radial-gradient(900px 640px at 52% 0%, rgba(86, 122, 255, 0.12), transparent 75%),
    linear-gradient(180deg, #0a0d14 0%, #0b0f18 30%, #0a0c13 100%);
}

body.portal-page *,
body.portal-page *::before,
body.portal-page *::after {
  box-sizing: border-box;
}

body.portal-page img {
  max-width: 100%;
  height: auto;
}

.portal-shell {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.portal-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(24px);
  background: transparent;
  border-bottom: none;
}

.portal-topbar {
  max-width: 1200px;
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 12px 24px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.portal-topbar-links {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
  justify-content: flex-start;
}

.portal-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(10, 12, 18, 0.6);
  color: var(--portal-text);
  cursor: pointer;
}

.portal-nav-toggle-icon {
  font-size: 22px;
  line-height: 1;
}

.portal-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.portal-topbar-card {
  border-radius: 999px;
  background: rgba(10, 12, 18, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  margin: 12px auto 0;
  padding-inline: 18px;
  backdrop-filter: blur(18px);
}

.portal-header * {
  backface-visibility: hidden;
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--portal-text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.portal-brand img {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(255, 140, 0, 0.45);
}

.portal-brand span {
  font-size: 1.05rem;
}

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

.portal-nav-link {
  color: var(--portal-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 8px 14px;
  border-radius: 999px;
  white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 12, 18, 0.6);
}

.portal-nav-link:hover {
  background: rgba(255, 138, 0, 0.18);
  border-color: rgba(255, 138, 0, 0.45);
}

.portal-nav-link.is-active {
  background: linear-gradient(90deg, rgba(255, 138, 0, 0.25), rgba(255, 61, 0, 0.22));
  border-color: rgba(255, 138, 0, 0.5);
}

.portal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.portal-actions--header {
  margin-left: auto;
}

.portal-actions--header {
  flex-wrap: wrap;
}

.portal-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  color: #0b0c10;
  background: linear-gradient(100deg, #ff9d2a 0%, #ff6a00 48%, #ff3d00 100%);
  border: none;
  cursor: pointer;
  box-shadow: 0 18px 34px rgba(255, 90, 0, 0.35);
}

.portal-button.ghost {
  background: transparent;
  color: var(--portal-text);
  border: 1px solid rgba(255, 138, 0, 0.45);
  box-shadow: none;
}

.portal-button-telegram {
  color: #101318;
  white-space: nowrap;
  flex: 0 0 auto;
}

/* topbar v4 */
.portal-topbar--cta-fold .portal-actions--header {
  display: none;
}

.portal-topbar--nav-wrap .portal-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
  width: 100%;
  margin-top: 6px;
  justify-content: flex-start;
}

.portal-topbar--nav-wrap .portal-nav-link {
  text-align: left;
  justify-content: flex-start;
}

.portal-topbar--cta-fold .portal-actions--header {
  display: none;
}

.portal-icon {
  width: 18px;
  height: 18px;
  margin-right: 8px;
}


.portal-main {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 34px 24px 70px;
  display: grid;
  gap: 28px;
}

body.portal-linux .portal-main {
  max-width: 1400px;
}

.portal-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  padding: 36px;
  border-radius: 28px;
  background: var(--portal-surface-3);
  border: 1px solid var(--portal-line);
  box-shadow: var(--portal-shadow);
  overflow: hidden;
}

.portal-hero--single {
  grid-template-columns: minmax(0, 1fr);
}

.portal-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 138, 0, 0.22), rgba(255, 61, 0, 0.14) 45%, transparent 70%);
  pointer-events: none;
}

.portal-hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 16px;
  min-width: 0;
}

.portal-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--portal-muted);
}

.portal-kicker::before {
  content: "";
  width: 18px;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff9d2a, #ff3d00);
}

.portal-hero h1 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 3.2rem);
  letter-spacing: -0.02em;
}

.portal-hero p {
  margin: 0;
  color: var(--portal-muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.portal-hero-panel {
  position: relative;
  z-index: 1;
  padding: 20px;
  border-radius: 22px;
  background: rgba(12, 14, 22, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  gap: 14px;
  min-width: 0;
}

.portal-hero-panel h3 {
  margin: 0;
  font-size: 1.1rem;
}

.portal-hero .portal-actions {
  flex-wrap: nowrap;
  gap: 12px;
}

.portal-hero .portal-actions .portal-button {
  width: auto;
  white-space: nowrap;
}

.portal-stat {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(18, 22, 34, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.portal-stat span {
  font-size: 0.85rem;
  color: var(--portal-muted);
}

.portal-section {
  display: grid;
  gap: 18px;
}

.portal-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.portal-section-title {
  margin: 0;
  font-size: 1.5rem;
}

.portal-link {
  color: var(--portal-text);
  text-decoration: none;
  font-weight: 600;
}

.portal-link--subtle {
  color: inherit;
  font-weight: inherit;
  text-decoration: underline;
  text-underline-offset: 0.12em;
  text-decoration-color: rgba(255, 157, 42, 0.45);
}

.portal-link:hover {
  color: #ffb457;
}

.portal-link.portal-link--subtle:hover {
  color: inherit;
  text-decoration-color: rgba(255, 180, 87, 0.78);
}

.portal-tile-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.portal-tile {
  padding: 18px;
  border-radius: 18px;
  background: rgba(16, 20, 32, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.18);
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 6px 14px;
  align-items: center;
  text-decoration: none;
  color: var(--portal-text);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.portal-tile:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 138, 0, 0.55);
}

.portal-tile-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(140deg, rgba(255, 138, 0, 0.45), rgba(255, 61, 0, 0.35));
  display: grid;
  place-items: center;
  grid-row: 1;
  align-self: center;
}

.portal-tile-icon span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.8;
}

.portal-tile strong {
  grid-column: 2;
  line-height: 1.2;
}

.portal-tile .portal-meta {
  grid-column: 1 / -1;
  grid-row: 2;
  display: block;
}

.portal-featured {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.45fr);
  gap: 22px;
  padding: 22px;
  border-radius: 24px;
  background: rgba(18, 22, 34, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: var(--portal-shadow);
  align-items: stretch;
}

.portal-media-crop {
  width: 100%;
  border-radius: 3.48% / 7.27%;
  overflow: hidden;
  background: transparent;
}

.portal-media-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 138, 0, 0.24);
  background-color: rgba(12, 16, 28, 0.9);
  background-image: var(--portal-fallback, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 18px;
}

.portal-media-crop.portal-media-frame {
  border-radius: 3.48% / 7.27%;
}

.portal-media-frame.is-landscape {
  aspect-ratio: 23 / 11;
}

.portal-media-frame.is-portrait {
  aspect-ratio: 3 / 4;
}

.portal-media-frame.is-square {
  aspect-ratio: 1 / 1;
}

.portal-media-asset {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
  transform: scale(var(--media-scale, 1));
  transform-origin: center;
}

.portal-media-asset[hidden] {
  display: none !important;
}

.portal-media-frame .portal-media-asset {
  border: 0;
  border-radius: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.portal-media-frame iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

.portal-media-inner {
  width: 100%;
  height: 100%;
  display: block;
  transform: translate(var(--media-offset-x, 0%), var(--media-offset-y, 0%));
}

.portal-media-frame--contain .portal-media-asset {
  object-fit: contain;
}

.portal-media-frame--zoom .portal-media-asset {
  transform: scale(calc(var(--media-scale, 1) * 1.12));
}

.portal-media-featured {
  border-radius: 3.48% / 7.27%;
  align-self: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: auto;
  aspect-ratio: 23 / 11;
  justify-self: start;
}

.portal-media-featured.portal-media-frame--contain .portal-media-asset {
  object-fit: contain;
}

.portal-card .portal-media-crop {
  aspect-ratio: 23 / 11;
}

.portal-card .portal-media-crop.portal-media-crop--full {
  aspect-ratio: 9 / 16;
}

.portal-media-crop--alt {
  border: 1px solid rgba(255, 138, 0, 0.18);
  background:
    radial-gradient(320px 220px at 18% 18%, rgba(255, 138, 0, 0.12), transparent 60%),
    linear-gradient(135deg, rgba(24, 28, 40, 0.95), rgba(10, 14, 24, 0.95));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.portal-card-placeholder {
  width: 100%;
  aspect-ratio: 23 / 11;
  border-radius: 3.48% / 7.27%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(140deg, rgba(24, 28, 40, 0.95), rgba(10, 14, 24, 0.95));
  position: relative;
  overflow: hidden;
}

.portal-card-placeholder::before {
  content: "";
  position: absolute;
  left: 10%;
  top: 18%;
  width: 60%;
  height: 18%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow:
    0 26px 0 rgba(255, 255, 255, 0.12),
    0 46px 0 rgba(255, 255, 255, 0.08);
}

.portal-card-placeholder::after {
  content: "";
  position: absolute;
  right: -10%;
  top: -30%;
  width: 60%;
  height: 90%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 138, 0, 0.12), transparent 65%);
}

.portal-featured-body {
  display: grid;
  gap: 12px;
  align-content: start;
  min-width: 0;
}

.portal-featured-body h3 {
  margin-top: 4px;
  margin-bottom: 6px;
}

.portal-featured-body p {
  margin-top: 0;
  margin-bottom: 6px;
}

.portal-featured-summary {
  margin-top: 0;
  margin-bottom: 6px;
}

.portal-featured .portal-link {
  margin-top: 12px;
}

.portal-article-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.portal-article-block {
  padding: 20px 22px;
  border-radius: 20px;
  background: var(--portal-surface-2);
  border: 1px solid var(--portal-line);
  display: grid;
  gap: 12px;
}

.portal-article-block h2 {
  margin: 0;
  font-size: 1.25rem;
}

.portal-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
  color: var(--portal-text);
}

.portal-list-ordered {
  list-style: decimal;
}

.portal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--portal-muted);
  font-size: 0.9rem;
}

.portal-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.portal-status--draft {
  background: rgba(255, 140, 0, 0.15);
  color: rgba(255, 199, 132, 0.95);
  border: 1px solid rgba(255, 140, 0, 0.3);
}

.portal-tag {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-weight: 600;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.portal-grid--media-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-showcase {
  display: grid;
  gap: 16px;
}

.portal-showcase-item {
  display: grid;
  grid-template-columns: minmax(170px, 240px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 16px;
  border-radius: 18px;
  background: rgba(14, 18, 30, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.portal-showcase-item--reverse {
  grid-template-columns: minmax(0, 1fr) minmax(170px, 240px);
}

.portal-showcase-item--reverse .portal-showcase-media {
  order: 2;
  justify-self: end;
}

.portal-showcase-item--reverse .portal-showcase-body {
  order: 1;
}

.portal-showcase-media {
  margin: 0;
  width: min(100%, 240px);
}

.portal-showcase-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.portal-showcase-body {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.portal-showcase-body h3 {
  margin: 0;
}

.portal-showcase-note {
  margin: 0;
  color: var(--portal-muted);
  font-size: 0.92rem;
}

.portal-showcase-body > p {
  margin: 0;
}

.portal-showcase-body .portal-list {
  margin-top: 0;
}

@media (max-width: 900px) {
  .portal-showcase-item,
  .portal-showcase-item--reverse {
    grid-template-columns: minmax(0, 1fr);
  }

  .portal-showcase-item--reverse .portal-showcase-media,
  .portal-showcase-item--reverse .portal-showcase-body {
    order: initial;
  }

  .portal-showcase-media {
    width: min(100%, 220px);
    justify-self: start;
  }
}

.portal-card {
  display: grid;
  gap: 12px;
  padding: 20px;
  border-radius: 20px;
  background: rgba(16, 20, 32, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.18);
  text-decoration: none;
  color: var(--portal-text);
  transition: transform 0.2s ease, border-color 0.2s ease;
  min-width: 0;
}

.portal-card h3 {
  margin-top: 4px;
  margin-bottom: 8px;
}

.portal-card p {
  margin-top: 0;
  margin-bottom: 6px;
}

.portal-card .portal-link {
  margin-top: 6px;
  display: inline-flex;
}

.portal-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 138, 0, 0.5);
}

.portal-card img {
  width: 100%;
}

.portal-filter {
  display: grid;
  gap: 14px;
  align-items: start;
  padding: 16px;
  border-radius: 18px;
  background: rgba(12, 16, 28, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.portal-filter-input {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.portal-filter-field {
  position: relative;
  flex: 1 1 260px;
  min-width: 0;
  width: 100%;
  display: flex;
  align-items: center;
}

.portal-filter-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  color: rgba(194, 200, 214, 0.7);
  pointer-events: none;
}

.portal-filter input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  background: rgba(10, 14, 24, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  padding: 12px 16px;
  color: var(--portal-text);
  font-size: 1rem;
  height: 52px;
}

.portal-filter-field input {
  padding: 12px 44px 12px 16px;
}

.portal-filter input::placeholder {
  color: rgba(194, 200, 214, 0.7);
}

.portal-filter-reset {
  color: var(--portal-muted);
  text-decoration: none;
  font-weight: 600;
}

.portal-filter-reset:hover {
  color: #ffb457;
}

.portal-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.portal-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--portal-text);
  background: rgba(14, 18, 30, 0.8);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.portal-chip:hover {
  border-color: rgba(255, 138, 0, 0.4);
  color: #ffb457;
}

.portal-chip.is-active {
  background: linear-gradient(90deg, rgba(255, 138, 0, 0.25), rgba(255, 61, 0, 0.2));
  border-color: rgba(255, 138, 0, 0.55);
  color: #fff;
}

.portal-highlight {
  background: rgba(255, 138, 0, 0.25);
  color: #ffffff;
  padding: 0 4px;
  border-radius: 6px;
}

.portal-filter-meta {
  color: var(--portal-muted);
  font-size: 0.9rem;
}

.portal-article-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.55fr) minmax(220px, 0.65fr);
  gap: 20px;
  align-items: start;
}

.portal-article {
  display: block;
  padding: 28px;
  border-radius: 26px;
  background: var(--portal-surface-3);
  border: 1px solid var(--portal-line);
  box-shadow: var(--portal-shadow);
  min-width: 0;
  overflow-wrap: anywhere;
}

.portal-article-body {
  display: block;
}

.portal-article-body > * + * {
  margin-top: 16px;
}

.portal-article-body > .portal-article-head {
  margin-top: 0;
}

.portal-article-body::after {
  content: "";
  display: block;
  clear: both;
}

.portal-article-media {
  margin-bottom: 18px;
}

.portal-article--media-left .portal-article-media,
.portal-article--media-right .portal-article-media {
  width: min(38%, 360px);
  margin-bottom: 14px;
}

.portal-article--media-left .portal-article-media {
  float: left;
  margin-right: 22px;
}

.portal-article--media-right .portal-article-media {
  float: right;
  margin-left: 22px;
}

.portal-article-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.portal-article-head .portal-meta,
.portal-article-head .portal-button--compact {
  line-height: 1;
}

.portal-article-head .portal-meta {
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
}

.portal-button--compact {
  padding: 8px 14px;
  font-size: 0.9rem;
  box-shadow: none;
  align-self: center;
}

.portal-article h1 {
  margin: 0;
  font-size: clamp(1.85rem, 4vw, 3rem);
}

.portal-lead {
  margin: 0;
  color: var(--portal-muted);
  font-size: 1.05rem;
}

.portal-article-cover {
  width: 100%;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.portal-content {
  display: block;
  line-height: 1.7;
  font-size: 1.02rem;
  overflow-wrap: anywhere;
}

.portal-content > * {
  margin: 0;
}

.portal-content p {
  margin: 0 0 16px;
}

.portal-content p:last-child {
  margin-bottom: 0;
}

.portal-content :is(h2, h3, h4, p, li, figcaption) {
  text-wrap: pretty;
}

.portal-content h2 {
  margin: 32px 0 10px;
}

.portal-content h3 {
  margin: 26px 0 8px;
}

.portal-content h4 {
  margin: 22px 0 6px;
}

.portal-content > h2:first-child,
.portal-content > h3:first-child,
.portal-content > h4:first-child {
  margin-top: 0;
}

.portal-content ul,
.portal-content ol {
  margin: 0 0 16px;
  padding-left: 1.4rem;
}

.portal-content li + li {
  margin-top: 6px;
}

.portal-content blockquote {
  margin: 22px 0;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 4px solid rgba(255, 138, 0, 0.72);
  background:
    linear-gradient(90deg, rgba(255, 138, 0, 0.14) 0%, rgba(255, 138, 0, 0.06) 38%, rgba(12, 16, 27, 0.62) 100%);
  color: var(--portal-muted);
}

.portal-content blockquote > :first-child {
  margin-top: 0;
}

.portal-content blockquote > :last-child {
  margin-bottom: 0;
}

.portal-content blockquote p {
  margin: 0 0 12px;
  color: inherit;
}

.portal-content blockquote p:last-child {
  margin-bottom: 0;
}

.portal-content blockquote :is(ul, ol) {
  margin: 0 0 12px;
}

.portal-content blockquote cite {
  display: block;
  margin-top: 10px;
  font-size: 0.95em;
  font-style: normal;
  color: rgba(255, 255, 255, 0.74);
}

.portal-content hr {
  margin: 24px 0;
}

.portal-content .portal-callout {
  margin: 20px 0;
}

.portal-content pre {
  margin: 18px 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(8, 12, 22, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.2);
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.portal-content pre code {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.95rem;
  line-height: 1.55;
  white-space: pre;
  word-break: normal;
  overflow-wrap: normal;
}

.portal-content :not(pre) > code {
  display: inline;
  padding: 0.08em 0.35em;
  border-radius: 0.35em;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.25);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.portal-content::after {
  content: "";
  display: block;
  clear: both;
}

.setup-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  grid-template-areas:
    "main card"
    "main extra";
  gap: 28px;
  padding: 28px;
  border-radius: 28px;
  background: rgba(18, 22, 34, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: var(--portal-shadow);
  align-items: start;
}

.setup-hero-main {
  grid-area: main;
}

.setup-hero-main h1 {
  margin: 12px 0 10px;
  font-size: clamp(2rem, 3.6vw, 3.2rem);
}

.setup-kicker {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 138, 0, 0.35);
  background: rgba(255, 138, 0, 0.12);
  color: #ffcc99;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.setup-lead {
  margin: 0 0 18px;
  color: var(--portal-muted);
  font-size: 1.05rem;
}

.setup-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
}

.setup-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.setup-badge {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.88rem;
  font-weight: 600;
}

.setup-hero-card {
  grid-area: card;
  display: grid;
  gap: 12px;
  padding: 20px;
  border-radius: 22px;
  background: rgba(12, 16, 28, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.setup-hero-extra {
  grid-area: extra;
  display: grid;
  gap: 14px;
  align-content: start;
}

.setup-hero-card h3 {
  margin: 0;
  font-size: 1.1rem;
}

.setup-checklist {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.setup-checklist li {
  position: relative;
  padding-left: 26px;
  line-height: 1.5;
}

.setup-checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 138, 0, 0.9), rgba(255, 61, 0, 0.8));
  box-shadow: 0 0 12px rgba(255, 138, 0, 0.35);
}

.setup-callout {
  margin: 20px 0 0;
}

.setup-section {
  display: grid;
  gap: 18px;
  margin-top: 26px;
}

.setup-section--video {
  margin-top: 12px;
}

.setup-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.setup-section-head h2 {
  margin: 0;
  font-size: 1.5rem;
}

.setup-section-head p {
  margin: 8px 0 0;
  color: var(--portal-muted);
}

.setup-muted {
  color: var(--portal-muted);
}

.setup-video-card {
  display: grid;
  gap: 12px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  width: 100%;
  justify-items: end;
  align-self: start;
}

.setup-video-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(320px, 40vw, 470px);
  align-items: start;
  align-content: start;
  gap: 26px;
}

.setup-video-text {
  min-width: 0;
  align-self: start;
}

.setup-video-text h2 {
  margin: 0 0 10px;
  font-size: 1.6rem;
}

.setup-video-text p {
  margin: 0;
  color: var(--portal-muted);
  font-size: 1.05rem;
}

.setup-video-caption {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.95rem;
}

.setup-media-frame {
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.setup-media-frame--video {
  aspect-ratio: 16 / 9;
  width: 100%;
}

.setup-media-frame--portrait {
  aspect-ratio: auto;
  width: min(100%, 360px);
  border: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}

.setup-caption {
  margin: 0;
  color: var(--portal-muted);
  font-size: 0.95rem;
  text-align: center;
}

.setup-steps {
  display: grid;
  gap: 18px;
}

.setup-step {
  --step-media-width: clamp(200px, 40vw, 280px);
  display: flow-root;
  padding: 16px;
  border-radius: 22px;
  background: rgba(16, 20, 32, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.18);
  position: relative;
  overflow: hidden;
}

.setup-step-body {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.setup-step--reverse .setup-step-body {
  margin-left: clamp(18px, 2.4vw, 28px);
}

.setup-step--with-alt {
  --step-media-width: clamp(190px, 34vw, 260px);
}

.setup-step-index {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 138, 0, 0.18);
  border: 1px solid rgba(255, 138, 0, 0.35);
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffcc99;
  margin-bottom: 10px;
}

.setup-step-body h3 {
  margin: 0 0 8px;
  font-size: 1.3rem;
}

.setup-step-body p {
  margin: 0 0 12px;
  color: var(--portal-muted);
}

.setup-step-list-block h4,
.setup-step-alt h4 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.setup-step-list {
  margin: 0;
  padding-left: 1.2rem;
}

.setup-step-list li + li {
  margin-top: 6px;
}

.setup-step--reverse:not(.setup-step--with-alt) .setup-step-list-block {
  margin-left: 14px;
}

.setup-step--reverse:not(.setup-step--with-alt) .setup-step-list {
  padding-left: 1.5rem;
}

.setup-step-alt {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(255, 255, 255, 0.15);
}

.setup-note {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 138, 0, 0.15);
  border: 1px solid rgba(255, 138, 0, 0.25);
}

.setup-step-media {
  display: grid;
  gap: 10px;
  justify-items: center;
  width: min(100%, var(--step-media-width));
  float: right;
  margin: 0 0 10px 18px;
  position: relative;
}

.setup-step--reverse .setup-step-media {
  float: left;
  margin: 0 18px 10px 0;
}

.setup-step-media figcaption {
  text-align: center;
  color: var(--portal-muted);
  font-size: 0.9rem;
  margin-top: 6px;
}

.setup-step-media .portal-media-asset {
  height: auto;
  object-fit: contain;
  border-radius: 0;
  border: 0;
}

.setup-step-media .portal-media-inner {
  transform: none;
}

.setup-step--with-alt .setup-step-media {
  margin-bottom: 12px;
}

.setup-step--with-alt:not(.setup-step--reverse) .setup-step-media {
  margin-left: 32px;
}

.setup-step--with-alt.setup-step--reverse .setup-step-media {
  margin-right: 32px;
}

.setup-step--with-alt .setup-step-media .portal-media-frame {
  max-width: var(--step-media-width);
}

.setup-step--with-alt .setup-step-list-block {
  display: flow-root;
  max-inline-size: min(100%, 58ch);
  padding-left: 14px;
}

.setup-step--with-alt .setup-step-list {
  list-style-position: outside;
  padding-left: 1.75rem;
  line-height: 1.35;
}

.setup-step--with-alt .setup-step-list-block > .setup-step-list {
  margin-left: 0;
}

.setup-step--with-alt .setup-step-list li + li {
  margin-top: 8px;
}

.setup-step--with-alt .setup-step-alt {
  display: flow-root;
  min-inline-size: min(100%, 30rem);
  max-inline-size: min(100%, 58ch);
  margin-top: 12px;
}

.setup-step-media .portal-media-frame {
  width: 100%;
  max-width: var(--step-media-width);
  border-radius: 18px;
  border: 1px solid rgba(255, 138, 0, 0.28);
  background: rgba(10, 12, 20, 0.6);
  overflow: hidden;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.32), 0 0 0 1px rgba(255, 138, 0, 0.22);
}

.setup-step-media .portal-media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px rgba(255, 138, 0, 0.18);
  pointer-events: none;
}

.setup-step::before {
  content: none;
}

.setup-simple {
  padding: 20px 22px;
  border-radius: 20px;
  background: rgba(16, 20, 32, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.setup-simple-steps {
  margin: 0;
  padding-left: 1.3rem;
}

.setup-empty {
  padding: 22px;
  border-radius: 20px;
  background: rgba(16, 20, 32, 0.78);
  border: 1px dashed rgba(148, 163, 184, 0.2);
}

.setup-finish {
  display: grid;
  gap: 16px;
  padding: 24px;
  border-radius: 24px;
  background: rgba(12, 16, 28, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.setup-support {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-radius: 20px;
  background: rgba(16, 20, 32, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.18);
  flex-wrap: wrap;
}

.setup-support-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}


.portal-media-block,
.portal-media-block--wide {
  margin: 0;
}

.portal-media-block.is-portrait,
.portal-media-block--portrait {
  width: min(38%, 360px);
}

.portal-media-block--square {
  width: min(34%, 320px);
}

.portal-media-block.media-left,
.portal-media-block--left {
  float: left;
  margin: 6px 22px 16px 0;
}

.portal-media-block.media-right,
.portal-media-block--right {
  float: right;
  margin: 6px 0 16px 22px;
}

.portal-media-block--wrap-none {
  float: none;
}

.portal-media-block--align-left {
  margin: 8px auto 18px 0;
}

.portal-media-block--align-center {
  margin: 8px auto 18px;
}

.portal-media-block--align-right {
  margin: 8px 0 18px auto;
}

/* Keep symmetric spacing around full-width media blocks in rendered articles. */
.portal-content .portal-media-block--wide.portal-media-block--wrap-none {
  margin-block: 16px;
}

.portal-content h2 {
  margin: 32px 0 10px;
  font-size: 1.4rem;
}

.portal-content h3 {
  margin: 26px 0 8px;
  font-size: 1.2rem;
}

.portal-content h4 {
  margin: 22px 0 6px;
}

.portal-content img {
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.portal-content figure {
  margin: 0;
  display: grid;
  gap: 10px;
}

.portal-content figcaption {
  color: var(--portal-muted);
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .portal-article,
  .portal-content {
    overflow-wrap: normal;
    word-break: normal;
  }

  .portal-content .portal-media-block--left,
  .portal-content .portal-media-block--right {
    float: left;
    margin: 4px 10px 12px 0;
  }

  .portal-content .portal-media-block--right {
    float: right;
    margin: 4px 0 12px 10px;
  }

  .portal-content h2 {
    font-size: clamp(1.08rem, 4.7vw, 1.26rem);
    line-height: 1.24;
    text-wrap: balance;
  }

  .portal-content h3 {
    font-size: clamp(1.02rem, 4.2vw, 1.16rem);
    line-height: 1.26;
    text-wrap: balance;
  }

  .portal-content .portal-media-block.is-portrait,
  .portal-content .portal-media-block--portrait,
  .portal-content .portal-media-block--square {
    width: min(42%, 192px);
  }

  .portal-content a {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .portal-content pre {
    padding: 12px 14px;
    overflow-x: auto;
  }

  .portal-content pre code {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .portal-content blockquote {
    margin: 18px 0;
    padding: 12px 14px;
    border-radius: 12px;
  }
}

@media (max-width: 410px) {
  .portal-content .portal-media-block--left,
  .portal-content .portal-media-block--right {
    float: none;
    margin: 6px auto 14px;
  }

  .portal-content .portal-media-block.is-portrait,
  .portal-content .portal-media-block--portrait,
  .portal-content .portal-media-block--square {
    width: min(100%, 220px);
  }
}

@media (max-width: 480px) {
  .portal-content :is(p, li, figcaption) {
    -webkit-hyphens: auto;
    hyphens: auto;
    hyphenate-character: "-";
  }
}

.portal-content a {
  color: #ffd9a1;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.portal-content a:hover {
  color: #ffffff;
}

.portal-callout {
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(255, 138, 0, 0.18);
  border: 1px dashed rgba(255, 138, 0, 0.45);
  color: var(--portal-text);
}

.portal-aside {
  display: grid;
  gap: 12px;
  min-width: 0;
  align-content: start;
}

.portal-aside-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(16, 20, 32, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.18);
  align-self: start;
  display: grid;
  gap: 8px;
}

.portal-aside-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.portal-aside-card p {
  margin: 0;
  line-height: 1.5;
}

.portal-aside-card--fit {
  gap: 12px;
}

.portal-aside-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: var(--portal-text);
  line-height: 1.5;
}

.portal-aside-list li::marker {
  color: rgba(255, 138, 0, 0.7);
}

.portal-video {
  position: relative;
  padding-top: 56.25%;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.portal-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.portal-admin {
  display: grid;
  gap: 18px;
  padding: 26px;
  border-radius: 24px;
  background: rgba(16, 20, 32, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.portal-admin-system {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(10, 12, 20, 0.65);
}

.portal-admin-upload-status {
  min-height: 22px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px dashed rgba(148, 163, 184, 0.2);
  color: var(--portal-muted);
  font-size: 0.9rem;
}

.portal-admin-upload-status:empty {
  display: none;
}

.portal-admin-upload-status[data-tone="error"] {
  border-color: rgba(255, 120, 120, 0.35);
  color: #ffb3a1;
}

.portal-admin-upload-status[data-tone="ok"] {
  border-color: rgba(255, 170, 80, 0.35);
  color: #ffd9a1;
}

.portal-admin-upload-log {
  border-radius: 12px;
  border: 1px dashed rgba(148, 163, 184, 0.2);
  padding: 8px 12px;
  color: var(--portal-muted);
  font-size: 0.9rem;
}

.portal-admin-upload-log summary {
  cursor: pointer;
  font-weight: 600;
}

.portal-admin-upload-log pre {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(10, 12, 20, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.16);
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.portal-modal-open {
  overflow: hidden;
}

.portal-uploading {
  overflow: hidden;
}

.portal-upload-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 120;
  background: rgba(5, 8, 14, 0.46);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
}

.portal-upload-overlay.is-open {
  display: flex;
}

.portal-upload-overlay-card {
  width: min(460px, 100%);
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(170deg, rgba(10, 16, 30, 0.97), rgba(12, 18, 34, 0.94));
  border: 1px solid rgba(255, 154, 57, 0.34);
  box-shadow: 0 28px 54px rgba(0, 0, 0, 0.5);
}

.portal-upload-overlay-card > strong {
  font-size: 1rem;
  line-height: 1.3;
  word-break: break-word;
}

.portal-upload-overlay-card > span {
  color: var(--portal-muted);
  font-size: 0.9rem;
}

.portal-upload-overlay-spinner {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 3px solid rgba(148, 163, 184, 0.28);
  border-top-color: rgba(255, 154, 57, 0.96);
  animation: portal-upload-spin 0.85s linear infinite;
}

@keyframes portal-upload-spin {
  to {
    transform: rotate(360deg);
  }
}

.portal-upload-progress {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.2);
  border: 1px solid rgba(148, 163, 184, 0.26);
}

.portal-upload-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff9e2f, #ff6d1f 50%, #ffc25a 100%);
  box-shadow: 0 0 14px rgba(255, 122, 36, 0.48);
  transition: width 0.16s ease;
}

.portal-upload-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.portal-upload-progress-meta span {
  font-weight: 700;
  color: #ffd9a1;
}

.portal-upload-progress-meta button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.portal-article-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 280px);
  gap: 22px;
  align-items: start;
  --editor-toolbar-offset: 0px;
}

.portal-article-editor-main {
  display: grid;
  gap: 18px;
}

.portal-article-editor-aside {
  display: grid;
  gap: 16px;
  position: sticky;
  top: 16px;
}

.portal-editor-hero {
  display: grid;
  gap: 12px;
  user-select: none;
}

.portal-editor-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  position: relative;
  z-index: 2;
}

.portal-editor-meta-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 160px);
  gap: 12px;
}

.portal-editor-title-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
}

.portal-editor-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: clamp(1.6rem, 2.6vw, 2.4rem);
  font-weight: 700;
}

.portal-editor-input {
  width: 100%;
}

.portal-editor-lead {
  min-height: 92px;
  font-size: 1rem;
}

.portal-editor-tags {
  display: grid;
  gap: 10px;
}

.portal-editor-tags-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.portal-editor-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(10, 12, 20, 0.65);
}

.portal-editor-card-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.portal-editor-card-summary {
  min-height: 72px;
}

.portal-editor-card-preview {
  display: grid;
  gap: 12px;
  user-select: none;
}

.portal-editor-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  position: relative;
  z-index: 2;
}

.portal-editor-sidebar {
  min-height: 140px;
}

.portal-admin-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  position: relative;
  z-index: 2;
}

.portal-admin-editor-help {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px dashed rgba(148, 163, 184, 0.2);
  background: rgba(10, 12, 20, 0.55);
  color: var(--portal-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.portal-admin-editor-help strong {
  color: var(--portal-text);
  font-size: 0.95rem;
}

.portal-editor-title-row .portal-button,
.portal-editor-hero-actions .portal-button,
.portal-editor-card-actions .portal-button,
.portal-admin-editor-toolbar .portal-button {
  position: relative;
  z-index: 3;
  flex-shrink: 0;
}

#hero-preview-frame,
#card-preview-frame {
  pointer-events: auto;
  user-select: none;
}

.portal-media-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(4, 6, 12, 0.75);
  z-index: 70;
  padding: 24px;
}

.portal-media-modal.is-open {
  display: flex;
}

.portal-media-modal-card {
  width: min(980px, 100%);
  max-height: 92vh;
  overflow: auto;
  display: grid;
  gap: 16px;
  background: rgba(12, 16, 28, 0.98);
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 18px;
}

.portal-media-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.portal-media-modal-status {
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--portal-muted);
}

.portal-media-modal-status[data-tone="error"] {
  color: #ffb3a1;
}

.portal-media-modal-status[data-tone="ok"] {
  color: #ffd9a1;
}

.portal-media-modal-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.portal-media-modal-options {
  display: grid;
  gap: 16px;
}

.portal-media-modal-group {
  display: grid;
  gap: 8px;
}

.portal-media-modal-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.portal-media-modal-buttons button {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(10, 12, 20, 0.7);
  color: var(--portal-text);
  cursor: pointer;
}

.portal-media-modal-buttons button.is-active {
  border-color: rgba(255, 140, 0, 0.7);
  background: rgba(255, 140, 0, 0.18);
  color: #fff;
}

.portal-media-modal-buttons button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.portal-media-modal-source {
  display: grid;
  gap: 10px;
}

.portal-media-modal-upload {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.portal-media-modal-upload input[type="file"] {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.portal-media-dropzone {
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: 14px;
  border: 1px dashed rgba(148, 163, 184, 0.3);
  background: rgba(10, 12, 20, 0.55);
  color: var(--portal-text);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.portal-media-dropzone strong {
  font-size: 0.95rem;
}

.portal-media-dropzone span {
  font-size: 0.85rem;
  color: var(--portal-muted);
}

.portal-media-dropzone.is-dragover {
  border-color: rgba(255, 140, 0, 0.65);
  background: rgba(255, 140, 0, 0.12);
}

.portal-media-modal-preview {
  display: grid;
  gap: 12px;
  align-items: start;
}

.portal-media-modal .portal-media-frame {
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.portal-media-modal .portal-media-frame .portal-media-asset {
  user-select: none;
  -webkit-user-drag: none;
  object-fit: contain;
}

.portal-media-modal .portal-media-frame:active {
  cursor: grabbing;
}

.portal-media-modal-sliders {
  display: grid;
  gap: 10px;
}

.portal-media-modal-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 10px;
  align-items: center;
}

.portal-media-modal-inputs input[type="number"] {
  width: 100%;
}

.portal-media-modal-position {
  display: grid;
  gap: 10px;
}

.portal-media-modal-position label {
  display: grid;
  gap: 6px;
}

.portal-media-modal-tip {
  font-size: 0.85rem;
  color: var(--portal-muted);
}

.portal-media-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.portal-media-library {
  display: grid;
  gap: 10px;
}

.portal-media-library-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(8, 10, 18, 0.85);
}

.portal-media-library-thumb {
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(12, 16, 28, 0.8);
}

.portal-media-library-thumb img,
.portal-media-library-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.portal-media-library-meta {
  font-size: 0.85rem;
  color: var(--portal-muted);
  word-break: break-word;
}

.portal-media-library-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.portal-admin label {
  display: grid;
  gap: 6px;
  font-weight: 600;
}

.portal-admin input,
.portal-admin textarea,
.portal-admin select {
  background: rgba(10, 12, 20, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--portal-text);
  font-size: 0.95rem;
}

.portal-admin textarea {
  min-height: 140px;
  resize: vertical;
}

.portal-admin-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 280px);
  gap: 16px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 12, 20, 0.6);
}

.portal-admin-preview-note {
  display: grid;
  gap: 8px;
  color: var(--portal-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.portal-admin-preview-note strong {
  color: var(--portal-text);
  font-size: 1rem;
}

.portal-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.portal-admin code {
  background: rgba(255, 140, 0, 0.12);
  padding: 2px 6px;
  border-radius: 6px;
}

.portal-admin-section {
  display: grid;
  gap: 16px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(10, 12, 20, 0.55);
}

.portal-admin-section h3 {
  margin: 0;
  font-size: 1.05rem;
}

.portal-admin-muted {
  color: var(--portal-muted);
  margin: 0;
}

.portal-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.portal-admin-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.portal-admin-inline input[type="checkbox"] {
  accent-color: var(--portal-accent);
}

.portal-admin-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.portal-admin-media-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(8, 10, 18, 0.8);
}

.portal-admin-media-thumb {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: rgba(15, 18, 28, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.portal-admin-media-thumb img,
.portal-admin-media-thumb video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.portal-admin-media-meta {
  font-size: 0.85rem;
  color: var(--portal-muted);
  word-break: break-word;
}

.portal-admin-media-actions {
  display: grid;
  gap: 8px;
}

.portal-admin-media-layout {
  width: 100%;
}

.portal-admin-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--portal-muted);
}

.portal-admin-checkbox input[type="checkbox"] {
  accent-color: var(--portal-accent);
}

.portal-admin-empty {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px dashed rgba(148, 163, 184, 0.25);
  color: var(--portal-muted);
}

.portal-admin-editor {
  gap: 18px;
}

.portal-admin-editor-body {
  display: block;
}

.portal-admin-editor-main {
  min-width: 0;
}

.portal-admin-editor-toolbar--aside {
  display: grid;
  gap: 8px;
  position: sticky;
  top: 16px;
  align-content: start;
  margin: var(--editor-toolbar-offset) 0 14px;
}

.portal-admin-editor-toolbar--aside .portal-button {
  width: 100%;
  justify-content: center;
}

.portal-admin-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.portal-admin-editor-modes {
  display: flex;
  gap: 8px;
}

.portal-admin-editor-mode {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 140, 0, 0.45);
  background: rgba(255, 140, 0, 0.14);
  color: #fff;
  font-size: 0.9rem;
  white-space: nowrap;
}

.portal-admin-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.portal-admin-raw {
  width: 100%;
  min-height: 620px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 16px;
  background: rgba(10, 12, 20, 0.85);
  color: #fff;
  font-family: "Manrope", sans-serif;
  font-size: 0.98rem;
  line-height: 1.6;
}

.portal-editor-ready .portal-admin-raw {
  display: none;
}

.portal-editor .toastui-editor-defaultUI {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 16px;
  background: rgba(10, 12, 20, 0.85);
}

.portal-editor .toastui-editor-toolbar {
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  background: rgba(8, 10, 18, 0.9);
}

.portal-editor .toastui-editor-toolbar-group {
  border-right: 1px solid rgba(148, 163, 184, 0.1);
}

.portal-editor .toastui-editor-toolbar-icons {
  filter: saturate(0.8) brightness(1.2);
}

.portal-editor .toastui-editor-contents {
  color: var(--portal-text);
  font-family: "Space Grotesk", sans-serif;
  line-height: 1.7;
  font-size: 1.02rem;
  overflow-wrap: anywhere;
}

.portal-editor .toastui-editor-contents::after {
  content: "";
  display: block;
  clear: both;
}


.portal-editor .toastui-editor-contents > * {
  margin: 0;
}

.portal-editor .toastui-editor-contents p {
  margin: 0 0 16px;
}

.portal-editor .toastui-editor-contents p:last-child {
  margin-bottom: 0;
}

.portal-editor .toastui-editor-contents ul,
.portal-editor .toastui-editor-contents ol {
  margin: 0 0 16px;
  padding-left: 1.4rem !important;
  list-style-position: outside !important;
}

.portal-editor .toastui-editor-contents ul {
  list-style-type: disc !important;
}

.portal-editor .toastui-editor-contents ol {
  list-style-type: decimal !important;
}

.portal-editor .toastui-editor-contents li {
  margin: 0;
}

.portal-editor .toastui-editor-contents li + li {
  margin-top: 6px;
}

.portal-editor .toastui-editor-contents li::marker {
  color: currentColor;
}

.portal-editor .toastui-editor-contents blockquote {
  margin: 18px 0;
}

.portal-editor .toastui-editor-contents hr {
  margin: 24px 0;
}

.portal-editor .toastui-editor-contents .portal-callout {
  margin: 20px 0;
}

.portal-content ul,
.portal-content ol {
  margin: 0 0 16px;
  padding-left: 1.4rem;
  list-style-position: outside;
}

.portal-content ul {
  list-style-type: disc;
}

.portal-content ol {
  list-style-type: decimal;
}

.portal-content li {
  margin: 0;
}

.portal-content li::marker {
  color: currentColor;
}

.portal-editor .toastui-editor-contents h2 {
  margin: 32px 0 10px;
  font-size: 1.4rem;
}

.portal-editor .toastui-editor-contents h3 {
  margin: 26px 0 8px;
  font-size: 1.2rem;
}

.portal-editor .toastui-editor-contents h4 {
  margin: 22px 0 6px;
}

.portal-editor .toastui-editor-contents img {
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.portal-editor .toastui-editor-contents img.portal-editor-media {
  display: block;
  background: rgba(12, 16, 28, 0.9);
  box-shadow: var(--portal-shadow);
  object-fit: contain;
  object-position: center;
  transform: translate(var(--media-offset-x, 0%), var(--media-offset-y, 0%)) scale(var(--media-scale, 1));
  transform-origin: center;
}

.portal-editor .toastui-editor-contents img.portal-editor-media[data-media-shape="wide"],
.portal-editor .toastui-editor-contents a.portal-editor-media-link[data-media-shape="wide"] {
  width: 100%;
  aspect-ratio: 23 / 11;
  float: none;
  margin: 8px 0 18px;
}

.portal-editor .toastui-editor-contents img.portal-editor-media[data-media-shape^="portrait"],
.portal-editor .toastui-editor-contents a.portal-editor-media-link[data-media-shape^="portrait"] {
  width: min(38%, 360px);
  aspect-ratio: 3 / 4;
  margin: 8px auto 18px;
}

.portal-editor .toastui-editor-contents img.portal-editor-media[data-media-shape="square"],
.portal-editor .toastui-editor-contents a.portal-editor-media-link[data-media-shape="square"] {
  width: min(34%, 320px);
  aspect-ratio: 1 / 1;
  margin: 8px auto 18px;
}

.portal-editor .toastui-editor-contents img.portal-editor-media[data-media-wrap="left"],
.portal-editor .toastui-editor-contents a.portal-editor-media-link[data-media-wrap="left"],
.portal-editor .toastui-editor-contents img.portal-editor-media[data-media-wrap="auto"][data-media-shape="portrait-left"],
.portal-editor .toastui-editor-contents a.portal-editor-media-link[data-media-wrap="auto"][data-media-shape="portrait-left"] {
  float: left;
  margin: 6px 22px 16px 0;
}

.portal-editor .toastui-editor-contents img.portal-editor-media[data-media-wrap="right"],
.portal-editor .toastui-editor-contents a.portal-editor-media-link[data-media-wrap="right"],
.portal-editor .toastui-editor-contents img.portal-editor-media[data-media-wrap="auto"][data-media-shape="portrait-right"],
.portal-editor .toastui-editor-contents a.portal-editor-media-link[data-media-wrap="auto"][data-media-shape="portrait-right"] {
  float: right;
  margin: 6px 0 16px 22px;
}

.portal-editor .toastui-editor-contents img.portal-editor-media[data-media-wrap="auto"][data-media-shape="square"][data-media-align="left"],
.portal-editor .toastui-editor-contents a.portal-editor-media-link[data-media-wrap="auto"][data-media-shape="square"][data-media-align="left"] {
  float: left;
  margin: 6px 22px 16px 0;
}

.portal-editor .toastui-editor-contents img.portal-editor-media[data-media-wrap="auto"][data-media-shape="square"][data-media-align="right"],
.portal-editor .toastui-editor-contents a.portal-editor-media-link[data-media-wrap="auto"][data-media-shape="square"][data-media-align="right"] {
  float: right;
  margin: 6px 0 16px 22px;
}

.portal-editor .toastui-editor-contents img.portal-editor-media[data-media-wrap="none"],
.portal-editor .toastui-editor-contents a.portal-editor-media-link[data-media-wrap="none"] {
  float: none;
}

.portal-editor .toastui-editor-contents img.portal-editor-media[data-media-wrap="none"][data-media-align="left"],
.portal-editor .toastui-editor-contents a.portal-editor-media-link[data-media-wrap="none"][data-media-align="left"] {
  margin: 8px auto 18px 0;
}

.portal-editor .toastui-editor-contents img.portal-editor-media[data-media-wrap="none"][data-media-align="right"],
.portal-editor .toastui-editor-contents a.portal-editor-media-link[data-media-wrap="none"][data-media-align="right"] {
  margin: 8px 0 18px auto;
}

.portal-editor .toastui-editor-contents a.portal-editor-media-link {
  display: block;
  border-radius: 18px;
  border: 1px solid rgba(255, 140, 0, 0.35);
  background: rgba(12, 16, 28, 0.9);
  box-shadow: var(--portal-shadow);
  position: relative;
  color: transparent;
  text-decoration: none;
  overflow: hidden;
}

.portal-editor .toastui-editor-contents a.portal-editor-media-link:hover {
  color: transparent;
}

.portal-editor .toastui-editor-contents a.portal-editor-media-link::before {
  content: "Видео";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #ffd9a1;
  font-weight: 600;
  letter-spacing: 0.02em;
}


.portal-editor .toastui-editor-contents figure {
  margin: 0;
  display: grid;
  gap: 10px;
}

.portal-editor .toastui-editor-contents figcaption {
  color: var(--portal-muted);
  font-size: 0.9rem;
}

.portal-editor .toastui-editor-contents a {
  color: #ffd9a1;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.portal-editor .toastui-editor-contents a:hover {
  color: #ffffff;
}

.portal-context-menu {
  position: fixed;
  z-index: 50;
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  min-width: 180px;
  border-radius: 12px;
  background: rgba(8, 10, 18, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.portal-context-menu.is-visible {
  display: flex;
}

.portal-context-menu button {
  background: transparent;
  border: 1px solid transparent;
  color: var(--portal-text);
  text-align: left;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
}

.portal-context-menu button:hover {
  border-color: rgba(255, 140, 0, 0.6);
  color: var(--portal-accent);
}

.portal-button--small {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.portal-footer {
  margin-top: auto;
  border-top: 1px solid var(--portal-line);
  background: rgba(10, 12, 18, 0.92);
}

.portal-footer-inner {
  max-width: 1200px;
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 26px 24px 34px;
  display: grid;
  gap: 12px;
  color: var(--portal-muted);
}

.portal-footer a {
  color: var(--portal-text);
  text-decoration: none;
  font-weight: 600;
}

.portal-footer a:hover {
  color: var(--portal-accent);
}

@media (max-width: 1080px) {
  .portal-hero {
    grid-template-columns: 1fr;
    padding: 28px;
  }

  .portal-hero-content {
    order: 1;
  }

  .portal-hero-panel {
    order: 2;
  }

  .portal-featured {
    grid-template-columns: 1fr;
  }

  .portal-media-featured {
    width: 100%;
    height: auto;
    aspect-ratio: 23 / 11;
  }

  .portal-article-grid {
    grid-template-columns: 1fr;
  }
  .portal-article-layout {
    grid-template-columns: 1fr;
  }

  .portal-admin-editor-toolbar--aside {
    position: static;
    display: flex;
    flex-wrap: wrap;
    margin: 0 0 14px;
  }

  .portal-article--media-left .portal-article-media,
  .portal-article--media-right .portal-article-media {
    float: none;
    width: 100%;
    margin: 0 0 18px;
  }

  .portal-media-block.is-portrait,
  .portal-media-block--portrait,
  .portal-media-block--square {
    width: min(46%, 240px);
  }

  .portal-media-block--left {
    margin: 6px 16px 14px 0;
  }

  .portal-media-block--right {
    margin: 6px 0 14px 16px;
  }

  .portal-editor .toastui-editor-contents img.portal-editor-media[data-media-shape="wide"],
  .portal-editor .toastui-editor-contents a.portal-editor-media-link[data-media-shape="wide"] {
    width: 100%;
    margin: 8px 0 18px;
  }

  .portal-editor .toastui-editor-contents img.portal-editor-media[data-media-shape^="portrait"],
  .portal-editor .toastui-editor-contents a.portal-editor-media-link[data-media-shape^="portrait"],
  .portal-editor .toastui-editor-contents img.portal-editor-media[data-media-shape="square"],
  .portal-editor .toastui-editor-contents a.portal-editor-media-link[data-media-shape="square"] {
    width: min(46%, 240px);
  }
}

@media (max-width: 1070px) {
  .portal-topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-areas: "brand nav cta about";
    align-items: center;
    gap: 10px 12px;
    padding: 12px 20px 14px;
    width: min(1200px, calc(100% - 32px));
  }

  .portal-topbar-card {
    border-radius: 24px;
    padding-inline: 20px;
  }

  .portal-topbar-links {
    display: contents;
  }

  .portal-actions--header {
    justify-content: flex-end;
    gap: 8px;
    justify-self: end;
  }

  .portal-nav {
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
    flex-wrap: nowrap;
  }

  .portal-nav-link {
    padding: 6px 12px;
    font-size: 0.92rem;
  }

  .portal-button {
    padding: 8px 12px;
    font-size: 0.9rem;
  }

  .portal-button-telegram {
    width: auto;
    white-space: nowrap;
  }

  .portal-nav-link--official {
    display: none;
  }

  .portal-brand {
    justify-self: start;
  }

  .portal-button--about {
    justify-self: end;
  }

  .portal-topbar.portal-topbar--nav-wrap {
    grid-template-areas:
      "brand cta about about"
      "nav nav nav nav";
  }

  .portal-topbar.portal-topbar--nav-wrap .portal-nav {
    justify-content: flex-start;
  }
}

@media (max-width: 960px) {
  .portal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-tile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-featured {
    padding: 20px;
  }

  .portal-article {
    padding: 24px;
  }

  .portal-admin-preview {
    grid-template-columns: 1fr;
  }

  .portal-admin-editor-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .portal-article-editor {
    grid-template-columns: 1fr;
  }

  .portal-editor-title-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .portal-editor-meta-row {
    grid-template-columns: 1fr;
  }

  .portal-article-editor-aside {
    position: static;
  }

  .portal-media-modal-body {
    grid-template-columns: 1fr;
  }

  .portal-media-modal-inputs {
    grid-template-columns: 1fr;
  }

  .setup-video-layout {
    grid-template-columns: minmax(0, 1fr) clamp(280px, 38vw, 420px);
  }

  .setup-hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "main"
      "extra"
      "card";
  }

}

@media (min-width: 780px) and (max-width: 960px) {
  .setup-hero-extra {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 10px;
  }

  .setup-hero-actions {
    margin: 0;
    flex-wrap: nowrap;
    gap: 10px;
    flex: 0 0 auto;
  }

  .setup-hero-actions .portal-button {
    white-space: nowrap;
    padding: 9px 14px;
    font-size: 0.98rem;
  }

  .setup-badges {
    margin: 0;
    flex-wrap: nowrap;
    gap: 5px;
    flex: 0 1 auto;
    min-width: 0;
  }

  .setup-badge {
    white-space: nowrap;
    padding: 4px 9px;
    font-size: clamp(0.74rem, 1.05vw, 0.82rem);
  }

  .portal-setup-windows .setup-hero-extra {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
  }

  .portal-setup-windows .setup-hero-actions {
    flex: 0 0 auto;
  }

  .portal-setup-windows .setup-badges {
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: wrap;
  }
}

@media (max-width: 860px) {
  .portal-topbar-card {
    border-radius: 24px;
  }

  .portal-topbar-links {
    gap: 10px;
  }

  .portal-nav {
    width: 100%;
    flex-wrap: wrap;
    overflow-x: visible;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
  }

  .portal-nav-link {
    flex: 0 0 auto;
  }

  .portal-actions--header {
    justify-content: center;
  }

  .portal-button-telegram {
    width: auto;
  }

  .portal-nav::-webkit-scrollbar {
    display: none;
  }

  .setup-video-layout {
    grid-template-columns: minmax(0, 1fr) clamp(260px, 42vw, 380px);
  }
}

@media (max-width: 720px) {
  .portal-topbar {
    border-radius: 22px;
    padding: 12px 16px;
  }

  .portal-topbar-links {
    width: 100%;
  }

  .portal-nav-link--official {
    display: none;
  }

  .portal-main {
    padding: 24px 18px 50px;
  }

  .portal-main .portal-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .portal-main .portal-actions .portal-button {
    width: 100%;
    justify-content: center;
  }

  .portal-hero .portal-actions {
    width: auto;
    flex-wrap: nowrap;
  }

  .portal-hero .portal-actions .portal-button {
    width: auto;
    padding: 9px 12px;
    font-size: clamp(0.82rem, 2.8vw, 0.95rem);
  }

  .portal-section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .portal-section-title {
    font-size: 1.35rem;
  }

  .setup-hero {
    padding: 22px;
  }

  .setup-hero-actions {
    width: 100%;
  }

  .setup-hero-actions .portal-button {
    width: 100%;
    justify-content: center;
  }

  .setup-video-card {
    padding: 0;
  }

  .setup-video-layout {
    grid-template-columns: minmax(0, 1fr) clamp(240px, 46vw, 340px);
  }

  .setup-step {
    padding: 18px;
  }

  .setup-support {
    padding: 18px;
  }

  .setup-media-frame--video,
  .setup-media-frame--portrait {
    width: 100%;
  }

  .portal-grid {
    grid-template-columns: 1fr;
  }

  .portal-tile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .portal-article {
    padding: 22px;
    border-radius: 22px;
  }

  .portal-card {
    padding: 16px;
    border-radius: 18px;
  }

  .portal-tile {
    padding: 14px;
    border-radius: 18px;
    gap: 6px 10px;
  }

  .portal-meta {
    font-size: 0.85rem;
  }

  .portal-tag {
    font-size: 0.85rem;
  }

  .portal-hero-panel {
    padding: 18px;
  }

  .portal-hero h1 {
    font-size: clamp(1.75rem, 6vw, 2.4rem);
  }

  .portal-hero p {
    font-size: 1rem;
  }

  .portal-content {
    font-size: 0.98rem;
  }

  .portal-admin-actions {
    flex-direction: column;
  }

  .portal-admin-actions .portal-button {
    width: 100%;
    justify-content: center;
  }

  .portal-upload-overlay-card {
    padding: 16px;
    border-radius: 16px;
  }

  .portal-upload-progress-meta {
    flex-wrap: wrap;
  }

  .portal-upload-progress-meta .portal-button {
    width: 100%;
    justify-content: center;
  }

  .portal-filter {
    padding: 14px;
  }

  .portal-filter input {
    height: 48px;
    border-radius: 16px;
  }
}

@media (max-width: 640px) {
  .portal-topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-areas: "brand cta about toggle";
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    width: calc(100% - 24px);
  }

  .portal-topbar-card {
    border-radius: 20px;
    padding-inline: 14px;
  }

  .portal-brand {
    grid-area: brand;
  }

  .portal-nav-toggle {
    display: inline-flex;
    grid-area: toggle;
    justify-self: end;
  }

  .portal-button--about {
    grid-area: about;
    justify-self: end;
  }

  .portal-topbar-links {
    display: contents;
  }

  .portal-actions--header {
    grid-area: cta;
    width: auto;
    justify-content: flex-end;
    justify-self: end;
  }

  .portal-button-telegram {
    width: auto;
    justify-content: center;
    white-space: nowrap;
  }

  .portal-nav {
    grid-area: nav;
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding-bottom: 0;
    overflow-x: visible;
  }

  .portal-topbar.is-open {
    grid-template-areas:
      "brand cta about toggle"
      "nav nav nav nav";
    grid-auto-rows: auto;
  }

  .portal-topbar.is-open .portal-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
  }

  .portal-nav-link {
    text-align: center;
  }

  .portal-topbar--nav-wrap {
    grid-template-areas:
      "brand cta about toggle"
      "nav nav nav nav";
  }

  .portal-topbar--nav-wrap .portal-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
    width: 100%;
    margin-top: 6px;
    justify-content: flex-start;
  }

  .portal-topbar--nav-wrap .portal-nav-link {
    text-align: left;
    justify-content: flex-start;
  }

  .portal-featured {
    padding: 18px;
  }

  .portal-featured-body h3 {
    font-size: 1.1rem;
  }

  .portal-tile-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }

  .portal-tile strong {
    font-size: 0.95rem;
  }

  .portal-tile .portal-meta {
    font-size: 0.82rem;
  }
}

@media (max-width: 674px) {
  .setup-video-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 980px) {
  .setup-step--with-alt.setup-step--reverse .setup-step-list-block {
    display: block;
    max-inline-size: none;
    padding-left: 14px;
  }
}

@media (max-width: 560px) {
  .setup-step {
    --step-media-width: clamp(170px, 40vw, 224px);
    padding: 14px;
  }

  .setup-step--with-alt {
    --step-media-width: clamp(160px, 34vw, 210px);
  }

  .setup-step-media {
    margin: 0 0 8px 14px;
  }

  .setup-step--reverse .setup-step-media {
    margin: 0 14px 8px 0;
  }

  .setup-step--with-alt:not(.setup-step--reverse) .setup-step-media {
    margin-left: 18px;
  }

  .setup-step--with-alt.setup-step--reverse .setup-step-media {
    margin-right: 18px;
  }

  .setup-step--with-alt .setup-step-list {
    padding-left: 1.55rem;
  }

  .setup-step--with-alt .setup-step-list-block {
    padding-left: 14px;
  }

  .setup-step--reverse:not(.setup-step--with-alt) .setup-step-list-block {
    margin-left: 12px;
  }

  .setup-step--reverse:not(.setup-step--with-alt) .setup-step-list {
    padding-left: 1.4rem;
  }

  .setup-step-body h3 {
    font-size: 1.2rem;
  }

  .setup-step--reverse .setup-step-body {
    margin-left: 16px;
  }

  .setup-step-body p,
  .setup-step-list,
  .setup-step-list li {
    font-size: 0.98rem;
  }

  .setup-step-media .portal-media-frame {
    max-width: var(--step-media-width);
  }
}

@media (max-width: 430px), (hover: none) and (pointer: coarse) and (max-width: 520px) {
  .setup-step {
    --step-media-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .setup-step-media {
    order: 2;
    justify-items: start;
    float: none;
    width: 100%;
    margin: 0;
  }

  .setup-step--reverse .setup-step-media {
    float: none;
    margin: 0;
  }

  .setup-step-media .portal-media-frame {
    max-width: 100%;
  }

  .setup-step-body {
    order: 1;
  }

  .setup-step--reverse .setup-step-body {
    margin-left: 0;
  }

  .setup-step--reverse:not(.setup-step--with-alt) .setup-step-list-block {
    margin-left: 0;
  }
}

/* Keep a stronger gutter between image and list in Step 2 on iOS/macOS/Android guides. */
@media (min-width: 431px) and (max-width: 760px) {
  .portal-setup-subscription-gap .setup-steps > .setup-step:nth-child(2).setup-step--reverse .setup-step-media {
    margin-right: clamp(26px, 3.8vw, 36px);
  }
}

@media (min-width: 761px) {
  .portal-setup-subscription-gap .setup-steps > .setup-step:nth-child(2).setup-step--reverse .setup-step-media {
    margin-right: clamp(36px, 4.8vw, 60px);
  }
}

@media (max-width: 540px) {
  .portal-hero {
    padding: 22px;
  }

  .portal-hero .portal-actions .portal-button {
    padding: 8px 10px;
    font-size: clamp(0.78rem, 3.4vw, 0.9rem);
  }

  .portal-hero p {
    font-size: 1rem;
  }

  .portal-hero-panel {
    padding: 16px;
  }

  .portal-actions {
    gap: 8px;
  }

  .portal-button {
    padding: 10px 14px;
    font-size: 0.95rem;
  }

  .portal-nav-link {
    font-size: 0.88rem;
    padding: 6px 10px;
  }

  .portal-filter {
    gap: 12px;
  }

  .portal-filter input {
    width: 100%;
  }

  .portal-filter-chips {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--chip-fit-gap, 8px);
    min-width: 0;
    --chip-fit-font: 0.88rem;
    --chip-fit-pad-y: 6px;
    --chip-fit-pad-x: 10px;
  }

  .portal-filter-chips .portal-chip {
    min-width: 0;
    padding: var(--chip-fit-pad-y, 6px) var(--chip-fit-pad-x, 10px);
    font-size: var(--chip-fit-font, 0.88rem);
    line-height: 1.1;
    letter-spacing: 0;
  }
}

@media (max-width: 420px) {
  .portal-hero .portal-actions .portal-button {
    padding: 7px 9px;
    font-size: clamp(0.74rem, 3.8vw, 0.86rem);
  }
}

@media (max-width: 480px) {
  .portal-topbar-card {
    border-radius: 20px;
    padding: 12px 12px 14px;
  }

  .portal-actions--header {
    display: none;
  }

  .portal-topbar.is-open {
    grid-template-rows: auto auto auto;
  }

  .portal-topbar.is-open .portal-topbar-links {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
    margin-top: 8px;
    align-items: stretch;
  }

  .portal-topbar.is-open .portal-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
    width: 100%;
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .portal-topbar.is-open .portal-actions--header {
    display: flex;
    grid-column: 1 / -1;
    margin-top: 6px;
    justify-content: flex-start;
  }

  .portal-main {
    padding: 22px 14px 44px;
  }

  .portal-article {
    padding: 20px;
  }

  .portal-tile {
    padding: 12px;
    gap: 6px 8px;
  }

  .portal-tile-icon {
    width: 30px;
    height: 30px;
  }

  .portal-tile strong {
    font-size: 0.9rem;
  }

  .portal-tile .portal-meta {
    font-size: 0.8rem;
  }

  .portal-footer-inner {
    padding: 22px 16px 28px;
  }
}

/* --- Header rebuild (January 2026) -------------------------------------- */
.lp-header {
  position: sticky;
  top: 0;
  z-index: 90;
  padding: 8px 0 8px;
  background: linear-gradient(180deg, rgba(10, 12, 18, 0.35) 0%, rgba(10, 12, 18, 0) 85%);
  backdrop-filter: blur(18px);
  position: sticky;
  isolation: isolate;
}

.lp-header::before {
  content: "";
  position: absolute;
  inset: -60px 0 10px 0;
  background: radial-gradient(1500px 820px at 50% 18%, rgba(255, 120, 80, 0.14) 0%, rgba(120, 180, 255, 0.08) 40%, rgba(10, 12, 18, 0) 80%);
  filter: blur(46px);
  z-index: -1;
  pointer-events: none;
}

.lp-bar {
  width: min(1200px, calc(100% - 28px));
  margin: 0 auto;
  padding: 14px 16px 16px;
  border-radius: 24px;
  background: #0b0d12;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  grid-template-areas: "brand nav cta about burger";
  gap: 10px 14px;
  align-items: center;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.lp-header a { color: inherit; text-decoration: none; }

.lp-brand {
  grid-area: brand;
  display: inline-flex;
  align-items: center;
  height: 42px;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #ffffff;
}

.lp-brand img {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

.lp-brand span {
  font-size: 1.05rem;
  white-space: nowrap;
  line-height: 1;
}

.lp-nav {
  grid-area: nav;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-wrap: nowrap;
}

.lp-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.lp-chip.is-active {
  border-color: rgba(255, 138, 0, 0.65);
  background: linear-gradient(120deg, rgba(255, 138, 0, 0.32), rgba(255, 61, 0, 0.26));
}

.lp-actions {
  grid-area: cta;
  display: flex;
  gap: 10px;
  justify-self: flex-end;
}

.lp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  line-height: 1;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid transparent;
}

.lp-btn-primary {
  background: linear-gradient(100deg, #ff9d2a 0%, #ff6a00 48%, #ff3d00 100%);
  color: #0b0d12;
  box-shadow: 0 14px 32px rgba(255, 90, 0, 0.35);
}

.lp-btn-ghost {
  background: transparent;
  color: #ffffff;
  border-color: rgba(255, 138, 0, 0.45);
}

.lp-about {
  grid-area: about;
  justify-self: end;
}

.lp-icon {
  width: 20px;
  height: 20px;
}

.lp-burger {
  grid-area: burger;
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(14, 16, 22, 0.72);
  color: #ffffff;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.lp-burger-lines,
.lp-burger-lines::before,
.lp-burger-lines::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  position: relative;
  content: "";
}

.lp-burger-lines::before {
  position: absolute;
  top: -6px;
  left: 0;
}

.lp-burger-lines::after {
  position: absolute;
  top: 6px;
  left: 0;
}

.lp-drawer-cta {
  grid-area: drawer-cta;
  display: none;
  justify-content: flex-start;
}

.lp-drawer-cta .lp-btn {
  width: 100%;
  justify-content: center;
}

.lp-bar > * {
  align-self: center;
}

@media (max-width: 1080px) {
  .lp-chip {
    padding: 7px 12px;
    font-size: 0.92rem;
  }
  .lp-nav {
    gap: 8px;
  }
}

@media (max-width: 980px) {
  .lp-chip {
    padding: 6px 11px;
    font-size: 0.9rem;
  }
  .lp-nav {
    gap: 8px;
    flex-wrap: nowrap;
  }
}

@media (max-width: 930px) {
  .lp-bar {
    grid-template-columns: auto 1fr auto auto;
    grid-template-areas:
      "brand cta about burger";
    width: min(1100px, calc(100% - 20px));
    align-items: center;
  }

  .lp-burger {
    display: inline-flex;
  }

  .lp-nav {
    display: none;
  }

  .lp-bar.is-open {
    grid-template-areas:
      "brand cta about burger"
      "nav nav nav nav"
      "drawer-cta drawer-cta drawer-cta drawer-cta";
  }

  .lp-bar.is-open .lp-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
    align-self: start;
    width: 100%;
  }

  .lp-bar.is-open .lp-chip {
    width: 100%;
    justify-content: center;
  }

  .lp-bar.cta-collapsed .lp-actions {
    display: none;
  }

  .lp-bar.cta-collapsed.is-open .lp-drawer-cta {
    display: flex;
  }
}

@media (max-width: 640px) {
  .lp-bar {
    padding: 12px 12px 12px;
    grid-template-columns: auto 1fr auto;
    align-items: center;
  }

  .lp-brand img {
    width: 32px;
    height: 32px;
  }
}

/* Admin analytics dashboard */
.portal-analytics-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
  padding: 16px;
  border: 1px solid rgba(128, 154, 255, 0.2);
  border-radius: 16px;
  background: rgba(9, 17, 34, 0.74);
}

.portal-analytics-presets {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.portal-analytics-presets .portal-chip {
  appearance: none;
  font: inherit;
  cursor: pointer;
  background: rgba(10, 16, 32, 0.75);
}

.portal-analytics-filters label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: rgba(221, 228, 255, 0.84);
}

.portal-analytics-filters input,
.portal-analytics-filters select {
  border: 1px solid rgba(128, 154, 255, 0.3);
  background: rgba(7, 16, 35, 0.75);
  color: #f0f5ff;
  border-radius: 10px;
  padding: 10px 12px;
}

.portal-analytics-filter-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.portal-analytics-export {
  position: relative;
}

.portal-analytics-export summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 138, 0, 0.45);
  background: rgba(255, 138, 0, 0.11);
  color: #ffd9b3;
  font-weight: 600;
}

.portal-analytics-export summary::-webkit-details-marker {
  display: none;
}

.portal-analytics-export-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 5;
  min-width: 220px;
  display: grid;
  gap: 4px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid rgba(128, 154, 255, 0.26);
  background: rgba(9, 15, 28, 0.96);
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.35);
}

.portal-analytics-export-menu a {
  color: #e7f0ff;
  text-decoration: none;
  border-radius: 8px;
  padding: 7px 9px;
}

.portal-analytics-export-menu a:hover {
  background: rgba(255, 255, 255, 0.08);
}

.portal-analytics-meta {
  margin-top: 14px;
  color: rgba(214, 226, 255, 0.84);
  font-size: 0.92rem;
}

.portal-analytics-meta p {
  margin: 4px 0;
}

.portal-analytics-alerts {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.portal-analytics-alert {
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(128, 154, 255, 0.22);
  background: rgba(9, 18, 37, 0.75);
}

.portal-analytics-alert.is-warning {
  border-color: rgba(255, 180, 84, 0.45);
  background: rgba(255, 180, 84, 0.13);
}

.portal-analytics-alert.is-info {
  border-color: rgba(77, 163, 255, 0.45);
  background: rgba(77, 163, 255, 0.13);
}

.portal-analytics-empty {
  margin-top: 16px;
  padding: 16px;
  border-radius: 14px;
  border: 1px dashed rgba(255, 180, 84, 0.45);
  background: rgba(255, 180, 84, 0.12);
}

.portal-analytics-empty h3 {
  margin: 0 0 8px;
}

.portal-analytics-empty p {
  margin: 0;
}

.portal-analytics-empty-meta {
  margin-top: 8px;
  font-size: 0.9rem;
  color: rgba(225, 233, 255, 0.86);
}

.portal-analytics-summary {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
}

.portal-analytics-card {
  border: 1px solid rgba(128, 154, 255, 0.25);
  border-radius: 14px;
  padding: 14px;
  background: rgba(9, 18, 38, 0.66);
}

.portal-analytics-card h3 {
  margin: 0;
  font-size: 14px;
  color: #c9d8ff;
}

.portal-analytics-card strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  color: #f4f8ff;
}

.portal-analytics-card p {
  margin: 8px 0 0;
  font-size: 12px;
  color: rgba(219, 230, 255, 0.74);
}

.portal-analytics-delta {
  margin-top: 8px;
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  background: rgba(148, 163, 184, 0.12);
  font-size: 12px;
  font-weight: 600;
}

.portal-analytics-delta.is-up {
  border-color: rgba(116, 240, 211, 0.6);
  background: rgba(116, 240, 211, 0.16);
  color: #c4fff0;
}

.portal-analytics-delta.is-down {
  border-color: rgba(255, 127, 127, 0.62);
  background: rgba(255, 127, 127, 0.16);
  color: #ffd2d2;
}

.portal-analytics-delta.is-neutral {
  color: rgba(227, 234, 255, 0.9);
}

.portal-analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 14px;
}

.portal-analytics-panel {
  border: 1px solid rgba(128, 154, 255, 0.23);
  border-radius: 14px;
  padding: 14px;
  background: rgba(8, 16, 34, 0.7);
  min-height: 300px;
}

.portal-analytics-panel h3 {
  margin: 0 0 10px;
}

.portal-analytics-panel canvas {
  width: 100%;
  height: 240px !important;
}

.portal-analytics-tables {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 14px;
}

.portal-analytics-table {
  border: 1px solid rgba(128, 154, 255, 0.24);
  border-radius: 14px;
  padding: 14px;
  background: rgba(8, 16, 34, 0.68);
  overflow: auto;
}

.portal-analytics-table h3 {
  margin-top: 0;
}

.portal-analytics-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.portal-analytics-table th,
.portal-analytics-table td {
  padding: 8px 6px;
  border-bottom: 1px solid rgba(150, 170, 255, 0.16);
  text-align: left;
  vertical-align: top;
}

.portal-analytics-table code {
  word-break: break-all;
}

@media (max-width: 1240px) {
  .portal-analytics-filters {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }
}

@media (max-width: 1100px) {
  .portal-analytics-summary {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .portal-analytics-grid {
    grid-template-columns: 1fr;
  }

  .portal-analytics-tables {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 860px) {
  .portal-analytics-filters {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .portal-analytics-tables {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .portal-analytics-filters {
    grid-template-columns: 1fr;
  }

  .portal-analytics-summary {
    grid-template-columns: 1fr;
  }

  .portal-analytics-filter-actions {
    align-items: stretch;
  }

  .portal-analytics-filter-actions .portal-button {
    width: 100%;
    text-align: center;
  }

  .portal-analytics-export {
    width: 100%;
  }

  .portal-analytics-export summary {
    width: 100%;
    text-align: center;
  }

  .portal-analytics-export-menu {
    left: 0;
    right: 0;
  }
}
