:root {
    --bg: #E8E4DC;
    --surface: #F3EFE6;
    --text: #1A1E26;
    --text-secondary: #5C6158;
    --line: #C9C2B4;
    --header: #1B2A4A;
    --accent-gold: #B59A5A;
    --row-hover: #DDD7C8;
    --font-serif: 'PT Serif', 'Source Serif 4', Georgia, 'Times New Roman', serif;
    --font-sans: 'PT Sans', 'IBM Plex Sans', Arial, Helvetica, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
}

h1, h2, h3 {
    font-family: var(--font-serif);
    font-weight: 700;
    color: var(--text);
}

.container {
    width: 80%;
    max-width: 1200px;
    margin: 0 auto;
}

a {
    color: var(--header);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Header */

.site-header {
    background: var(--header);
    padding: 0;
    position: relative;
}

.site-header::after {
    content: '';
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 5px;
    background:
        linear-gradient(var(--header), var(--header)) top / 100% 1px no-repeat,
        linear-gradient(var(--accent-gold), var(--accent-gold)) bottom / 100% 1px no-repeat;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 0;
}

.logo-lockup {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-mark {
    width: 100px;
    height: 100px;
    display: block;
}

.logo-wordmark {
    display: flex;
    flex-direction: column;
    font-family: var(--font-serif);
    color: var(--bg);
    font-size: 13px;
    line-height: 1.5;
    letter-spacing: 0.12em;
}

.main-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin: 0;
    padding: 0;
    gap: 0;
}

.main-nav li {
    position: relative;
}

.main-nav > ul > li {
    display: flex;
    align-items: center;
}

.main-nav > ul > li:not(:last-child)::after {
    content: '·';
    color: var(--accent-gold);
    margin: 0 12px;
    font-size: 18px;
    line-height: 1;
}

.main-nav > ul > li > a {
    color: var(--bg);
    padding: 6px 2px;
    border-bottom: 2px solid transparent;
    display: inline-block;
}

.main-nav > ul > li > a:hover {
    text-decoration: none;
    border-bottom-color: rgba(244, 239, 230, 0.5);
}

.main-nav > ul > li.active > a {
    border-bottom-color: var(--bg);
}

.nav-toggle {
    display: none;
}

.main-nav .dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    min-width: 260px;
    padding: 4px 0;
    z-index: 10;
    flex-direction: column;
    gap: 0;
}

.main-nav .has-dropdown:hover .dropdown {
    display: flex;
}

.main-nav .dropdown li {
    padding: 0;
}

.main-nav .dropdown li a {
    color: var(--text);
    display: block;
    padding: 6px 12px;
}

.main-nav .dropdown li a:hover {
    background: var(--row-hover);
    text-decoration: none;
}

.auth-form {
    display: flex;
    gap: 6px;
}

.auth-form input {
    padding: 6px 10px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
}

.auth-form button {
    padding: 6px 14px;
    cursor: pointer;
    background: transparent;
    color: var(--bg);
    border: 1px solid var(--accent-gold);
    border-radius: 3px;
    font-family: inherit;
}

.auth-form button:hover {
    background: rgba(181, 154, 90, 0.18);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.header-divider {
    display: inline-block;
    width: 1px;
    height: 22px;
    background: var(--accent-gold);
    opacity: 0.6;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--bg);
}

.user-chip:hover {
    text-decoration: none;
    opacity: 0.85;
}

.user-chip-icon {
    width: 26px;
    height: 26px;
    padding: 4px;
    box-sizing: border-box;
    border: 1px solid var(--accent-gold);
    border-radius: 50%;
}

