.mass-shell {
  max-width: 1260px;
}

.mass-shell .language-switcher {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  direction: ltr;
}

.mass-shell .language-tabs {
  flex: 1 1 auto;
  scroll-behavior: smooth;
  scroll-padding-inline: 42px;
  scroll-snap-type: x mandatory;
  overscroll-behavior-inline: contain;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
}

.mass-shell .language-tab {
  flex: 0 0 auto;
  scroll-snap-align: center;
  scroll-snap-stop: normal;
}

.language-scroll-button {
  display: none;
  flex: 0 0 40px;
  width: 40px;
  min-height: 48px;
  place-items: center;
  border: 1px solid rgba(79, 195, 238, 0.3);
  color: var(--soft);
  background: rgba(8, 18, 24, 0.96);
  font-size: 1.65rem;
  line-height: 1;
  cursor: pointer;
}

.language-scroll-button:first-child {
  border-radius: 8px 0 0 8px;
}

.language-scroll-button:last-child {
  border-radius: 0 8px 8px 0;
}

.language-scroll-button:disabled {
  opacity: 0.32;
  cursor: default;
}

.mass-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  overflow: hidden;
  padding: clamp(28px, 5vw, 58px);
  border: 1px solid rgba(79, 195, 238, 0.28);
  border-radius: 12px;
  background:
    radial-gradient(circle at 82% 20%, rgba(212, 164, 71, 0.2), transparent 26%),
    linear-gradient(130deg, rgba(13, 33, 43, 0.96), rgba(8, 18, 24, 0.96));
  box-shadow: var(--shadow);
}

.mass-hero::after {
  position: absolute;
  top: -120px;
  right: -70px;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(79, 195, 238, 0.16);
  border-radius: 50%;
  content: "";
  box-shadow:
    0 0 0 36px rgba(79, 195, 238, 0.025),
    0 0 0 76px rgba(79, 195, 238, 0.018);
}

.mass-hero > * {
  position: relative;
  z-index: 1;
}

.mass-hero h1 {
  max-width: 820px;
  margin: 6px 0 10px;
  font-family: ui-condensed, "Arial Narrow", Impact, sans-serif;
  font-size: clamp(2.5rem, 6vw, 5.6rem);
  line-height: 0.94;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}

.mass-hero p:last-child {
  max-width: 680px;
  margin: 0;
  color: var(--soft);
  font-size: 1rem;
  line-height: 1.65;
}

.vault-status {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 10px;
  align-items: center;
  padding: 12px 15px;
  border: 1px solid rgba(212, 164, 71, 0.42);
  border-radius: 999px;
  color: var(--gold-2);
  background: rgba(212, 164, 71, 0.09);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.password-gate,
.archive-panel {
  margin-top: 22px;
  border: 1px solid rgba(79, 195, 238, 0.22);
  border-radius: 12px;
  background: rgba(9, 19, 25, 0.94);
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.32);
}

.password-gate {
  display: grid;
  grid-template-columns: auto minmax(0, 0.85fr) minmax(340px, 1.15fr);
  gap: 24px;
  align-items: center;
  padding: clamp(24px, 4vw, 42px);
}

.gate-mark {
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  border: 1px solid rgba(79, 195, 238, 0.36);
  border-radius: 50%;
  color: var(--line-bright);
  background: rgba(79, 195, 238, 0.08);
}

