* { margin:0; padding:0; box-sizing:border-box; }
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f0f2f5;
    color: #1a1a1a;
    line-height: 1.5;
    padding-bottom: 0;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}
/* Шапка */
header {
    background: #1e293b;
    color: #fff;
    padding: 10px 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.logo img { vertical-align: middle; height: 40px; }
nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
nav ul li a {
    color: #e2e8f0;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.95rem;
    transition: background 0.2s;
}
nav ul li a:hover {
    background: #334155;
}
main { padding: 20px 0; }
footer {
    background: #1e293b;
    color: #94a3b8;
    text-align: center;
    padding: 20px 0;
    margin-top: 30px;
    font-size: 0.9rem;
}
/* Карточки */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
}
.card h1, .card h2 {
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 1.5rem;
    color: #0f172a;
}
.card h2 { font-size: 1.25rem; }

.card.contacts p strong {
	width:80px;
	display: inline-block;
}

/* ---- КОМПАКТНЫЙ ФИЛЬТР В ОДНУ СТРОКУ ---- */
.filter-form {
    overflow-x: auto;
    padding-bottom: 4px;
}
.filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.filter-item {
    flex: 0 0 auto;
	width:15%;
}
.filter-item:first-child {
	width:31%;
}
.filter-item input,
.filter-item select {
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.9rem;
    background: #f8fafc;
    min-width: 100px;
	width:100%;
}
.filter-item input:focus,
.filter-item select:focus {
    border-color: #3b82f6;
    outline: none;
    background: #fff;
}
.filter-item .btn {
    padding: 6px 14px;
    font-size: 0.85rem;
}

.tag {
    display: inline-block;
    background: #f1f5f9;
    color: #1e293b;
    padding: 4px 14px;
    border-radius: 30px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s;
}
.tag:hover {
    background: #e2e8f0;
}
/* Тоггл фильтров */
#toggleFilters {
    background: #e2e8f0;
    color: #1e293b;
    border: none;
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}
#toggleFilters:hover {
    background: #cbd5e1;
}

/* ===== Гостевое предупреждение ===== */
.guest-warning {
    background: #fef9e7;
    border-left: 4px solid #f1c40f;
    padding: 10px 16px;
    margin-bottom: 20px;
    border-radius: 6px;
    font-size: 0.95rem;
    color: #7d6608;
}
.guest-warning p {
    margin: 0;
}
.guest-warning strong {
    color: #b7950b;
}

/* ===== Метка обязательного поля ===== */
.required {
    font-weight: 400;
    font-size: 0.75rem;
    color: #e74c3c;
    margin-left: 4px;
}

/* ===== Мета-информация объявления (ID, автор, время) ===== */
.entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 0;
}
.entry-id {
    font-weight: normal;
    color: #64748b;
}
.entry-author {
    color: #3b82f6;
}
.entry-author a {
    color: #3b82f6;
    text-decoration: none;
}
.entry-author a:hover {
    text-decoration: underline;
}
.entry-time {
    color: #94a3b8;
    font-size: 0.85rem;
}

/* ---- ОБЪЯВЛЕНИЯ (НОВЫЙ СТИЛЬ) ---- */
.entry-card {
    border-bottom: 1px solid #e9edf2;
    padding: 14px 0;
    transition: background 0.2s;
}
.entry-card:last-child { border-bottom: none; }
.entry-title {
    font-weight: 600;
    font-size: 1.2rem;
    margin-bottom: 2px;
}
.entry-title a {
    color: #0f172a;
    text-decoration: none;
}
.entry-title a:hover { color: #3b82f6; }
.entry-location a {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-bottom: 6px;
    text-decoration: none;
}
.entry-location a:hover {
    opacity: .7;
}
.entry-main-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
    font-size: 1.05rem;
    font-weight: 500;
    margin: 4px 0 6px;
}
.entry-age {
    font-weight: 600;
    color: #1e293b;
}
.entry-role {
    color: #2563eb;
    font-weight: 600;
}
.entry-body {
    color: #475569;
    font-weight: 400;
}
.entry-details {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 6px;
}
.entry-text {
    color: #334155;
    margin: 4px 0 8px;
    font-size: 0.95rem;
}
.entry-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
    font-size: 0.9rem;
    color: #475569;
}
.entry-stats span { display: inline-flex; align-items: center; gap: 4px; }
.color-dot {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid #ccc;
    vertical-align: middle;
}
.eye-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #334155;
    vertical-align: middle;
    background: #fff;
}

/* ---- ФОРМЫ ---- */
.form-group {
    margin-bottom: 14px;
}
.form-group label {
    display: block;
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 1px;
    color: #64748b;
}
.form-group label span.required {
    color: crimson;
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
    background: #f8fafc;
    transition: border 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: #3b82f6;
    outline: none;
    background: #fff;
}
.form-group textarea {
    min-height: 80px;
    resize: vertical;
}
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.card.details p strong {
	display: inline-block;
    width: 75px;
}
@media (max-width: 640px) {
    .grid-2 { grid-template-columns: 1fr; }
}