.user-chip-email {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

.logout-link {
    display: inline-flex;
    align-items: center;
}

.logout-link img {
    display: block;
}

.lang-select-wrap {
    display: inline-flex;
    border: 1px solid var(--accent-gold);
    border-radius: 3px;
}

.lang-select-wrap:hover,
.lang-select-wrap:focus-within {
    border-color: var(--accent-gold);
}

.lang-select {
    background: transparent;
    color: var(--bg);
    border: none;
    border-radius: 3px;
    outline: none;
    padding: 5px 8px;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
}

.lang-select:hover,
.lang-select:focus,
.lang-select:active {
    outline: none;
}

.lang-select option {
    color: var(--text);
    background: var(--surface);
}

/* Footer */

.site-footer {
    background: var(--header);
    padding: 20px 0;
    margin-top: 30px;
    font-size: 13px;
    color: var(--bg);
}

.disclaimer {
    margin: 0 0 10px;
}

.footer-bottom {
    margin: 0;
}

.footer-bottom a {
    color: var(--bg);
}

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

.page-content {
    padding: 20px 0;
}

.breadcrumbs {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 12px 0;
}

.breadcrumbs a {
    color: var(--text-secondary);
}

.breadcrumbs a:first-child {
    color: var(--header);
}

.breadcrumb-sep {
    margin: 0 2px;
}

/* Cabinet / admin tabs */

.cabinet-tabs {
    margin: 0 0 24px;
}

.cabinet-tabs-row {
    display: flex;
    flex-wrap: wrap;
    background: var(--bg);
    border: 1px solid var(--line);
}

.cabinet-tabs-row + .cabinet-tabs-row {
    border-top: none;
}

.cabinet-tab {
    flex: 1 1 0;
    text-align: center;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    border-right: 1px solid var(--line);
    border-bottom: 2px solid transparent;
    box-sizing: border-box;
}

.cabinet-tab:last-child {
    border-right: none;
}

.cabinet-tab:hover {
    background: var(--row-hover);
    text-decoration: none;
}

.cabinet-tab.active {
    border-bottom-color: var(--accent-gold);
    font-weight: 700;
}

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

.section-header h1 {
    margin: 0;
}

.btn-gold {
    background: var(--header);
    color: var(--surface);
    border: 1px solid var(--accent-gold);
}

.btn-gold:hover {
    background: #14213A;
    color: var(--surface);
}

.status-published {
    color: #4B6A52;
}

.status-rejected {
    color: #8A4B3E;
}

.breadcrumbs:has(+ .contacts-page) {
    text-align: center;
}

.contacts-page {
    max-width: 480px;
    margin: 0 auto;
    text-align: center;
}

.contacts-page .banner-stroke {
    margin-left: auto;
    margin-right: auto;
}

.contacts-page .contacts-email {
    margin: 8px 0 20px;
}

.contacts-page .contact-form {
    text-align: left;
    margin-top: 10px;
}

.contacts-page .contact-form p {
    margin: 0 0 12px;
}

.contacts-page .contact-form label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
}

.contacts-page .contact-form input,
.contacts-page .contact-form textarea {
    width: 100%;
    margin-top: 4px;
    padding: 8px 10px;
    font-family: inherit;
    font-size: 14px;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: var(--surface);
    color: var(--text);
}

.article-body {
    width: 100%;
    text-align: left;
}

.article-body h1 {
    font-size: 32px;
    margin-top: 0;
    margin-bottom: 0;
}

.article-body h1::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: var(--accent-gold);
    margin: 14px 0 24px;
}

.article-body p {
    font-size: 19px;
    line-height: 1.7;
    color: var(--text);
    text-align: left;
}

.error {
    color: #b3261e;
}

.articles-list {
    padding-left: 20px;
}

.articles-list li {
    margin-bottom: 8px;
}

/* Article body copy */

.page-content > p {
    font-size: 18px;
    max-width: 70ch;
    line-height: 1.7;
}

/* Buttons */

.btn {
    display: inline-block;
    padding: 8px 18px;
    background: var(--header);
    color: var(--surface);
    border: 1px solid var(--header);
    border-radius: 3px;
    cursor: pointer;
    font-family: inherit;
    font-size: 15px;
}

.btn:hover {
    background: #14213A;
    border-color: #14213A;
    text-decoration: none;
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--header);
}

.btn-secondary:hover {
    background: var(--row-hover);
    color: var(--text);
}

/* Forms */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 3px;
    color: var(--text);
    padding: 7px 10px;
    font-family: inherit;
    font-size: 15px;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--header);
}

/* Tables */

table.projects-table,
table.project-fields {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: var(--surface);
}

table.projects-table th,
table.projects-table td,
table.project-fields th,
table.project-fields td {
    border-bottom: 1px solid var(--line);
    padding: 10px 8px;
    text-align: left;
}

table.projects-table th,
table.project-fields th {
    background: var(--surface);
    color: var(--text-secondary);
    font-weight: 700;
    border-bottom: 1px solid var(--line);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
}

.col-date {
    font-family: Consolas, 'Courier New', monospace;
    font-variant-numeric: tabular-nums;
}

table.projects-table tbody tr:hover {
    background: var(--row-hover);
}

.col-title {
    color: var(--text);
    font-size: 16px;
    font-weight: 700;
}

