:root {
    --bg: #ffffff;
    --bg-soft: #f5f6f8;
    --bg-card: #ffffff;
    --text: #1f2933;
    --muted: #6b7280;
    --line: #e5e7eb;
    --accent: #2f5f8f;
    --accent-dark: #22384f;
    --danger: #b42318;
    --radius: 22px;
    --shadow: 0 18px 48px rgba(31, 41, 51, 0.08);
    --container: 1160px;
    --section-y: clamp(48px, 6vw, 82px);
    --space: clamp(18px, 2.4vw, 30px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: 'Manrope', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    background: var(--bg);
    font-size: clamp(15px, 1.1vw, 17px);
    line-height: 1.65;
}
body.menu-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea { font: inherit; }

.container {
    width: min(calc(100% - clamp(32px, 6vw, 72px)), var(--container));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(255,255,255,.92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
}
.header-inner {
    min-height: clamp(66px, 7vw, 82px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.logo {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-shrink: 0;
    text-align: center;
}
.logo-img {
    display: block;
    width: auto;
    height: clamp(38px, 4.2vw, 50px);
    max-width: clamp(96px, 12vw, 140px);
    object-fit: contain;
}
.logo-text {
    display: block;
    max-width: 140px;
    color: #1f2a37;
    font-size: clamp(10px, .9vw, 12px);
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: .04em;
    white-space: nowrap;
}
.nav {
    display: flex;
    align-items: center;
    gap: clamp(16px, 2vw, 30px);
    color: #394150;
    font-size: 15px;
    font-weight: 700;
}
.nav a { transition: color .2s ease; }
.nav a:hover { color: var(--accent); }
.burger {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 14px;
    padding: 10px;
}
.burger span {
    display: block;
    height: 2px;
    margin: 5px 0;
    background: var(--text);
    border-radius: 2px;
}

.hero {
    padding: clamp(54px, 7vw, 96px) 0;
    background: linear-gradient(180deg, #f7f8fa 0%, #fff 100%);
}
.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 390px);
    align-items: center;
    gap: clamp(28px, 5vw, 72px);
}
.eyebrow {
    display: inline-flex;
    margin-bottom: 12px;
    color: var(--accent);
    font-size: clamp(12px, .95vw, 14px);
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
    margin-bottom: 18px;
    max-width: 780px;
    font-size: clamp(34px, 5.2vw, 68px);
    line-height: 1.04;
    letter-spacing: -0.055em;
}
h2 {
    margin-bottom: 0;
    font-size: clamp(26px, 3.2vw, 44px);
    line-height: 1.12;
    letter-spacing: -0.04em;
}
h3 {
    font-size: clamp(20px, 2vw, 27px);
    line-height: 1.2;
    letter-spacing: -0.025em;
}
.hero-content p {
    max-width: 720px;
    margin-bottom: clamp(24px, 3vw, 36px);
    color: #4b5563;
    font-size: clamp(16px, 1.45vw, 20px);
}
.hero-actions, .form-actions, .admin-actions, .row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 12px 18px;
    border: 1px solid transparent;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 800;
    line-height: 1.2;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.button:hover { transform: translateY(-1px); }
.button.primary {
    color: #fff;
    background: var(--accent-dark);
    box-shadow: 0 14px 30px rgba(34, 56, 79, .18);
}
.button.secondary {
    color: var(--text);
    background: #fff;
    border-color: var(--line);
}
.button.dark { color: #fff; background: #111827; }
.button.danger { color: #fff; background: var(--danger); }
.button.small { min-height: 38px; padding: 9px 13px; font-size: 14px; border-radius: 12px; }
.button.full { width: 100%; }
.hero-card {
    padding: clamp(22px, 3vw, 34px);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.hero-card strong, .hero-card span, .hero-card small { display: block; }
.hero-card strong { margin-bottom: 8px; font-size: clamp(20px, 2vw, 26px); }
.hero-card span { color: var(--accent); font-weight: 800; }
.hero-card small { margin-top: 18px; color: var(--muted); font-size: 14px; }
.card-label { margin-bottom: 10px; color: var(--muted); font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }

.section { padding: var(--section-y) 0; }
.section.muted { background: var(--bg-soft); }
.section-head { margin-bottom: clamp(24px, 3.5vw, 42px); }
.row-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
}
.admin-link {
    color: var(--accent);
    font-size: 14px;
    font-weight: 800;
}
.requisites-card {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.requisites-card div {
    min-height: 112px;
    padding: clamp(20px, 3vw, 30px);
    background: #fff;
}
.requisites-card span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}
.requisites-card strong {
    display: block;
    font-size: clamp(17px, 1.5vw, 21px);
    line-height: 1.35;
}
.posts-list {
    display: grid;
    gap: clamp(18px, 2.2vw, 26px);
}
.post-card {
    padding: clamp(22px, 3.2vw, 34px);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 12px 34px rgba(31,41,51,.06);
}
.post-header { margin-bottom: 16px; }
.post-header h3 { margin-bottom: 8px; }
time { color: var(--muted); font-size: 14px; font-weight: 700; }
.post-text { margin-bottom: 0; color: #3f4754; text-align: center; }
.attachments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    margin-top: 22px;
}
.attachment-card {
    width: 100%;
    padding: 10px;
    text-align: left;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 18px;
    cursor: zoom-in;
}
.attachment-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #fff;
    border-radius: 13px;
    border: 1px solid var(--line);
}
.attachment-card span {
    display: block;
    margin-top: 10px;
    font-weight: 800;
    line-height: 1.35;
}
.attachment-card small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}
.empty-state {
    padding: 28px;
    color: var(--muted);
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius);
}
.site-footer {
    padding: clamp(32px, 5vw, 54px) 0;
    color: #d1d5db;
    background: #1f2933;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: clamp(22px, 5vw, 70px);
    align-items: start;
}
.site-footer strong { display: block; margin-bottom: 8px; color: #fff; font-size: 20px; }
.site-footer p { max-width: 520px; margin-bottom: 0; color: #c5cad3; }
.site-footer span { display: block; color: #9ca3af; font-size: 13px; font-weight: 800; text-transform: uppercase; }
.site-footer a { color: #fff; font-weight: 800; }
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: none;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 4vw, 44px);
    background: rgba(15, 23, 42, .86);
}
.lightbox.is-open { display: flex; }
.lightbox img {
    max-width: min(100%, 1100px);
    max-height: 88vh;
    object-fit: contain;
    background: #fff;
    border-radius: 16px;
}
.lightbox-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 46px;
    height: 46px;
    color: #fff;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 50%;
    cursor: pointer;
    font-size: 32px;
    line-height: 1;
}

.admin-body { background: var(--bg-soft); }
.admin-topbar {
    background: #fff;
    border-bottom: 1px solid var(--line);
}
.admin-topbar-inner {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}
.admin-main { padding: clamp(28px, 5vw, 54px) 0; }
.admin-main.narrow { max-width: 840px; }
.admin-page-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}
.admin-page-head h1, .login-card h1 { margin-bottom: 0; font-size: clamp(28px, 4vw, 44px); }
.admin-card {
    padding: clamp(20px, 3vw, 32px);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 12px 34px rgba(31,41,51,.06);
}
.admin-list { display: grid; gap: 14px; }
.admin-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 18px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fafafa;
}
.admin-row h2 { margin-bottom: 6px; font-size: 20px; }
.admin-row p { margin: 10px 0 8px; color: #4b5563; }
.admin-row small { color: var(--muted); font-weight: 700; }
.row-actions { align-content: start; justify-content: flex-end; }
.admin-login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
}
.login-card { width: min(100%, 420px); }
label { display: grid; gap: 8px; margin-bottom: 18px; font-weight: 800; }
input, textarea {
    width: 100%;
    padding: 13px 14px;
    color: var(--text);
    background: #fff;
    border: 1px solid #cfd6df;
    border-radius: 14px;
    outline: none;
}
textarea { resize: vertical; min-height: 170px; }
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(47,95,143,.12); }
.notice {
    margin-bottom: 18px;
    padding: 12px 14px;
    color: #365314;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 14px;
    font-weight: 700;
}
.notice.error { color: #991b1b; background: #fef2f2; border-color: #fecaca; }
.back-link { display: inline-flex; margin-top: 16px; color: var(--muted); font-weight: 800; }
.field-note { color: var(--muted); font-weight: 600; }
.admin-files { margin: 22px 0; }
.admin-files h2 { margin-bottom: 14px; font-size: 22px; }
.admin-files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}
.admin-file-item {
    margin: 0;
    padding: 10px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 16px;
    font-weight: 700;
}
.admin-file-item img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--line);
}
.admin-file-item span { margin-top: 8px; }
.admin-file-item small { color: var(--muted); font-size: 12px; }
.admin-file-item em { color: var(--danger); font-style: normal; font-size: 13px; }
.admin-file-item input { width: auto; }