.gate-mark svg {
  width: 34px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.gate-copy h2,
.archive-toolbar h2,
.conversation-heading h2 {
  margin: 5px 0 8px;
  font-family: ui-condensed, "Arial Narrow", Impact, sans-serif;
  font-size: clamp(1.65rem, 3vw, 2.5rem);
  letter-spacing: -0.015em;
  text-transform: uppercase;
}

.gate-copy > p:last-child,
.conversation-heading > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.password-form,
.additional-password-form {
  display: grid;
  gap: 9px;
}

.password-form label,
.additional-password-form label {
  color: var(--soft);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.password-row {
  display: flex;
  gap: 8px;
}

.password-row input,
.conversation-search input {
  min-width: 0;
  border: 1px solid rgba(79, 195, 238, 0.3);
  border-radius: 7px;
  outline: none;
  color: var(--text);
  background: rgba(4, 12, 17, 0.82);
  font: inherit;
}

.password-row input {
  flex: 1 1 auto;
  min-height: 50px;
  padding: 0 14px;
}

.password-row input:focus,
.conversation-search input:focus {
  border-color: var(--line-bright);
  box-shadow: 0 0 0 3px rgba(79, 195, 238, 0.13);
}

.password-row button {
  min-height: 50px;
  padding: 0 20px;
  border: 1px solid var(--gold-2);
  border-radius: 7px;
  color: #0a1115;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  font-weight: 950;
  cursor: pointer;
}

.password-row button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.form-status {
  min-height: 1.25em;
  margin: 0;
  color: #fca5a5;
  font-size: 0.82rem;
}

.archive-panel {
  padding: clamp(20px, 4vw, 38px);
}

.archive-access-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.additional-password-form {
  width: min(100%, 620px);
  margin: 20px 0 0 auto;
  padding: 18px;
  border: 1px solid rgba(212, 164, 71, 0.28);
  border-radius: 9px;
  background: rgba(212, 164, 71, 0.05);
}

.archive-toolbar,
.conversation-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.quiet-button,
.back-button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(79, 195, 238, 0.3);
  border-radius: 7px;
  color: var(--soft);
  background: rgba(79, 195, 238, 0.06);
  font-weight: 850;
  cursor: pointer;
}

.quiet-button:hover,
.quiet-button:focus-visible,
.back-button:hover,
.back-button:focus-visible {
  border-color: var(--line-bright);
  color: var(--text);
  background: rgba(79, 195, 238, 0.12);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 16px;
  margin-top: 22px;
}

.conversation-card {
  position: relative;
  display: grid;
  gap: 18px;
  min-height: 230px;
  padding: 25px;
  overflow: hidden;
  border: 1px solid rgba(79, 195, 238, 0.24);
  border-radius: 10px;
  color: var(--text);
  background:
    linear-gradient(145deg, rgba(79, 195, 238, 0.08), transparent 50%),
    rgba(13, 29, 38, 0.9);
  text-align: start;
  cursor: pointer;
}

.conversation-card::after {
  position: absolute;
  right: -44px;
  bottom: -50px;
  width: 150px;
  height: 150px;
  border: 1px solid rgba(212, 164, 71, 0.15);
  border-radius: 50%;
  content: "";
}

.conversation-card:hover,
.conversation-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--line-bright);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.conversation-card-top,
.conversation-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.conversation-card-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(212, 164, 71, 0.4);
  border-radius: 8px;
  color: var(--gold-2);
  background: rgba(212, 164, 71, 0.08);
  font-size: 1.1rem;
}

.language-chip,
.fallback-chip,
.conversation-meta span {
  padding: 6px 9px;
  border: 1px solid rgba(79, 195, 238, 0.24);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(4, 12, 17, 0.48);
  font-size: 0.7rem;
  font-weight: 850;
}