.col-title a {
    color: var(--text);
}

.col-industry {
    color: var(--text-secondary);
}

.col-amount {
    text-align: right;
    color: var(--accent-gold);
    font-weight: 700;
    white-space: nowrap;
}

/* Mobile-only card list replacing .projects-table-home; see the ≤768px block. */
.project-cards {
    display: none;
}

.project-card {
    display: block;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 12px 14px;
    background: var(--surface);
    color: var(--text);
}

.project-card:hover {
    background: var(--row-hover);
    text-decoration: none;
}

.project-card-title {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 17px;
    margin-bottom: 6px;
}

.project-card-row {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.project-card-amount {
    margin-top: 6px;
    font-weight: 700;
    color: var(--accent-gold);
}

/* Banner */

.banner {
    display: flex;
    flex-wrap: wrap;
}

.banner-part {
    flex: 1 1 50%;
    min-height: 300px;
    display: flex;
    align-items: center;
    padding: 32px;
    background-size: cover;
    background-position: center;
}

.banner-left {
    background-image: url('/banner-founder.jpg');
    border-right: 1px solid var(--header);
}

.banner-right {
    background-image: url('/banner-investor.jpg');
}

.banner-copy {
    max-width: 440px;
    padding: 20px;
    background: radial-gradient(ellipse at left, rgba(27, 42, 74, 0.5) 0%, rgba(27, 42, 74, 0.18) 65%, transparent 100%);
}

.banner-stroke {
    display: block;
    width: 32px;
    height: 2px;
    background: var(--accent-gold);
    margin: 10px 0 16px;
}

.banner-part h1,
.banner-part h2 {
    margin-top: 0;
    margin-bottom: 0;
    color: var(--bg);
}

.banner-part h2 {
    font-size: 26px;
}

.banner-part h1 {
    font-size: 30px;
}

.banner-part p {
    margin: 0 0 18px;
    color: var(--bg);
}

.banner-copy .btn {
    width: 210px;
    text-align: center;
    border-color: var(--accent-gold);
}

.banner-right .btn {
    background: var(--surface);
    color: var(--header);
    border: 1px solid var(--accent-gold);
}

.banner-right .btn:hover {
    background: var(--row-hover);
}

/* Newsletter */

.newsletter-section {
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

.newsletter-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.newsletter-label {
    color: var(--text-secondary);
    white-space: nowrap;
}

.newsletter-form input[type="email"] {
    min-width: 260px;
}

.newsletter-consent {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.newsletter-consent input[type="checkbox"] {
    width: auto;
}

/* Colophon */

.colophon {
    color: var(--accent-gold);
    font-size: 12px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin: 0 0 6px;
}

.footer-colophon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 18px 0 0;
    color: var(--accent-gold);
    font-size: 10px;
}

.footer-colophon::before,
.footer-colophon::after {
    content: '';
    flex: 1;
    max-width: 100px;
    height: 1px;
    background: var(--accent-gold);
}

/* Pagination */

.pagination {
    display: flex;
    gap: 16px;
    align-items: center;
    margin: 16px 0;
    color: var(--text-secondary);
}

/* Favorite star */

.favorite-star {
    background: var(--surface);
    border: 1px solid var(--header);
    color: var(--text);
    padding: 6px 14px;
    border-radius: 3px;
    cursor: pointer;
    margin: 10px 0;
    font-family: inherit;
}

.favorite-star:hover {
    background: var(--row-hover);
}

/* Gallery */

.gallery-main {
    position: relative;
    max-width: 500px;
}

.gallery-main img {
    width: 100%;
    max-width: 500px;
    display: block;
    border: 1px solid var(--line);
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 252, 247, 0.85);
    border: 1px solid var(--line);
    color: var(--text);
    cursor: pointer;
    font-size: 20px;
    padding: 4px 10px;
}

.gallery-prev {
    left: 4px;
}

.gallery-next {
    right: 4px;
}

.gallery-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.gallery-thumb {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border: 2px solid var(--line);
    cursor: pointer;
}

.gallery-thumb.active {
    border-color: var(--header);
}

/* Chat */

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}

.chat-message {
    max-width: 70%;
    padding: 8px 12px;
    border: 1px solid var(--line);
    background: var(--surface);
    align-self: flex-start;
}

.chat-message-own {
    align-self: flex-end;
    background: var(--row-hover);
}

.chat-message-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.chat-message-body {
    white-space: pre-wrap;
}