@media (max-width: 820px) {
    .burger { display: block; }
    .nav {
        position: fixed;
        left: 16px;
        right: 16px;
        top: 76px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 10px;
        background: #fff;
        border: 1px solid var(--line);
        border-radius: 20px;
        box-shadow: var(--shadow);
    }
    .nav.is-open { display: flex; }
    .nav a { padding: 14px; border-radius: 12px; }
    .nav a:hover { background: var(--bg-soft); }
    .hero-grid { grid-template-columns: 1fr; }
    .row-head, .admin-page-head, .admin-topbar-inner { align-items: stretch; flex-direction: column; }
    .admin-actions { width: 100%; }
    .admin-actions .button { flex: 1; }
    .requisites-card { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .admin-row { grid-template-columns: 1fr; }
    .row-actions { justify-content: stretch; }
    .row-actions .button, .row-actions form, .row-actions button { width: 100%; }
}

@media (max-width: 520px) {
    .container { width: min(calc(100% - 28px), var(--container)); }
    .hero-actions .button, .form-actions .button { width: 100%; }
    .attachments-grid { grid-template-columns: 1fr; }
    .post-card, .admin-card { border-radius: 18px; }
}

/* Универсальные вложения: изображения, PDF и обычные файлы */
.attachment-card.file-card {
    display: grid;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}
.file-preview {
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    color: var(--accent-dark);
    background: linear-gradient(180deg, #ffffff 0%, #eef3f8 100%);
    border: 1px solid var(--line);
    border-radius: 13px;
}
.file-preview b {
    display: grid;
    place-items: center;
    width: clamp(58px, 8vw, 76px);
    height: clamp(58px, 8vw, 76px);
    color: #fff;
    background: var(--accent-dark);
    border-radius: 18px;
    font-size: 15px;
    letter-spacing: .06em;
}
.pdf-preview iframe {
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
    pointer-events: none;
}
.attachment-card em,
.file-open-link,
.admin-file-link {
    display: inline-flex;
    margin-top: 8px;
    color: var(--accent);
    font-size: 13px;
    font-style: normal;
    font-weight: 800;
}
.file-open-link { text-decoration: none; }
.lightbox iframe {
    display: none;
    width: min(100%, 1100px);
    height: min(88vh, 820px);
    background: #fff;
    border: 0;
    border-radius: 16px;
}
.lightbox.is-pdf img { display: none; }
.lightbox.is-pdf iframe { display: block; }
.lightbox:not(.is-pdf) iframe { display: none; }
.admin-file-item .file-preview { margin-bottom: 8px; }
.admin-file-item .admin-file-link { margin-top: 2px; }

@media (max-width: 520px) {
    .lightbox iframe {
        height: 82vh;
        border-radius: 12px;
    }
}

/* Исправленные карточки документов */
.attachments-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: start;
}
.attachment-card {
    display: grid;
    align-content: start;
    min-width: 0;
    min-height: 0;
    height: 100%;
    padding: 12px;
    overflow: hidden;
}
.attachment-preview-box {
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff 0%, #eef3f8 100%);
    border: 1px solid var(--line);
    border-radius: 13px;
}
.attachment-preview-box img,
.attachment-card img {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    object-fit: cover;
    border: 0;
    border-radius: 0;
}
.attachment-title,
.attachment-card > span:not(.attachment-preview-box):not(.file-preview) {
    display: -webkit-box;
    min-width: 0;
    margin-top: 12px;
    overflow: hidden;
    color: var(--text);
    font-weight: 800;
    line-height: 1.35;
    overflow-wrap: anywhere;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.file-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}
.file-actions a,
.attachment-card em {
    display: inline-flex;
    width: auto;
    margin-top: 0;
    color: var(--accent);
    font-size: 13px;
    font-style: normal;
    font-weight: 800;
}
.file-preview {
    position: relative;
    padding: 18px;
    align-content: center;
    gap: 8px;
}
.file-preview b {
    position: relative;
    z-index: 1;
    width: clamp(50px, 5vw, 66px);
    height: clamp(50px, 5vw, 66px);
    border-radius: 16px;
    box-shadow: 0 14px 30px rgba(34, 56, 79, .16);
}
.file-preview i {
    display: block;
    width: min(70%, 150px);
    height: 8px;
    background: rgba(34, 56, 79, .10);
    border-radius: 999px;
}
.file-preview i:nth-of-type(2) { width: min(58%, 126px); }
.file-preview i:nth-of-type(3) { width: min(64%, 138px); }
.file-preview::after {
    content: '';
    position: absolute;
    inset: 18px;
    border: 1px solid rgba(34, 56, 79, .08);
    border-radius: 12px;
    pointer-events: none;
}
.file-preview-xls::before,
.file-preview-xlsx::before,
.file-preview-csv::before,
.file-preview-ods::before {
    content: '';
    position: absolute;
    inset: 54% 22px 22px;
    background:
        linear-gradient(rgba(34,56,79,.10), rgba(34,56,79,.10)) 0 0 / 100% 1px no-repeat,
        linear-gradient(90deg, rgba(34,56,79,.10), rgba(34,56,79,.10)) 33% 0 / 1px 100% no-repeat,
        linear-gradient(90deg, rgba(34,56,79,.10), rgba(34,56,79,.10)) 66% 0 / 1px 100% no-repeat,
        repeating-linear-gradient(0deg, transparent 0 15px, rgba(34,56,79,.08) 15px 16px);
    border-radius: 8px;
}
.file-preview-doc::before,
.file-preview-docx::before,
.file-preview-odt::before,
.file-preview-rtf::before,
.file-preview-txt::before {
    content: '';
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 24px;
    height: 58px;
    background: repeating-linear-gradient(0deg, rgba(34,56,79,.08) 0 5px, transparent 5px 14px);
    border-radius: 8px;
}
.pdf-preview iframe {
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    pointer-events: none;
}

/* Админка: компактный список файлов без предпросмотра */
.admin-files-list {
    display: grid;
    gap: 10px;
}
.admin-file-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 16px;
}
.admin-file-badge {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    color: #fff;
    background: var(--accent-dark);
    border-radius: 14px;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .05em;
}
.admin-file-info {
    display: grid;
    gap: 3px;
    min-width: 0;
}
.admin-file-info strong {
    overflow: hidden;
    font-size: 15px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.admin-file-info small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

/* Drag & drop загрузка */
.upload-field {
    display: grid;
    gap: 10px;
    margin: 22px 0 18px;
}
.upload-label {
    font-weight: 800;
}
.dropzone {
    display: grid;
    place-items: center;
    gap: 7px;
    margin: 0;
    min-height: 168px;
    padding: 22px;
    text-align: center;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 18px;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.dropzone:hover,
.dropzone.is-dragover {
    background: #f2f6fb;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(47,95,143,.10);
}
.dropzone input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.dropzone-title {
    color: var(--text);
    font-size: clamp(18px, 2vw, 22px);
    font-weight: 900;
}
.dropzone-text,
.dropzone-note {
    max-width: 560px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}
.dropzone-note { font-size: 13px; }
.selected-files {
    display: grid;
    gap: 8px;
}
.selected-file-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}
.selected-file-item span:first-child {
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    text-overflow: ellipsis;
    white-space: nowrap;
}
.add-more-files { justify-self: start; }

@media (max-width: 980px) {
    .attachments-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .attachments-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-file-row { grid-template-columns: auto minmax(0, 1fr); }
    .admin-file-row .button { grid-column: 1 / -1; width: 100%; }
}
@media (max-width: 480px) {
    .attachments-grid { grid-template-columns: 1fr; }
    .dropzone { min-height: 150px; padding: 18px; }
}

/* Финальная правка карточек файлов: ровный размер, 4 в ряд, непустое превью */
.attachments-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(12px, 2vw, 16px);
}
.attachment-card,
.attachment-card.file-card {
    width: 100%;
    min-width: 0;
    height: 100%;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
}
.attachment-preview-box,
.attachment-card img,
.file-preview,
.pdf-preview {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    max-height: 180px;
    overflow: hidden;
    border-radius: 13px;
}
.file-preview {
    position: relative;
    display: grid;
    grid-template-rows: auto 1fr;
    place-items: stretch;
    gap: 10px;
    padding: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #eef3f8 100%);
    border: 1px solid var(--line);
}
.file-preview::before,
.file-preview::after,
.file-preview i { content: none !important; display: none !important; }
.file-preview b {
    justify-self: center;
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    color: #fff;
    background: var(--accent-dark);
    border-radius: 14px;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .06em;
    box-shadow: 0 12px 28px rgba(34, 56, 79, .16);
}
.mini-doc,
.mini-table {
    display: grid;
    gap: 5px;
    min-width: 0;
    align-self: stretch;
    padding: 8px;
    background: rgba(255,255,255,.76);
    border: 1px solid rgba(34,56,79,.08);
    border-radius: 10px;
}
.mini-doc span {
    min-width: 0;
    overflow: hidden;
    color: rgba(34, 56, 79, .68);
    font-size: 9px;
    font-weight: 800;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mini-doc-lines span {
    height: 6px;
    background: rgba(34,56,79,.12);
    border-radius: 99px;
}
.mini-doc-lines span:nth-child(2) { width: 82%; }
.mini-doc-lines span:nth-child(3) { width: 66%; }
.mini-doc-lines span:nth-child(4) { width: 74%; }
.mini-table-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    min-height: 13px;
    border-bottom: 1px solid rgba(34,56,79,.08);
}
.mini-table-row:last-child { border-bottom: 0; }
.mini-table-row span {
    min-width: 0;
    padding: 2px 4px;
    overflow: hidden;
    color: rgba(34,56,79,.72);
    font-size: 8px;
    font-weight: 800;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-right: 1px solid rgba(34,56,79,.08);
}
.mini-table-row span:last-child { border-right: 0; }
.file-preview-xls b,
.file-preview-xlsx b,
.file-preview-csv b,
.file-preview-ods b { background: #234b3d; }
.file-preview-doc b,
.file-preview-docx b,
.file-preview-odt b,
.file-preview-rtf b,
.file-preview-txt b { background: var(--accent-dark); }
.file-preview-ppt b,
.file-preview-pptx b,
.file-preview-odp b { background: #6b3d2b; }
.file-preview-zip b,
.file-preview-rar b,
.file-preview-7z b { background: #4b5563; }
.pdf-preview iframe {
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
    pointer-events: none;
}
.attachment-title {
    min-height: 2.7em;
}
.file-actions {
    margin-top: auto;
}
@media (max-width: 980px) {
    .attachments-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .attachments-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
    .attachments-grid { grid-template-columns: 1fr; }
    .attachment-preview-box, .attachment-card img, .file-preview, .pdf-preview { max-height: 220px; }
}


/* === Fix: documents grid, stable previews and admin drag/drop === */
.attachments-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 220px));
    justify-content: start;
    align-items: stretch;
    gap: clamp(12px, 1.8vw, 16px);
    margin-top: 22px;
}