.conversation-card h3 {
  margin: 0 0 8px;
  font-family: ui-condensed, "Arial Narrow", Impact, sans-serif;
  font-size: 1.65rem;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.conversation-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.conversation-card .conversation-card-collection {
  margin-bottom: 8px;
  color: var(--gold-2);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.conversation-card-meta {
  align-self: end;
  color: var(--gold-2);
  font-size: 0.78rem;
  font-weight: 900;
}

.conversation-reader {
  margin-top: 26px;
  border-top: 1px solid rgba(79, 195, 238, 0.2);
}

.conversation-toolbar {
  position: sticky;
  top: 88px;
  z-index: 12;
  padding: 15px 0;
  background: rgba(9, 19, 25, 0.98);
  box-shadow: 0 12px 18px rgba(9, 19, 25, 0.96);
}

.conversation-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.conversation-search input {
  width: min(42vw, 300px);
  min-height: 42px;
  padding: 0 12px;
}

.conversation-heading {
  padding: 32px 0 26px;
  text-align: center;
}

.conversation-heading > p {
  max-width: 680px;
  margin-inline: auto;
}

.conversation-heading .conversation-collection {
  margin-bottom: 9px;
  color: var(--gold-2);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.conversation-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}

.conversation-timeline {
  width: min(100%, 900px);
  margin: 0 auto;
  padding-bottom: 24px;
}

.document-content {
  display: grid;
  gap: 16px;
  width: min(100%, 820px);
}

.document-heading {
  margin: 24px 0 0;
  padding: 13px 16px;
  border-inline-start: 3px solid var(--gold);
  color: var(--gold-2);
  background: linear-gradient(90deg, rgba(212, 164, 71, 0.12), transparent);
  font-family: ui-condensed, "Arial Narrow", Impact, sans-serif;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.document-paragraph {
  margin: 0;
  padding: 18px 20px;
  border: 1px solid rgba(79, 195, 238, 0.17);
  border-radius: 9px;
  color: var(--soft);
  background: rgba(15, 34, 44, 0.7);
  line-height: 1.7;
}

.strategy-items {
  display: grid;
  gap: 11px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: strategy-item;
}

.strategy-items li {
  position: relative;
  min-height: 54px;
  padding: 16px 18px 16px 66px;
  border: 1px solid rgba(79, 195, 238, 0.18);
  border-radius: 9px;
  color: var(--soft);
  background: rgba(15, 34, 44, 0.74);
  line-height: 1.62;
  counter-increment: strategy-item;
}

.strategy-items li::before {
  position: absolute;
  top: 13px;
  left: 15px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(212, 164, 71, 0.42);
  border-radius: 7px;
  color: var(--gold-2);
  background: rgba(212, 164, 71, 0.08);
  font-weight: 950;
  content: counter(strategy-item);
}

html[dir="rtl"] .strategy-items li {
  padding-right: 66px;
  padding-left: 18px;
}

html[dir="rtl"] .strategy-items li::before {
  right: 15px;
  left: auto;
}

.time-divider {
  display: flex;
  gap: 14px;
  align-items: center;
  margin: 30px 0 17px;
  color: var(--gold-2);
  font-size: 0.75rem;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.time-divider::before,
.time-divider::after {
  flex: 1 1 auto;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(212, 164, 71, 0.34));
}

.time-divider::after {
  background: linear-gradient(90deg, rgba(212, 164, 71, 0.34), transparent);
}

.message-card {
  width: min(78%, 650px);
  margin-bottom: 12px;
  padding: 14px 16px 15px;
  border: 1px solid rgba(79, 195, 238, 0.2);
  border-radius: 4px 14px 14px 14px;
  background: rgba(15, 34, 44, 0.92);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
}

.message-card.alliance-irny {
  margin-right: auto;
  border-left: 3px solid var(--line-bright);
}

.message-card.alliance-fl2 {
  margin-left: auto;
  border-right: 3px solid var(--gold);
  border-radius: 14px 4px 14px 14px;
  background: rgba(40, 32, 19, 0.72);
}

.message-byline {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin-bottom: 7px;
  direction: ltr;
  font-size: 0.77rem;
}

.alliance-badge {
  padding: 3px 6px;
  border-radius: 4px;
  color: #041015;
  background: var(--line-bright);
  font-weight: 950;
}

.alliance-fl2 .alliance-badge {
  background: var(--gold-2);
}

.speaker-name {
  color: var(--text);
  font-weight: 900;
}

.reply-label {
  color: var(--muted);
  font-size: 0.7rem;
}

.message-body {
  margin: 0;
  color: var(--soft);
  line-height: 1.62;
  white-space: pre-wrap;
}

.system-message {
  width: fit-content;
  max-width: min(92%, 720px);
  margin: 10px auto;
  padding: 7px 12px;
  border: 1px solid rgba(149, 170, 180, 0.18);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(149, 170, 180, 0.06);
  font-size: 0.74rem;
  text-align: center;
}

.empty-search {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

html[dir="rtl"] .mass-hero,
html[dir="rtl"] .gate-copy,
html[dir="rtl"] .password-form,
html[dir="rtl"] .additional-password-form,
html[dir="rtl"] .archive-toolbar {
  text-align: right;
}

@media (max-width: 900px) {
  .password-gate {
    grid-template-columns: auto 1fr;
  }

  .password-form {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .mass-shell .topbar-actions {
    flex-wrap: wrap;
  }

  .mass-shell .language-switcher {
    flex-basis: 100%;
    width: 100%;
  }

  .mass-shell .language-tabs {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .language-scroll-button {
    display: grid;
  }

  .mass-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .password-gate {
    grid-template-columns: 1fr;
  }

  .gate-mark {
    width: 60px;
    height: 60px;
  }

  .password-form {
    grid-column: auto;
  }

  .archive-toolbar,
  .archive-access-actions,
  .conversation-toolbar,
  .conversation-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .additional-password-form {
    width: 100%;
    margin-inline: 0;
  }

  .conversation-toolbar {
    position: static;
    top: auto;
    box-shadow: none;
  }

  .conversation-search input {
    width: 100%;
  }

  .message-card {
    width: 92%;
  }
}

@media (max-width: 480px) {
  .password-row {
    flex-direction: column;
  }

  .password-row button {
    width: 100%;
  }

  .mass-hero h1 {
    font-size: 2.35rem;
  }

  .message-card {
    width: 96%;
  }
}

@media print {
  body {
    background: #fff;
    color: #111;
  }

  .topbar,
  .mass-hero,
  .archive-toolbar,
  .additional-password-form,
  .catalog-grid,
  .conversation-toolbar {
    display: none !important;
  }

  .archive-panel,
  .conversation-reader {
    display: block !important;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .message-card,
  .system-message {
    break-inside: avoid;
    color: #111;
    background: #fff;
    box-shadow: none;
  }

  .message-body,
  .conversation-heading > p {
    color: #222;
  }
}