/* ---- КНОПКИ ---- */
.btn {
    display: inline-block;
    background: #3b82f6;
    color: #fff;
    padding: 8px 20px;
    border-radius: 30px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
    transition: background 0.2s, transform 0.1s;
}
.account-page .btn {margin: 15px 10px 0 0;}
.btn:hover { background: #2563eb; }
.btn:active { transform: scale(0.97); }
.btn-success { background: #22c55e; }
.btn-success:hover { background: #16a34a; }
.btn-danger { background: #ef4444; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 4px 14px; font-size: 0.85rem; }

/* ---- АДАПТИВНОСТЬ ---- */
@media (max-width: 600px) {
    header .container { flex-direction: column; align-items: stretch; text-align: center; }
    nav ul { justify-content: center; gap:0;}
    nav ul li a { padding:6px 8px;font-size: 0.9rem;}
    .card { padding: 14px; }
    .entry-main-info { font-size: 0.95rem; gap: 8px 12px; }
    .entry-title { font-size: 1.05rem; }
}
@media (max-width: 768px) {
    .filter-row {
        flex-wrap: wrap;
    }
    .filter-row div {
        width:48%;
    }
	.filter-item:first-child {
		width:48%;
	}
    .filter-item input,
    .filter-item select {
        width: 100%;
        font-size: 0.85rem;
    }
}
/* ===== Компактная сетка для формы добавления ===== */
.compact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px 16px;
}
.compact-grid .form-group {
    margin-bottom: 0;
}
.compact-grid .form-group label {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 2px;
}
.compact-grid .form-group input,
.compact-grid .form-group select {
    padding: 8px 10px;
    font-size: 0.95rem;
    border-radius: 6px;
    background: #f8fafc;
}
@media (max-width: 600px) {
    .compact-grid {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 400px) {
    .compact-grid {
        grid-template-columns: 1fr;
    }
}

/* Контакты в карточке (максимально компактные) */
.entry-contacts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 8px;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
    margin: 4px 0 6px;
    font-size: 0.7rem;
    border: 1px solid #e2e8f0;
}
.entry-contacts .contact-link {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    text-decoration: none;
    color: #475569;
    transition: color 0.2s;
    font-size: 1rem;
	vertical-align:middle;
	word-break: break-all;
}
.entry-contacts .contact-link:hover {
    color: #2563eb;
}
.entry-contacts .contact-link:not(:last-child)::after {
    content: "•";
    color: #cbd5e1;
    margin-left: 4px;
    font-size: 0.6rem;
}
.entry-contacts .contact-link img {
	display:block;
	width:16px;
	height:16px;
	margin-right:3px;
	vertical-align:middle;
}
@media (max-width: 600px) {
    .entry-contacts {
        font-size: 0.65rem;
        gap: 2px 6px;
        padding: 2px 6px;
    }
    .entry-contacts .contact-link {
        font-size: 0.65rem;
        white-space: normal;
    }
    .entry-contacts .contact-link:not(:last-child)::after {
        content: "|";
        margin-left: 3px;
    }
}
.entry-author a {
    color: #3b82f6;
    text-decoration: none;
}
.entry-author a:hover {
    text-decoration: underline;
}
/* ===== Списки стран, регионов, городов ===== */
.card ul {
    list-style: none;
    padding: 0;
    margin: 10px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.card ul li {
    margin: 0;
}
.card ul li a {
    display: inline-block;
    background: #f1f5f9;
    color: #1e293b;
    padding: 6px 14px;
    border-radius: 30px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s, color 0.2s;
}
.card ul li a:hover {
    background: #e2e8f0;
    color: #3b82f6;
}
@keyframes blink {
      0%   { opacity: 1; }
      50%  { opacity: 0; }
      100% { opacity: 1; }
    }
	

/* Миниатюры фото */
.photo-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 8px 0;
}
.photo-thumb {
    max-width: 100px;
    max-height: 100px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    cursor: pointer;
    transition: transform 0.15s;
}
.photo-thumb:hover {
    transform: scale(1.05);
}
@media (max-width: 600px) {
    .photo-thumb {
        max-width: 70px;
        max-height: 70px;
    }
}

.photo-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 8px 0;
}
.photo-thumb {
    max-width: 100px;
    max-height: 100px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    cursor: pointer;
    transition: transform 0.15s;
}
.photo-thumb:hover {
    transform: scale(1.05);
}
.photo-placeholder {
    width: 100px;
    height: 100px;
    background: #e2e8f0;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.65rem;
    color: #64748b;
    border: 1px solid #cbd5e1;
    padding: 5px;
    line-height: 1.3;
}
@media (max-width: 600px) {
    .photo-thumb {
        max-width: 70px;
        max-height: 70px;
    }
    .photo-placeholder {
        width: 70px;
        height: 70px;
        font-size: 0.55rem;
    }
}
.photo-upload-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.photo-upload-grid input[type="file"] {
    flex: 1 1 calc(33.333% - 10px); /* три в ряд с учётом gap */
    min-width: 150px; /* минимальная ширина, чтобы не сжимались слишком */
    padding: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #f8fafc;
    box-sizing: border-box;
}
@media (max-width: 600px) {
    .photo-upload-grid input[type="file"] {
        flex: 1 1 100%; /* на телефонах — во всю ширину */
        min-width: unset;
    }
}

@media (max-width: 600px) {
    .compact-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px 16px;
    }
    .compact-grid .form-group:nth-child(5) { /* Роль */
        grid-column: 1 / -1;
    }
}

/* Пагинация в одну линию с переносом */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}
.pagination .btn-sm {
    padding: 4px 8px;
    font-size: 1.2rem;
    white-space: nowrap;
}
/* Для мобильных устройств уменьшаем отступы */
@media (max-width: 600px) {
    .pagination .btn-sm {
        padding: 2px 6px;
        font-size: 1rem;
    }
}