.attachment-card,
.attachment-card.file-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 220px;
    min-width: 0;
    min-height: 320px;
    padding: 12px;
    text-align: left;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 10px 24px rgba(31, 41, 51, .05);
    overflow: hidden;
}

.attachment-card[type="button"] {
    appearance: none;
    color: inherit;
    font: inherit;
}

.attachment-preview-box,
.attachment-card img,
.file-preview,
.pdf-preview {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    max-height: 150px;
    flex: 0 0 auto;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 13px;
}

.image-box img,
.attachment-card > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-preview {
    position: relative;
    display: grid;
    grid-template-rows: auto 1fr;
    place-items: stretch;
    gap: 10px;
    padding: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #eef3f8 100%);
}

.file-preview b {
    justify-self: center;
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    margin: 0;
    color: #fff;
    background: var(--accent-dark);
    border-radius: 15px;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: .05em;
    box-shadow: 0 12px 28px rgba(34, 56, 79, .16);
}

.attachment-title {
    display: -webkit-box !important;
    min-height: 2.8em;
    margin-top: 10px !important;
    overflow: hidden;
    color: var(--text);
    font-size: 14px;
    font-weight: 900;
    line-height: 1.35;
    text-overflow: ellipsis;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.attachment-card small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}

.attachment-card em,
.file-actions {
    margin-top: auto;
}