.chat-form textarea {
    width: 100%;
    padding: 8px;
    font-family: inherit;
}

/* Project add/edit form (add-project.html, edit-project.html) — scoped to .project-form
   so the rest of the site's forms and layout are unaffected. */

.project-form .req-mark {
    color: #b3261e;
    margin-left: 2px;
}

.project-form .field-note {
    max-width: 520px;
    margin: -8px 0 14px;
    font-size: 12px;
    color: var(--text-secondary);
}

.project-form .field-double-wide input {
    width: 100%;
    max-width: 1080px;
}

/* .field-wide: dedicated wrapper for Title / Founder name (add-project.html).
   Width is set in fixed px (not %) on both the wrapper AND the <label> —
   <label> is display:inline by default, so a percentage width on the input
   was resolving against the input's own shrink-to-fit size instead of the
   wrapper. Forcing label to display:block removes that ambiguity. */
.project-form .field-wide,
.project-form .field-wide label {
    display: block;
    width: 720px;
    max-width: 100%;
}

.project-form .field-wide input[type="text"],
.project-form .field-wide input[name="title"],
.project-form .field-wide input[name="founder_name"] {
    display: block;
    width: 720px;
    max-width: 100%;
    box-sizing: border-box;
}

.project-form .field-wide-contact input {
    width: 100%;
    max-width: 520px;
}

.project-form .field-description textarea {
    resize: none;
}

.project-form .money-field {
    position: relative;
    display: inline-flex;
    vertical-align: middle;
}

.project-form .money-field .money-input {
    width: 220px;
    padding-right: 26px;
}

.project-form .money-spinner {
    position: absolute;
    top: 1px;
    right: 1px;
    bottom: 1px;
    width: 22px;
    display: flex;
    flex-direction: column;
}

.project-form .money-spinner button {
    flex: 1 1 50%;
    padding: 0;
    border: none;
    border-left: 1px solid var(--line);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 9px;
    line-height: 1;
    cursor: pointer;
}

.project-form .money-spinner button:first-child {
    border-bottom: 1px solid var(--line);
}

.project-form .money-spinner button:hover {
    background: var(--row-hover);
    color: var(--text);
}

.project-form .field-currency-note {
    margin-left: 10px;
    font-size: 12px;
    color: var(--text-secondary);
}

.project-form .photo-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 10px 0;
}

/* .photo-slot / .photo-slot-add / .photo-remove: fixed-size preview slots
   (add-project.html). Every slot is a hard 200x200 box regardless of the
   source image's natural resolution; the <img> is cropped inside it via
   object-fit instead of being shown at its own intrinsic size. */
/* Hard pixel caps (!important) so neither a stale cached rule nor an img's
   own natural size can make a slot render at anything but 200x200. */
.project-form .photo-slot,
.project-form .photo-slot img,
.project-form .photo-slot-add,
.project-form .photo-add-btn {
    width: 200px !important;
    height: 200px !important;
    max-width: 200px !important;
    max-height: 200px !important;
    flex: 0 0 200px;
}

.project-form .photo-slot {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: var(--surface);
}

.project-form .photo-slot img {
    object-fit: cover !important;
    object-position: center;
    display: block;
}