/* ---- ОБЪЯВЛЕНИЯ: плашки-карточки ---- */
.entry-card {
    background: #fff;
    border: 1px solid #e6eaf0;
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.entry-card:last-of-type { margin-bottom: 0; }
.entry-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

/* Заголовок объявления */
.entry-title {
    font-weight: 600;
    font-size: 1.2rem;
    line-height: 1.3;
    margin-bottom: 4px;
}
.entry-title a { color: #0f172a; text-decoration: none; }
.entry-title a:hover { color: #3b82f6; }

/* Мета: №, автор, время */
.entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 8px;
}
.entry-id { color: #64748b; }
.entry-author { color: #3b82f6; }
.entry-author a { color: #3b82f6; text-decoration: none; }
.entry-author a:hover { text-decoration: underline; }
.entry-time { color: #94a3b8; font-size: 0.85rem; }
.entry-complaint { color: #94a3b8; font-size: 0.85rem; text-decoration:none; float:right;display:inline-block; opacity:.5;}
.entry-complaint:hover {opacity:1;}

/* Локация */
/* Локация */
.entry-location { margin-bottom: 4px; }

.entry-location a {
    position: relative;
    display: block;                /* ← не flex, чтобы ellipsis гарантированно работал */
    padding-right: 24px;           /* ← место под флаг, чтобы текст под него не заезжал */
    min-width: 0;
    font-size: 0.82rem;
    color: #64748b;
    text-decoration: none;
}
.entry-location a:hover { color: #3b82f6; }

/* Название — одна строка, лишнее обрезается «…» */
.entry-location-text {
    display: block;                /* ← блочный, не flex-item */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Флаг — вынесен из потока, всегда у правого края */
.entry-location-flag {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    box-sizing: border-box;
    border: 1px solid #eee;
    border-radius: 50px;
    object-fit: cover;
    display: block;
}

@media (max-width: 600px) {
    .entry-location a    { padding-right: 22px; }
    .entry-location-flag { width: 14px; height: 14px; }
}

/* Адрес / карты */
.entry-address {
    font-size: 0.85rem;
    color: #475569;
    margin: 4px 0;
}

/* Контакты — как бейдж */
.entry-contacts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 4px 10px;
    border-radius: 8px;
    margin: 8px 0;
    font-size: 0.8rem;
}
.entry-contacts .contact-link {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    text-decoration: none;
    color: #475569;
    transition: color 0.2s;
}
.entry-contacts .contact-link:hover { color: #2563eb; }
.entry-contacts .contact-link:not(:last-child)::after {
    content: "•";
    color: #cbd5e1;
    margin-left: 4px;
    font-size: 0.6rem;
}
.entry-contacts .contact-link img {
    display: block;
    width: 16px;
    height: 16px;
    margin-right: 3px;
    vertical-align: middle;
}

/* Основные параметры (возраст, роль, рост/вес) */
.entry-main-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
    font-size: 1rem;
    font-weight: 500;
    margin: 8px 0 6px;
}
.entry-age { font-weight: 600; color: #1e293b; }
.entry-role { color: #2563eb; font-weight: 600; }
.entry-body { color: #475569; font-weight: 400; }

/* Текст превью */
.entry-text {
    color: #334155;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 6px 0 8px;
	word-break:break-all;
}

/* Фото-сетка внутри карточки */
.entry-card .photo-grid { margin: 10px 0; }

/* Статистика — отделена пунктиром сверху */
.entry-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
    font-size: 0.9rem;
    color: #475569;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #e6eaf0;
}
.entry-stats span { display: inline-flex; align-items: center; gap: 4px; }
.entry-stats .btn { margin-left: auto; }

/* Адаптив */
@media (max-width: 600px) {
    .entry-card {
        padding: 12px 14px;
        border-radius: 12px;
        margin-bottom: 10px;
    }
    .entry-title { font-size: 1.05rem; }
    .entry-main-info { font-size: 0.95rem; gap: 8px 12px; }
    .entry-contacts { font-size: 0.72rem; gap: 3px 6px; }
}