.file-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding-top: 12px;
}

.file-actions a,
.attachment-card em {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 10px;
    color: var(--accent-dark);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
    text-decoration: none;
}

.file-actions a:hover,
.attachment-card em:hover {
    border-color: var(--accent);
}

.selected-file-item {
    align-items: center;
}

.selected-file-remove {
    display: grid;
    place-items: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    color: #991b1b;
    background: #fee2e2;
    border: 0;
    border-radius: 9px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
}

@media (max-width: 980px) {
    .attachments-grid { grid-template-columns: repeat(3, minmax(0, 220px)); }
}

@media (max-width: 760px) {
    .attachments-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .attachment-card,
    .attachment-card.file-card { max-width: none; }
}

@media (max-width: 520px) {
    .attachments-grid { grid-template-columns: 1fr; }
    .attachment-card,
    .attachment-card.file-card { min-height: 0; }
    .attachment-preview-box,
    .attachment-card img,
    .file-preview,
    .pdf-preview { max-height: 220px; }
    .admin-file-row { grid-template-columns: auto minmax(0, 1fr); }
    .admin-file-row .button { grid-column: 1 / -1; width: 100%; }
}


/* === Mobile alignment refinements === */
.attachment-card[data-doc-preview] {
    cursor: pointer;
}

@media (max-width: 760px) {
    .hero-content,
    .section-head,
    .section-head > div,
    .post-header {
        text-align: center;
    }

    .hero-content h1,
    .hero-content p {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-actions {
        justify-content: center;
    }

    .row-head {
        align-items: center;
    }

    .section-head .eyebrow,
    .hero-content .eyebrow,
    .post-header .eyebrow {
        justify-content: center;
    }
}
.vvdev-made {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  margin-top: 18px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  line-height: 1.2;
  text-decoration: none;
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(120, 70, 255, 0.16);
  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    background 0.25s ease;
}

.vvdev-made::before {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 70%;
  height: 100%;
  background: linear-gradient(
    110deg,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 25%,
    rgba(180, 130, 255, 0.35) 50%,
    rgba(255, 255, 255, 0.12) 70%,
    transparent 100%
  );
  transform: skewX(-20deg);
  animation: vvdevMadeShine 4.8s ease-in-out infinite;
  pointer-events: none;
}

.vvdev-made span,
.vvdev-made strong {
  position: relative;
  z-index: 1;
}

.vvdev-made strong {
  color: #ffffff;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-shadow:
    0 0 8px rgba(160, 95, 255, 0.75),
    0 0 18px rgba(120, 70, 255, 0.45);
    margin-bottom: 0 !important
}

.vvdev-made:hover {
  transform: translateY(-1px);
  border-color: rgba(190, 150, 255, 0.46);
  background: rgba(130, 80, 255, 0.12);
  box-shadow:
    0 12px 34px rgba(120, 70, 255, 0.28),
    0 0 22px rgba(160, 95, 255, 0.18);
}

.vvdev-made:hover strong {
  text-shadow:
    0 0 10px rgba(185, 140, 255, 0.95),
    0 0 24px rgba(140, 85, 255, 0.7);
}

@keyframes vvdevMadeShine {
  0% {
    left: -120%;
  }

  42% {
    left: 130%;
  }

  100% {
    left: 130%;
  }
}

@media (max-width: 520px) {
  .vvdev-made {
    padding: 8px 12px;
    font-size: 13px;
    gap: 5px;
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vvdev-made::before {
    animation: none;
  }

  .vvdev-made {
    transition: none;
  }
}