.project-form .photo-slot-add {
    border: 1px dashed var(--line);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-form .photo-remove {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(26, 30, 38, 0.72);
    color: #fff;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
}

.project-form .photo-remove:hover {
    background: #b3261e;
}

.project-form .photo-tile {
    position: relative;
    width: 200px;
    height: 200px;
    border: 1px solid var(--line);
    border-radius: 3px;
    overflow: hidden;
    background: var(--surface);
}

.project-form .photo-tile img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-form .photo-tile-add {
    border-style: dashed;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-form .photo-add-btn {
    width: 100%;
    height: 100%;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 48px;
    line-height: 1;
    cursor: pointer;
    font-family: inherit;
}

.project-form .photo-add-btn:hover {
    color: var(--header);
}

.project-form .photo-remove-btn {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(26, 30, 38, 0.72);
    color: #fff;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
}

.project-form .photo-remove-btn:hover {
    background: #b3261e;
}

.project-form .photo-error {
    min-height: 1em;
    margin: 6px 0 0;
    font-size: 13px;
    color: #b3261e;
}

/* ==========================================================================
   Mobile layout (≤768px). Desktop (≥769px) is completely untouched — every
   rule below lives inside this single media query, so nothing here can leak
   into the Baltic desktop styles above.
   ========================================================================== */
@media (max-width: 768px) {
    /* 1. General */
    html, body {
        overflow-x: hidden;
    }

    .container {
        width: 100%;
        max-width: 100%;
        padding-left: 16px;
        padding-right: 16px;
        box-sizing: border-box;
    }

    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    textarea,
    select,
    button,
    .btn {
        font-size: 16px;
    }

    /* 2. Header: hamburger + column nav */
    .header-inner {
        justify-content: flex-start;
    }

    .logo-mark {
        width: 44px;
        height: 44px;
    }

    .logo-wordmark {
        font-size: 10px;
    }

    .logo-lockup {
        order: 1;
    }

    .nav-toggle {
        display: flex;
        order: 2;
        flex-direction: column;
        justify-content: center;
        align-items: stretch;
        gap: 5px;
        width: 34px;
        height: 34px;
        padding: 7px;
        border: 1px solid var(--accent-gold);
        border-radius: 3px;
        background: transparent;
        cursor: pointer;
        box-sizing: border-box;
    }

    .nav-toggle span {
        display: block;
        height: 2px;
        background: var(--bg);
        border-radius: 1px;
    }

    .header-right {
        order: 3;
        flex: 1 1 100%;
        margin-top: 10px;
        flex-wrap: wrap;
        row-gap: 8px;
        justify-content: flex-start;
    }

    .auth-form {
        flex: 1 1 100%;
        flex-wrap: wrap;
    }

    .auth-form input {
        flex: 1 1 130px;
        min-width: 0;
    }

    .user-chip-email {
        max-width: 46vw;
    }

    .main-nav {
        display: none;
        order: 4;
        flex: 1 1 100%;
        margin-top: 10px;
        border-top: 1px solid rgba(244, 239, 230, 0.15);
        padding-top: 8px;
    }

    .main-nav.nav-open {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .main-nav > ul > li {
        display: block;
    }

    .main-nav > ul > li:not(:last-child)::after {
        content: none;
    }

    .main-nav > ul > li > a {
        display: block;
        padding: 10px 4px;
        border-bottom: 1px solid rgba(244, 239, 230, 0.15);
    }

    .main-nav .dropdown {
        display: flex;
        position: static;
        border: none;
        background: transparent;
        min-width: 0;
        padding: 0 0 6px 14px;
    }

    .main-nav .dropdown li a {
        padding: 6px 4px;
        color: var(--bg);
        opacity: 0.85;
    }

    /* 3. Home banner: stacked halves, full-width buttons */
    .banner-part {
        flex: 1 1 100%;
        min-height: 220px;
    }

    .banner-copy .btn,
    .banner-right .btn {
        display: block;
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }

    .newsletter-form {
        flex-direction: column;
        align-items: stretch;
    }

    .newsletter-form input[type="email"] {
        min-width: 0;
        width: 100%;
    }

    /* 4. Projects table -> card list (home page only) */
    .projects-table-home {
        display: none;
    }

    .project-cards {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin: 16px 0;
    }

    .pagination {
        flex-wrap: wrap;
    }

    /* Cabinet/admin data tables keep their real column layout but scroll
       horizontally inside their own box instead of squeezing text. */
    table.projects-table {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table.projects-table th,
    table.projects-table td {
        white-space: nowrap;
    }

    /* Key/value tables (project card, admin user profile) stack label above value */
    table.project-fields,
    table.project-fields tbody,
    table.project-fields tr,
    table.project-fields th,
    table.project-fields td {
        display: block;
        width: 100%;
    }

    table.project-fields th {
        border-bottom: none;
        padding: 10px 8px 2px;
        color: var(--text-secondary);
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    table.project-fields td {
        padding: 0 8px 12px;
        border-bottom: 1px solid var(--line);
    }

    /* 5. Forms and add-project */
    .page-content input[type="text"]:not(.money-input),
    .page-content input[type="email"],
    .page-content input[type="password"],
    .page-content select,
    .page-content textarea {
        width: 100%;
        box-sizing: border-box;
    }

    .project-form .field-description textarea {
        width: 100%;
        height: 320px;
        min-height: 0;
        box-sizing: border-box;
    }

    /* 6. Cabinet / admin tabs: one row, horizontal scroll, active underline kept */
    .cabinet-tabs-row {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .cabinet-tab {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    /* 7. Article / contacts / gallery spacing */
    .gallery-main {
        max-width: 100%;
    }

    .article-body p {
        font-size: 17px;
    }
}
