:root { color-scheme: dark; }
html, body { 
  margin: 0; 
  padding: 0; 
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; 
  background: linear-gradient(135deg, #2F2F2F 0%, #1A1A1A 100%); 
  color: #FFFFFF; 
  min-height: 100vh;
}
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 80%, rgba(194,178,128,0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(210,105,30,0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}
.container { width: min(1100px, 92vw); margin: 0 auto; }
.topbar { 
  position: sticky; 
  top: 0; 
  z-index: 10; 
  backdrop-filter: blur(12px); 
  background: rgba(47,47,47,0.9); 
  border-bottom: 2px solid #C2B280; 
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.topbar .brand { 
  color: #FFFFFF; 
  text-decoration: none; 
  font-weight: 700; 
  letter-spacing: 1px; 
  font-size: 18px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.topbar .container { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; }
.nav-link { 
  color: #C2B280; 
  text-decoration: none; 
  margin-left: 20px; 
  padding: 10px 16px; 
  border-radius: 6px; 
  transition: all .3s ease; 
  border: 1px solid transparent;
  font-weight: 500;
}
.nav-link:focus, .nav-link:hover { 
  background: rgba(194,178,128,0.15); 
  color: #FFFFFF; 
  border-color: #C2B280;
  outline: 2px solid transparent; 
  transform: translateY(-1px);
}
.skip-link { position: absolute; left: -999px; top: -999px; }
.skip-link:focus { 
  left: 12px; 
  top: 12px; 
  background: rgba(194,178,128,0.2); 
  padding: 8px 10px; 
  border-radius: 8px; 
  color: #FFFFFF;
}
.hero { 
  padding: 60px 0 30px; 
  text-align: center;
  position: relative;
}
.hero::before {
  content: '🔥';
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 48px;
  opacity: 0.8;
  animation: eternal-flame 2s ease-in-out infinite alternate;
  margin-top: 20px;
  margin-bottom: 20px;
}

@keyframes eternal-flame {
  0% {
    transform: translateX(-50%) scale(1) rotate(-2deg);
    opacity: 0.8;
  }
  25% {
    transform: translateX(-50%) scale(1.1) rotate(1deg);
    opacity: 0.9;
  }
  50% {
    transform: translateX(-50%) scale(1.05) rotate(-1deg);
    opacity: 0.85;
  }
  75% {
    transform: translateX(-50%) scale(1.15) rotate(2deg);
    opacity: 0.95;
  }
  100% {
    transform: translateX(-50%) scale(1.08) rotate(-1deg);
    opacity: 0.9;
  }
}

/* Flame animation classes */
.flame-search-appear::before {
  animation: flame-search-appear 0.6s ease-out forwards;
}

.flame-tag-appear::before {
  animation: flame-tag-appear 0.8s ease-out forwards;
}

@keyframes flame-search-appear {
  0% {
    transform: translateX(-50%) scale(0.5) rotate(-10deg);
    opacity: 0;
  }
  50% {
    transform: translateX(-50%) scale(1.3) rotate(5deg);
    opacity: 1;
  }
  100% {
    transform: translateX(-50%) scale(1) rotate(0deg);
    opacity: 0.8;
  }
}

@keyframes flame-tag-appear {
  0% {
    transform: translateX(-50%) scale(0.3) rotate(-15deg);
    opacity: 0;
  }
  30% {
    transform: translateX(-50%) scale(1.5) rotate(10deg);
    opacity: 1;
  }
  60% {
    transform: translateX(-50%) scale(0.8) rotate(-5deg);
    opacity: 0.9;
  }
  100% {
    transform: translateX(-50%) scale(1) rotate(0deg);
    opacity: 0.8;
  }
}
.hero h1 { 
  margin: 30px 0 12px; 
  font-size: 32px; 
  color: #FFFFFF; 
  font-weight: 300;
  letter-spacing: 1px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.hero p {
  font-size: 16px;
  opacity: 0.8;
}
.muted { color: #C2B280; }
.map { 
  width: 100%; 
  height: 70vh; 
  border-radius: 12px; 
  overflow: hidden; 
  box-shadow: 0 8px 24px rgba(0,0,0,.4); 
  border: 2px solid #C2B280; 
}
.footer { 
  border-top: 2px solid #C2B280; 
  margin-top: 40px; 
  padding: 24px 0; 
  color: #C2B280; 
  text-align: center;
  background: rgba(47,47,47,0.5);
}
.small { font-size: 14px; }

/* Search */
.search-section {
  background: linear-gradient(135deg, #C2B280 0%, #8B4513 100%);
  padding: 24px;
  border-radius: 12px;
  margin-bottom: 32px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  border: 2px solid #D2691E;
}
.search-input {
  background: rgba(255,255,255,0.95);
  color: #2F2F2F;
  border: 2px solid #8B3A3A;
  border-radius: 8px;
  padding: 16px 20px;
  font-size: 16px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
  transition: all .3s ease;
  box-sizing: border-box;
  flex: 1;
}
.search-input:focus {
  outline: none;
  border-color: #D2691E;
  box-shadow: 
    inset 0 2px 4px rgba(0,0,0,0.1),
    0 0 0 3px rgba(210,105,30,0.3);
  transform: translateY(-1px);
}
.search-input::placeholder {
  color: #8B3A3A;
  font-style: italic;
}
.active-tags {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.active-tag {
  background: linear-gradient(135deg, #8B3A3A 0%, #6B2A2A 100%);
  color: #FFFFFF;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all .3s ease;
  border: 1px solid #D2691E;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  font-weight: 500;
}
.active-tag:hover {
  background: linear-gradient(135deg, #6B2A2A 0%, #4A1A1A 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}
.active-tag::after {
  content: " ×";
  margin-left: 6px;
  font-weight: bold;
}

/* Source rows */
.source-row { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  background: linear-gradient(135deg, #FFFFFF 0%, #F8F8F8 100%); 
  border: 2px solid #C2B280; 
  border-radius: 12px; 
  padding: 20px 24px; 
  margin-bottom: 12px; 
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: all .3s ease;
  position: relative;
}
.source-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #D2691E 0%, #8B3A3A 100%);
  border-radius: 12px 0 0 12px;
}
.source-row:hover { 
  box-shadow: 0 8px 24px rgba(0,0,0,0.25); 
  transform: translateY(-2px);
  border-color: #D2691E;
}
.source-content { 
  flex: 1; 
  margin-right: 24px; 
}
.source-header { 
  display: flex; 
  align-items: center; 
  gap: 16px; 
  margin-bottom: 8px; 
}
.source-number {
  display: inline-block;
  color: #C2B280;
  font-weight: 700;
  font-size: 0.95em;
  margin-right: 8px;
  opacity: 0.9;
}
.source-title { 
  margin: 0; 
  font-size: 18px; 
  font-weight: 600; 
  color: #2F2F2F; 
  line-height: 1.3;
}
.source-category { 
  background: linear-gradient(135deg, rgba(210,105,30,0.15) 0%, rgba(210,105,30,0.25) 100%); 
  color: #D2691E; 
  padding: 4px 12px; 
  border-radius: 6px; 
  font-size: 12px; 
  font-weight: 600; 
  border: 1px solid rgba(210,105,30,0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.source-description { 
  margin: 0 0 12px; 
  color: #8B3A3A; 
  font-size: 14px; 
  line-height: 1.5; 
  font-style: italic;
}
.source-tags { 
  margin: 0; 
}
.tag { 
  background: linear-gradient(135deg, rgba(194,178,128,0.2) 0%, rgba(194,178,128,0.3) 100%); 
  color: #2F2F2F; 
  padding: 4px 8px; 
  border-radius: 4px; 
  font-size: 11px; 
  margin-right: 6px; 
  margin-bottom: 4px;
  cursor: pointer;
  transition: all .3s ease;
  border: 1px solid rgba(194,178,128,0.4);
  font-weight: 500;
  display: inline-block;
}
.tag:hover {
  background: linear-gradient(135deg, rgba(210,105,30,0.2) 0%, rgba(210,105,30,0.3) 100%);
  border-color: #D2691E;
  color: #D2691E;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tag-active {
  background: linear-gradient(135deg, #D2691E 0%, #B8860B 100%) !important;
  color: #FFFFFF !important;
  border-color: #8B3A3A !important;
  font-weight: 600 !important;
  box-shadow: 0 3px 6px rgba(210,105,30,0.4) !important;
  transform: translateY(-1px) !important;
}
.source-action { 
  flex-shrink: 0; 
}
.source-link { 
  color: #8B3A3A; 
  text-decoration: none; 
  font-weight: 600; 
  font-size: 14px;
  padding: 12px 20px;
  border: 2px solid #8B3A3A;
  border-radius: 8px;
  transition: all .3s ease;
  background: linear-gradient(135deg, rgba(139,58,58,0.05) 0%, rgba(139,58,58,0.1) 100%);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.source-link:hover { 
  background: linear-gradient(135deg, #8B3A3A 0%, #6B2A2A 100%); 
  color: #FFFFFF; 
  text-decoration: none; 
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Forms */
input, textarea, button { 
  background: linear-gradient(135deg, #FFFFFF 0%, #F8F8F8 100%); 
  color: #2F2F2F; 
  border: 2px solid #C2B280; 
  border-radius: 8px; 
  padding: 12px 16px; 
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
  transition: all .3s ease;
}
input:focus, textarea:focus { 
  outline: none; 
  border-color: #D2691E; 
  box-shadow: 
    inset 0 2px 4px rgba(0,0,0,0.1),
    0 0 0 3px rgba(210,105,30,0.3);
  transform: translateY(-1px);
}
button { 
  cursor: pointer; 
  background: linear-gradient(135deg, rgba(210,105,30,0.1) 0%, rgba(210,105,30,0.2) 100%); 
  border-color: #D2691E; 
  color: #D2691E; 
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
button:hover, button:focus { 
  background: linear-gradient(135deg, #D2691E 0%, #B8860B 100%); 
  color: #FFFFFF; 
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}
label span { 
  display: block; 
  margin-bottom: 8px; 
  color: #C2B280; 
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 12px;
}

/* Tables */
table { 
  border: 2px solid #C2B280; 
  background: linear-gradient(135deg, #2F2F2F 0%, #1A1A1A 100%); 
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
th, td { 
  border-bottom: 1px solid rgba(194,178,128,0.3); 
  padding: 12px 16px;
}
td {
  color: #FFFFFF;
  background: transparent;
}
th {
  background: linear-gradient(135deg, #C2B280 0%, #8B4513 100%);
  color: #FFFFFF;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Focus visibility */
:focus { 
  outline: 3px solid #D2691E; 
  outline-offset: 2px; 
}

/* Transitions */
* { 
  transition: color .3s ease, background-color .3s ease, border-color .3s ease, transform .3s ease, box-shadow .3s ease; 
}

/* Additional memorial effects */
.source-row:nth-child(odd) {
  background: linear-gradient(135deg, #FFFFFF 0%, #F5F5F5 100%);
}
.source-row:nth-child(even) {
  background: linear-gradient(135deg, #F8F8F8 0%, #F0F0F0 100%);
}

/* Card styles for stories */
.card {
  background: linear-gradient(135deg, #FFFFFF 0%, #F8F8F8 100%);
  border: 2px solid #C2B280;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: all .3s ease;
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #D2691E 0%, #8B3A3A 100%);
  border-radius: 12px 0 0 12px;
}

.card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  transform: translateY(-2px);
  border-color: #D2691E;
}

.card-link {
  color: inherit;
  text-decoration: none;
  display: block;
}

.card-link:hover {
  text-decoration: none;
}

.card-body {
  padding: 0;
}

.card-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
  color: #2F2F2F;
  line-height: 1.3;
}

.card-title:hover {
  color: #D2691E;
}

/* Memorial scrollbar */
::-webkit-scrollbar {
  width: 12px;
}
::-webkit-scrollbar-track {
  background: #2F2F2F;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #C2B280 0%, #8B4513 100%);
  border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #D2691E 0%, #B8860B 100%);
}

/* Search container */
.search-container {
  display: flex;
  gap: 12px;
  align-items: center;
}

.search-container .search-input {
  flex: 1;
  width: auto;
}

.ai-chat-button {
  background: linear-gradient(135deg, #D2691E 0%, #B8860B 100%);
  color: #FFFFFF;
  border: 2px solid #8B3A3A;
  border-radius: 8px;
  padding: 16px 20px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all .3s ease;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  text-transform: none;
  letter-spacing: normal;
  pointer-events: auto;
  position: relative;
  z-index: 1;
}

.ai-chat-button:hover {
  background: linear-gradient(135deg, #B8860B 0%, #D2691E 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* AI Chat Modal */
.ai-chat-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.ai-chat-modal-content {
  background: linear-gradient(135deg, #2F2F2F 0%, #1A1A1A 100%);
  border: 2px solid #C2B280;
  border-radius: 12px;
  width: min(90vw, 600px);
  height: min(80vh, 700px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.ai-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 2px solid #C2B280;
  background: rgba(194,178,128,0.1);
}

.ai-chat-header h2 {
  margin: 0;
  color: #FFFFFF;
  font-size: 20px;
  font-weight: 600;
}

.ai-chat-close {
  background: transparent;
  border: none;
  color: #C2B280;
  font-size: 32px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all .3s ease;
  line-height: 1;
}

.ai-chat-close:hover {
  background: rgba(194,178,128,0.2);
  color: #FFFFFF;
  transform: rotate(90deg);
}

.ai-chat-warning {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: linear-gradient(135deg, rgba(244, 196, 48, 0.15) 0%, rgba(255, 152, 0, 0.15) 100%);
  border-bottom: 1px solid rgba(255, 152, 0, 0.3);
  border-top: 1px solid rgba(255, 152, 0, 0.3);
  color: #FFC107;
}

.ai-chat-warning-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.ai-chat-warning-text {
  font-size: 13px;
  line-height: 1.4;
  color: #FFC107;
  font-weight: 500;
}

.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ai-chat-message {
  padding: 12px 16px;
  border-radius: 8px;
  max-width: 80%;
  word-wrap: break-word;
  line-height: 1.5;
}

.ai-chat-message-user {
  background: linear-gradient(135deg, #D2691E 0%, #B8860B 100%);
  color: #FFFFFF;
  align-self: flex-end;
  border: 1px solid #8B3A3A;
}

.ai-chat-message-assistant {
  background: linear-gradient(135deg, rgba(194,178,128,0.2) 0%, rgba(194,178,128,0.3) 100%);
  color: #FFFFFF;
  align-self: flex-start;
  border: 1px solid rgba(194,178,128,0.4);
}

/* Markdown стили для сообщений ассистента */
.ai-chat-message-assistant h1,
.ai-chat-message-assistant h2,
.ai-chat-message-assistant h3,
.ai-chat-message-assistant h4,
.ai-chat-message-assistant h5,
.ai-chat-message-assistant h6 {
  color: #FFFFFF;
  margin: 12px 0 8px 0;
  font-weight: 600;
}

.ai-chat-message-assistant h1 { font-size: 1.5em; }
.ai-chat-message-assistant h2 { font-size: 1.3em; }
.ai-chat-message-assistant h3 { font-size: 1.1em; }

.ai-chat-message-assistant p {
  margin: 8px 0;
  line-height: 1.6;
}

.ai-chat-message-assistant ul,
.ai-chat-message-assistant ol {
  margin: 8px 0;
  padding-left: 24px;
}

.ai-chat-message-assistant li {
  margin: 4px 0;
}

.ai-chat-message-assistant code {
  background: rgba(0, 0, 0, 0.3);
  color: #C2B280;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

.ai-chat-message-assistant pre {
  background: rgba(0, 0, 0, 0.3);
  color: #C2B280;
  padding: 12px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 8px 0;
  border: 1px solid rgba(194,178,128,0.3);
}

.ai-chat-message-assistant pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

.ai-chat-message-assistant strong {
  color: #D2691E;
  font-weight: 600;
}

.ai-chat-message-assistant em {
  font-style: italic;
  color: #C2B280;
}

.ai-chat-message-assistant a {
  color: #D2691E;
  text-decoration: underline;
}

.ai-chat-message-assistant a:hover {
  color: #B8860B;
}

.ai-chat-message-assistant blockquote {
  border-left: 3px solid #C2B280;
  padding-left: 12px;
  margin: 8px 0;
  color: #C2B280;
  font-style: italic;
}

.ai-chat-message-assistant hr {
  border: none;
  border-top: 1px solid rgba(194,178,128,0.3);
  margin: 16px 0;
}

.ai-chat-input-container {
  display: flex;
  gap: 12px;
  padding: 20px 24px;
  border-top: 2px solid #C2B280;
  background: rgba(47,47,47,0.5);
}

.ai-chat-input {
  flex: 1;
  background: rgba(255,255,255,0.95);
  color: #2F2F2F;
  border: 2px solid #8B3A3A;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
}

.ai-chat-send {
  background: linear-gradient(135deg, #D2691E 0%, #B8860B 100%);
  color: #FFFFFF;
  border: 2px solid #8B3A3A;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .3s ease;
  white-space: nowrap;
}

.ai-chat-send:hover:not(:disabled) {
  background: linear-gradient(135deg, #B8860B 0%, #D2691E 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.ai-chat-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
  .container {
    width: 95vw;
    padding: 0 8px;
  }
  
  .topbar .container {
    padding: 12px 0;
    flex-direction: column;
    gap: 12px;
  }
  
  .topbar .brand {
    font-size: 16px;
  }
  
  .nav-link {
    margin: 4px 8px;
    padding: 8px 12px;
    font-size: 14px;
  }
  
  .hero {
    padding: 40px 0 20px;
  }
  
  .hero::before {
    top: 5px;
    font-size: 36px;
    margin-top: 15px;
    margin-bottom: 15px;
  }
  
  .hero h1 {
    font-size: 24px;
    margin: 25px 0 8px;
  }
  
  .hero p {
    font-size: 14px;
  }
  
  .search-section {
    padding: 16px;
    margin-bottom: 24px;
  }
  
  .search-input {
    padding: 12px 16px;
    font-size: 14px;
  }

  .search-container {
    flex-direction: row;
    gap: 8px;
  }

  .ai-chat-button {
    flex-shrink: 0;
    padding: 12px 16px;
    font-size: 14px;
    white-space: nowrap;
  }

  .ai-chat-modal-content {
    width: 95vw;
    height: 90vh;
  }

  .ai-chat-header {
    padding: 16px;
  }

  .ai-chat-header h2 {
    font-size: 18px;
  }

  .ai-chat-warning {
    padding: 10px 16px;
    gap: 8px;
  }

  .ai-chat-warning-icon {
    font-size: 18px;
  }

  .ai-chat-warning-text {
    font-size: 12px;
  }

  .ai-chat-messages {
    padding: 16px;
  }

  .ai-chat-message {
    max-width: 90%;
    font-size: 14px;
  }

  .ai-chat-input-container {
    padding: 16px;
    flex-direction: column;
  }

  .ai-chat-send {
    width: 100%;
  }
  
  /* Source rows mobile layout */
  .source-row {
    flex-direction: column;
    padding: 16px;
    gap: 12px;
  }
  
  .source-content {
    margin-right: 0;
    width: 100%;
  }
  
  .source-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .source-title {
    font-size: 16px;
    line-height: 1.4;
  }
  
  .source-description {
    font-size: 13px;
    margin-bottom: 8px;
  }
  
  .source-action {
    width: 100%;
    display: flex;
    justify-content: center;
  }
  
  .source-link {
    width: 100%;
    text-align: center;
    padding: 12px 16px;
    font-size: 13px;
    white-space: nowrap;
    min-width: 0;
    flex-shrink: 1;
  }
  
  .active-tags {
    gap: 6px;
  }
  
  .active-tag {
    padding: 4px 8px;
    font-size: 11px;
  }
  
  .tag {
    font-size: 10px;
    padding: 3px 6px;
    margin-right: 4px;
    margin-bottom: 3px;
  }
  
  /* Stories grid mobile */
  .stories-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .card {
    padding: 12px;
  }
  
  .card-title {
    font-size: 16px;
  }
  
  /* Forms mobile */
  input, textarea, button {
    padding: 10px 12px;
    font-size: 14px;
  }
  
  /* Tables mobile */
  table {
    font-size: 12px;
  }
  
  th, td {
    padding: 8px 10px;
  }
  
  td {
    color: #FFFFFF;
  }
  
  /* Map mobile */
  .map {
    height: 50vh;
    border-radius: 8px;
  }
  
  /* Images mobile */
  img {
    max-width: 100%;
    height: auto;
  }
  
  figure {
    margin: 16px 0;
    text-align: center;
  }
  
  /* Story content mobile */
  .story-body {
    font-size: 14px;
    line-height: 1.6;
  }
  
  .story-body pre {
    font-size: 13px;
    overflow-x: auto;
    padding: 12px;
    background: rgba(47,47,47,0.05);
    border-radius: 8px;
    border: 1px solid rgba(194,178,128,0.3);
  }
  
  /* Footer mobile */
  .footer {
    padding: 16px 0;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .container {
    width: 98vw;
    padding: 0 4px;
  }
  
  .hero h1 {
    font-size: 20px;
    margin: 20px 0 8px;
  }
  
  .hero::before {
    top: 3px;
    font-size: 32px;
    margin-top: 12px;
    margin-bottom: 12px;
  }
  
  .search-section {
    padding: 12px;
  }
  
  .source-row {
    padding: 12px;
  }
  
  .source-title {
    font-size: 15px;
  }
  
  .source-description {
    font-size: 12px;
  }
  
  .source-link {
    padding: 10px 12px;
    font-size: 12px;
  }
  
  .map {
    height: 40vh;
  }
  
  /* Story content extra small screens */
  .story-body {
    font-size: 13px;
  }
  
  .story-body pre {
    font-size: 12px;
    padding: 8px;
  }
  
  /* Admin navigation mobile */
  .admin-nav {
    flex-direction: column;
    gap: 8px;
  }
  
  /* Filters mobile */
  .filters {
    flex-direction: column;
    gap: 8px;
  }
  
  .filters input {
    width: 100%;
  }
  
  /* Pagination mobile */
  nav[aria-label="Пагинация"] {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
  
  /* Lists mobile */
  ul, ol {
    padding-left: 16px;
  }
  
  li {
    margin-bottom: 4px;
  }
}
