:root {
    --bg: #09111a;
    --bg-soft: #0f1d2c;
    --surface: rgba(10, 18, 29, 0.72);
    --surface-strong: rgba(9, 17, 26, 0.9);
    --text: #eef3f7;
    --muted: #a2b0bf;
    --line: rgba(255, 255, 255, 0.08);
    --accent: #c89b3c;
    --accent-strong: #f0b94e;
    --danger: #b63d3d;
    --success: #1e7f52;
    --app-bg: #f4f6f8;
    --app-text: #17212b;
    --app-card: #ffffff;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; }
body.theme-public { color: var(--text); background: radial-gradient(circle at top right, rgba(200, 155, 60, 0.18), transparent 28%), linear-gradient(145deg, #071019 0%, #0c1927 44%, #050b12 100%); }
body.theme-app { color: var(--app-text); background: linear-gradient(180deg, #eef2f6 0%, #f8fafb 100%); }
a { color: inherit; text-decoration: none; }
.hero-shell, .app-shell, .auth-shell { min-height: 100vh; padding: 48px 24px 72px; }
.hero, .app-hero { max-width: 1180px; margin: 0 auto 32px; display: grid; gap: 24px; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr); align-items: stretch; }
.hero-copy, .hero-card, .info-card, .app-status { border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.hero-copy, .hero-card { background: var(--surface); backdrop-filter: blur(10px); }
.hero-copy { padding: 56px; }
.hero-card { padding: 32px; display: flex; flex-direction: column; justify-content: flex-end; gap: 12px; min-height: 300px; }
.app-hero > div, .app-status, .auth-card, .panel-card, .stat-card { background: var(--app-card); border: 1px solid rgba(23, 33, 43, 0.08); border-radius: 20px; padding: 32px; box-shadow: 0 12px 36px rgba(15, 23, 35, 0.08); }
.auth-card { max-width: 540px; margin: 0 auto; }
.auth-card-wide { max-width: 860px; }
.eyebrow { margin: 0 0 14px; letter-spacing: 0.18em; text-transform: uppercase; font-size: 0.8rem; color: var(--accent-strong); }
h1, h2 { margin: 0 0 16px; line-height: 1.06; }
h1 { font-size: clamp(2.4rem, 6vw, 5rem); max-width: 100%; }
.auth-card h1, .app-hero h1, .admin-header h1 { max-width: 100%; font-size: clamp(2rem, 4vw, 3.2rem); }
h2 { font-size: 1.4rem; }
.lead { max-width: 60ch; color: var(--muted); font-size: 1.06rem; line-height: 1.7; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 28px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 18px; border: 0; border-radius: 999px; font-weight: 700; cursor: pointer; transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%); color: #111; }
.button-secondary { border: 1px solid rgba(23, 33, 43, 0.14); background: transparent; }
.button-full { width: 100%; }
.section-grid { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.info-card { background: var(--surface-strong); padding: 28px; }
.app-status ul { margin: 16px 0 0; padding-left: 18px; color: #51606f; line-height: 1.8; }
.auth-form { display: grid; gap: 16px; margin-top: 24px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.auth-form label { display: grid; gap: 8px; font-weight: 600; }
.auth-form input, .auth-form select, .auth-form textarea { min-height: 48px; padding: 12px 14px; border: 1px solid rgba(23, 33, 43, 0.14); border-radius: 14px; font: inherit; width: 100%; }
.auth-form textarea { min-height: 140px; resize: vertical; }
.auth-note { margin: 0; color: #667482; font-size: 0.95rem; }
.alert { padding: 14px 16px; border-radius: 14px; font-weight: 600; margin-bottom: 16px; }
.alert-error { background: rgba(182, 61, 61, 0.12); color: var(--danger); }
.alert-success { background: rgba(30, 127, 82, 0.12); color: var(--success); }
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 280px minmax(0, 1fr); }
.admin-sidebar { background: #13202d; color: #eff4f8; padding: 28px 20px; display: grid; gap: 24px; align-content: start; }
.admin-brand { font-size: 1.4rem; font-weight: 800; letter-spacing: 0.04em; }
.admin-nav { display: grid; gap: 8px; }
.admin-nav a { padding: 12px 14px; border-radius: 12px; color: #c9d5e0; }
.admin-nav a.is-active, .admin-nav a:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.admin-content { padding: 32px; display: grid; gap: 24px; }
.admin-header { display: flex; justify-content: space-between; align-items: start; }
.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.stat-card span { display: block; color: #6d7b89; margin-bottom: 10px; }
.stat-card strong { font-size: 3rem; line-height: 1; }
.admin-panels { display: grid; gap: 24px; }
.admin-panels.two-columns { grid-template-columns: minmax(320px, 420px) minmax(0, 1fr); align-items: start; }
.panel-card h2 { margin-bottom: 12px; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid rgba(23, 33, 43, 0.08); vertical-align: top; }
.data-table th { color: #6c7b88; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; }
@media (max-width: 980px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { gap: 16px; }
  .hero, .app-hero, .section-grid, .form-grid, .stats-grid, .admin-panels.two-columns { grid-template-columns: 1fr; }
  .hero-copy { padding: 34px 24px; }
  h1 { max-width: 100%; }
  .admin-content { padding: 20px; }
}
.stats-grid-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stats-grid-five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.shoot-days-layout { grid-template-columns: minmax(420px, 620px) minmax(0, 1fr); }
.assignment-stack { display: grid; gap: 12px; margin: 18px 0 22px; }
.assignment-row { display: grid; grid-template-columns: 1.3fr 1fr 1fr 0.8fr 1fr; gap: 10px; }
.span-2 { grid-column: span 2; }
@media (max-width: 980px) { .stats-grid-five, .shoot-days-layout, .assignment-row { grid-template-columns: 1fr; } .span-2 { grid-column: auto; } }

.table-actions { display: inline-flex; gap: 12px; flex-wrap: wrap; }
.table-actions a { font-weight: 700; color: #1b4f7a; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 0; }
.detail-grid div { background: #f7f9fb; border-radius: 14px; padding: 14px 16px; }
.detail-grid dt { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: #677684; margin-bottom: 8px; }
.detail-grid dd { margin: 0; line-height: 1.6; }
.location-card { background: #f7f9fb; border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; }

.section-heading { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-top:24px; }
.location-stack { display:grid; gap:16px; margin:16px 0 24px; }
.location-editor { border:1px solid rgba(23,33,43,.08); border-radius:18px; padding:18px; background:#fbfcfd; }
.location-editor-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:14px; }
.location-grid { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:12px; }
.location-grid textarea { grid-column: span 2; }
.location-map { height:260px; border-radius:16px; overflow:hidden; margin-top:14px; background:#dfe7ee; }
.row-remove { min-height:40px; padding:0 14px; border:1px solid rgba(23,33,43,.14); border-radius:999px; background:#fff; cursor:pointer; font:inherit; }
.assignment-row { grid-template-columns: 1.3fr 1fr 1fr .8fr 1fr auto; }
@media (max-width:980px){ .location-grid { grid-template-columns:1fr; } .location-grid textarea { grid-column:auto; } }

.gps-preview { margin:0; padding:12px 14px; border:1px dashed rgba(23,33,43,.14); border-radius:14px; background:#fff; color:#5f6d7a; }

.table-thumb { width:72px; height:52px; object-fit:cover; border-radius:10px; display:block; }
.form-preview-image { width:180px; max-width:100%; aspect-ratio:16/10; object-fit:cover; border-radius:16px; margin:8px 0 20px; }
.detail-hero-image { width:100%; max-height:280px; object-fit:cover; border-radius:18px; margin-bottom:18px; }

.gallery-admin-item{border-top:1px solid rgba(23,33,43,.08);padding:16px 0;display:grid;gap:12px}.gallery-admin-head{display:flex;gap:12px;align-items:center}.photo-grid-admin{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:12px}.photo-admin-card{border:1px solid rgba(23,33,43,.08);border-radius:14px;padding:8px;background:#fff}.photo-admin-image{width:100%;aspect-ratio:4/3;object-fit:cover;border-radius:10px;display:block}.photo-admin-actions{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}.mini-btn{min-height:32px;padding:0 10px;border:1px solid rgba(23,33,43,.14);background:#fff;border-radius:999px;cursor:pointer}.mini-btn-danger{color:#a13232}

.is-inactive-row {
    background: #f2f4f6;
    color: #7b8793;
}

.is-inactive-row a {
    color: #5f6b77;
}

.row-status-muted {
    margin-top: 4px;
    color: #8a96a1;
    font-size: 0.88rem;
}

.table-link-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: #1b4f7a;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.table-link-button-danger {
    color: #9e2f2f;
}

.inline-admin-form {
    margin-top: 16px;
}

.button-danger-outline {
    border-color: rgba(182, 61, 61, 0.35);
    color: #9e2f2f;
}
.feed-shell {
    min-height: 100vh;
    position: relative;
    isolation: isolate;
    padding: 32px 24px 56px;
    background:
        radial-gradient(circle at top right, rgba(200, 155, 60, 0.16), transparent 22%),
        radial-gradient(circle at top left, rgba(15, 40, 68, 0.16), transparent 26%),
        linear-gradient(180deg, #e7edf3 0%, #f5f8fb 42%, #f8fafc 100%);
}

.feed-shell::before,
.feed-shell::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: -1;
}

.feed-shell::before {
    inset: 0 0 auto 0;
    height: 340px;
    background:
        linear-gradient(180deg, rgba(8, 18, 28, 0.72), rgba(8, 18, 28, 0.18) 54%, transparent 100%),
        radial-gradient(circle at 14% 18%, rgba(229, 187, 98, 0.42), transparent 20%),
        radial-gradient(circle at 86% 14%, rgba(46, 84, 124, 0.42), transparent 24%),
        radial-gradient(circle at 50% -8%, rgba(255, 255, 255, 0.18), transparent 30%);
}

.feed-shell::after {
    background:
        radial-gradient(circle at -8% 22%, rgba(20, 42, 66, 0.18), transparent 24%),
        radial-gradient(circle at 108% 30%, rgba(200, 155, 60, 0.18), transparent 24%),
        radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.12), transparent 20%);
    filter: blur(22px);
}

.feed-topbar {
    max-width: 1320px;
    margin: 0 auto 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
}

.feed-layout {
    max-width: 1320px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.feed-sidebar,
.feed-main {
    display: grid;
    gap: 24px;
}

.feed-profile-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #13202d;
    color: #eff4f8;
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 12px 36px rgba(15, 23, 35, 0.14);
}

.feed-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #111;
}

.feed-avatar-small {
    width: 42px;
    height: 42px;
    font-size: 1rem;
}

.feed-side-card,
.feed-composer-card,
.feed-post-card {
    border-radius: 22px;
}

.feed-side-list {
    display: grid;
    gap: 12px;
}

.feed-side-item {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    background: rgba(247, 249, 251, 0.88);
    border-radius: 14px;
}

.feed-composer-head,
.feed-post-head,
.feed-post-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.feed-checkbox {
    display: flex !important;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.feed-checkbox input {
    width: 18px;
    height: 18px;
    min-height: auto;
}

.feed-post-card {
    display: grid;
    gap: 16px;
}

.feed-post-urgent {
    border: 1px solid rgba(200, 155, 60, 0.35);
    box-shadow: 0 18px 40px rgba(200, 155, 60, 0.14);
}

.feed-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(200, 155, 60, 0.14);
    color: #946a12;
    font-weight: 700;
}

.feed-post-title {
    margin: 0;
    font-size: 1.4rem;
}

.feed-post-body {
    line-height: 1.75;
    color: #253341;
}

.feed-photo-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.feed-photo-grid.is-single {
    grid-template-columns: 1fr;
}

.feed-photo-grid img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 18px;
    display: block;
}

.feed-meta-row,
.feed-action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 6px;
    border-top: 1px solid rgba(23, 33, 43, 0.08);
}

.feed-action-row {
    justify-content: flex-start;
    padding-top: 12px;
}

.feed-action-button {
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid rgba(23, 33, 43, 0.12);
    background: #fff;
    font: inherit;
    font-weight: 700;
    color: #274563;
    cursor: pointer;
}

.feed-action-button.is-active {
    background: rgba(39, 69, 99, 0.08);
    border-color: rgba(39, 69, 99, 0.22);
}

.feed-comments {
    display: grid;
    gap: 12px;
}

.feed-comment-item {
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    background: rgba(247, 249, 251, 0.88);
    border-radius: 14px;
}

.feed-comment-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.feed-comment-form input {
    min-height: 46px;
    padding: 12px 14px;
    border: 1px solid rgba(23, 33, 43, 0.14);
    border-radius: 14px;
    font: inherit;
}

@media (max-width: 980px) {
    .feed-topbar,
    .feed-layout {
        grid-template-columns: 1fr;
        display: grid;
    }

    .feed-comment-form {
        grid-template-columns: 1fr;
    }
}
.feed-post-tools {
    display: flex;
    align-items: center;
    gap: 12px;
}

.feed-photo-tile {
    position: relative;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.feed-photo-more {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: rgba(9, 17, 26, 0.56);
    color: #fff;
    font-size: 2rem;
    font-weight: 800;
}

.feed-comment-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.feed-comments-spaced {
    margin-top: 18px;
}

.feed-detail-grid {
    max-width: 1320px;
    margin: 0 auto 24px;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 11, 18, 0.92);
    padding: 24px;
}

.lightbox[hidden] {
    display: none;
}

.lightbox-image {
    max-width: min(96vw, 1200px);
    max-height: 82vh;
    border-radius: 18px;
    display: block;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.lightbox-close,
.lightbox-nav {
    position: absolute;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    cursor: pointer;
}

.lightbox-close {
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    font-size: 2rem;
}

.lightbox-nav {
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    font-size: 2rem;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-counter {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-weight: 700;
}
.feed-search-card {
    padding-top: 18px;
    padding-bottom: 18px;
}

.feed-search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 12px;
}

.feed-search-form input {
    min-height: 46px;
    padding: 12px 14px;
    border: 1px solid rgba(23, 33, 43, 0.14);
    border-radius: 14px;
    font: inherit;
}

.feed-pagination-links,
.section-heading-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.member-card {
    display: grid;
    gap: 12px;
    padding: 18px;
    border-radius: 18px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    box-shadow: 0 18px 40px rgba(16, 24, 32, 0.08);
}

.member-avatar-image,
.member-avatar-large {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
}

.member-avatar {
    width: 72px;
    height: 72px;
}

.member-profile-head {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
}

.member-avatar-large,
.member-avatar-large-fallback {
    width: 88px;
    height: 88px;
    flex: 0 0 auto;
}

.member-avatar-large-fallback {
    font-size: 2rem;
}

.is-own-message {
    background: rgba(39, 69, 99, 0.08);
    border: 1px solid rgba(39, 69, 99, 0.14);
}

.dynamic-list-block {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.profile-repeat-list {
    display: grid;
    gap: 10px;
}

.profile-repeat-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.gear-checklist {
    display: grid;
    gap: 14px;
}

.gear-check-item {
    display: grid;
    gap: 8px;
    padding: 14px;
    background: rgba(247, 249, 251, 0.88);
    border-radius: 14px;
}

.gear-check-item textarea {
    min-height: 78px;
    padding: 12px 14px;
    border: 1px solid rgba(23, 33, 43, 0.12);
    border-radius: 12px;
    font: inherit;
}

.profile-gallery-item {
    display: grid;
    gap: 10px;
}

.user-stats-grid {
    max-width: 1320px;
    margin: 0 auto 24px;
}

.photo-admin-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.mini-btn {
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid rgba(23, 33, 43, 0.12);
    border-radius: 999px;
    background: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.mini-btn-danger {
    color: #9a2d24;
    border-color: rgba(154, 45, 36, 0.18);
}

@media (max-width: 980px) {
    .feed-search-form,
    .profile-repeat-item {
        grid-template-columns: 1fr;
    }

    .member-profile-head,
    .feed-pagination-links,
    .section-heading-inline {
        align-items: flex-start;
        flex-direction: column;
    }
}

.theme-toggle {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 1100;
}

.theme-toggle-button {
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid rgba(23, 33, 43, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(14px);
    color: #1f3347;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(16, 24, 32, 0.12);
}

.theme-mode-dark {
    background: #0f141b;
    color: #e8edf3;
}

.theme-mode-dark .theme-toggle-button,
.theme-mode-dark .panel-card,
.theme-mode-dark .member-card,
.theme-mode-dark .feed-profile-card,
.theme-mode-dark .feed-comment-item,
.theme-mode-dark .stat-card,
.theme-mode-dark .feed-side-item,
.theme-mode-dark .admin-sidebar,
.theme-mode-dark .admin-main,
.theme-mode-dark .data-table,
.theme-mode-dark .table-wrap,
.theme-mode-dark .auth-form input,
.theme-mode-dark .auth-form textarea,
.theme-mode-dark .auth-form select,
.theme-mode-dark .feed-comment-form input,
.theme-mode-dark .feed-search-form input,
.theme-mode-dark .mini-btn,
.theme-mode-dark .feed-action-button,
.theme-mode-dark .gear-check-item {
    background: #18212c;
    color: #e8edf3;
    border-color: rgba(232, 237, 243, 0.12);
}

.theme-mode-dark .panel-card,
.theme-mode-dark .member-card,
.theme-mode-dark .feed-profile-card,
.theme-mode-dark .stat-card,
.theme-mode-dark .admin-main,
.theme-mode-dark .admin-sidebar {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.26);
}

.theme-mode-dark .feed-post-body,
.theme-mode-dark .auth-note,
.theme-mode-dark .detail-copy,
.theme-mode-dark .detail-grid dd,
.theme-mode-dark .detail-grid dt,
.theme-mode-dark .feed-side-item span,
.theme-mode-dark .data-table td,
.theme-mode-dark .data-table th,
.theme-mode-dark .table-link-button,
.theme-mode-dark a {
    color: #d6e0ea;
}

.theme-mode-dark .data-table thead,
.theme-mode-dark .feed-meta-row,
.theme-mode-dark .feed-action-row,
.theme-mode-dark .feed-comment-item,
.theme-mode-dark .panel-card,
.theme-mode-dark .member-card,
.theme-mode-dark .feed-profile-card {
    border-color: rgba(232, 237, 243, 0.08);
}

.theme-mode-dark .feed-comment-item.is-own-message {
    background: rgba(72, 118, 164, 0.18);
}

.theme-mode-dark .feed-post-urgent {
    background: linear-gradient(180deg, rgba(120, 72, 19, 0.34), rgba(24, 33, 44, 0.96));
}

.theme-mode-dark .button.button-secondary,
.theme-mode-dark .button.button-primary {
    border-color: rgba(232, 237, 243, 0.12);
}

.theme-mode-dark .button.button-secondary {
    background: #1e2a37;
    color: #eef4fb;
}

.theme-mode-dark .button.button-primary {
    background: #d2a24a;
    color: #151b22;
}

.theme-mode-dark .feed-avatar,
.theme-mode-dark .member-avatar-large-fallback {
    background: #d2a24a;
    color: #151b22;
}

@media (max-width: 980px) {
    .theme-toggle {
        top: 12px;
        right: 12px;
    }
}

.feed-avatar-image {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.feed-avatar-small-image {
    width: 42px;
    height: 42px;
}

.feed-avatar-tiny,
.feed-avatar-tiny-image {
    width: 30px;
    height: 30px;
    font-size: 0.82rem;
}

.feed-avatar-tiny-image {
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
}

.feed-comment-author-block {
    display: flex;
    align-items: center;
    gap: 10px;
}

.inline-edit-box summary {
    cursor: pointer;
    font-weight: 700;
    color: #1b4f7a;
}

.inline-edit-box[open] {
    display: grid;
    gap: 10px;
}

.compact-form {
    margin-top: 10px;
}

.detail-grid-contacts dd,
.contact-list,
.contact-pill {
    overflow-wrap: anywhere;
}

.contact-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.contact-pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: #eef3f7;
    color: #274563;
    font-weight: 600;
    min-width: 160px;
}

.messenger-thread {
    max-height: 520px;
    overflow: auto;
}

.messenger-dock {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 1150;
    width: min(760px, calc(100vw - 24px));
}

.messenger-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 14px;
    margin-left: auto;
    border: 1px solid rgba(23, 33, 43, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    color: #1f3347;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(16, 24, 32, 0.12);
    list-style: none;
    float: right;
}

.messenger-toggle::-webkit-details-marker {
    display: none;
}

.messenger-panel {
    margin-top: 10px;
    padding: 18px;
    border: 1px solid rgba(23, 33, 43, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 42px rgba(16, 24, 32, 0.16);
}

.messenger-panel-head {
    display: grid;
    gap: 4px;
    margin-bottom: 14px;
}

.messenger-workspace {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.messenger-list {
    display: grid;
    gap: 10px;
    max-height: 520px;
    overflow: auto;
}

.messenger-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 12px;
    border-radius: 14px;
    background: rgba(247, 249, 251, 0.88);
}

.messenger-thread-trigger {
    width: 100%;
    border: 1px solid transparent;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.messenger-thread-trigger.is-active {
    border-color: rgba(27, 79, 122, 0.18);
    background: #edf4fa;
}

.messenger-thread-panels {
    min-width: 0;
}

.messenger-thread-panel {
    display: none;
    gap: 12px;
}

.messenger-thread-panel.is-active {
    display: grid;
}

.messenger-thread-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.messenger-thread-person {
    display: flex;
    align-items: center;
    gap: 12px;
}

.messenger-thread-inline {
    max-height: 360px;
    overflow: auto;
    padding-right: 4px;
}

.messenger-inline-form {
    margin-top: 0;
}

.messenger-profile-link {
    min-height: 38px;
}

.messenger-empty {
    display: block;
}

.messenger-preview {
    margin-top: 4px;
    color: #51606f;
    line-height: 1.5;
}

.profile-gallery-grid img,
.profile-gallery-item img,
.member-avatar-large,
.member-avatar-image {
    object-position: center top;
}

body.theme-app.theme-mode-dark,
.theme-mode-dark .feed-shell {
    background: linear-gradient(180deg, #0d141b 0%, #121b23 100%);
    color: #e8edf3;
}

.theme-mode-dark .detail-grid div,
.theme-mode-dark .location-card,
.theme-mode-dark .photo-admin-card,
.theme-mode-dark .gps-preview,
.theme-mode-dark .contact-pill,
.theme-mode-dark .messenger-panel,
.theme-mode-dark .messenger-item,
.theme-mode-dark .feed-shell,
.theme-mode-dark .feed-search-card {
    background: #18212c;
    color: #e8edf3;
    border-color: rgba(232, 237, 243, 0.12);
}

.theme-mode-dark .feed-topbar,
.theme-mode-dark .lead,
.theme-mode-dark .messenger-preview {
    color: #d6e0ea;
}

.theme-mode-dark .feed-shell {
    background:
        radial-gradient(circle at top right, rgba(210, 162, 74, 0.12), transparent 22%),
        radial-gradient(circle at top left, rgba(45, 83, 122, 0.14), transparent 24%),
        linear-gradient(180deg, #0d141b 0%, #121b23 58%, #131d26 100%);
}

.theme-mode-dark .feed-shell::before {
    background:
        linear-gradient(180deg, rgba(4, 9, 15, 0.82), rgba(4, 9, 15, 0.24) 54%, transparent 100%),
        radial-gradient(circle at 14% 18%, rgba(210, 162, 74, 0.28), transparent 18%),
        radial-gradient(circle at 86% 14%, rgba(64, 109, 155, 0.22), transparent 24%),
        radial-gradient(circle at 50% -8%, rgba(255, 255, 255, 0.08), transparent 30%);
}

.theme-mode-dark .feed-shell::after {
    background:
        radial-gradient(circle at -8% 22%, rgba(44, 77, 110, 0.16), transparent 24%),
        radial-gradient(circle at 108% 30%, rgba(210, 162, 74, 0.14), transparent 24%),
        radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.05), transparent 20%);
}

.theme-mode-dark .feed-side-card,
.theme-mode-dark .feed-composer-card,
.theme-mode-dark .feed-post-card {
    background: rgba(24, 33, 44, 0.88);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

.theme-mode-dark .contact-pill {
    background: #243242;
    color: #eef4fb;
}

.theme-mode-dark .messenger-toggle {
    background: rgba(24, 33, 44, 0.94);
    color: #eef4fb;
    border-color: rgba(232, 237, 243, 0.12);
}

@media (max-width: 980px) {
    .messenger-dock {
        top: 12px;
        right: 12px;
        left: 12px;
        width: auto;
    }

    .messenger-workspace {
        grid-template-columns: 1fr;
    }

    .messenger-thread-head {
        align-items: flex-start;
        flex-direction: column;
    }
}

.feed-side-item-training {
    border-left: 4px solid #f97316;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.12), rgba(249, 115, 22, 0.03));
}

.panel-card-training {
    border-color: rgba(249, 115, 22, 0.3);
}

.feed-badge-poll {
    background: rgba(59, 130, 246, 0.14);
    color: #1d4ed8;
}

.feed-poll-composer,
.feed-poll-box {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    background: #f8fbff;
}

.poll-options-stack,
.feed-poll-options {
    display: grid;
    gap: 10px;
}

.poll-option-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.feed-poll-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 12px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.feed-poll-option input {
    margin-top: 5px;
}

.feed-poll-option-copy {
    display: grid;
    gap: 8px;
}

.feed-poll-option-head,
.feed-poll-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.feed-poll-bar {
    height: 10px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.25);
    overflow: hidden;
}

.feed-poll-bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #2563eb 0%, #0ea5e9 100%);
}

.stats-grid-six {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.theme-mode-dark .feed-side-item-training {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.22), rgba(249, 115, 22, 0.08));
    border-left-color: #fb923c;
}

.theme-mode-dark .feed-poll-composer,
.theme-mode-dark .feed-poll-box,
.theme-mode-dark .feed-poll-option {
    background: #18212c;
    color: #e8edf3;
    border-color: rgba(232, 237, 243, 0.12);
}

.theme-mode-dark .feed-badge-poll {
    background: rgba(96, 165, 250, 0.18);
    color: #bfdbfe;
}

@media (max-width: 760px) {
    .poll-option-row,
    .feed-poll-option,
    .feed-poll-footer,
    .feed-poll-option-head {
        grid-template-columns: 1fr;
        display: grid;
    }
}

.assignment-member-list {
    display: grid;
    gap: 14px;
}

.assignment-member-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    background: #f8fafc;
    overflow: hidden;
}

.assignment-member-card.is-enabled {
    border-color: rgba(37, 99, 235, 0.32);
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.08);
}

.assignment-member-head {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 16px 18px;
    cursor: pointer;
}

.assignment-member-meta {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.assignment-member-meta span {
    color: #526170;
}

.assignment-member-details {
    padding: 0 18px 18px;
}

.assignment-grid-tight {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.theme-mode-dark .assignment-member-card {
    background: #18212c;
    border-color: rgba(232, 237, 243, 0.12);
}

.theme-mode-dark .assignment-member-meta span {
    color: #c6d2de;
}

@media (max-width: 760px) {
    .assignment-member-head {
        grid-template-columns: auto 1fr;
    }

    .assignment-member-head input[type="checkbox"] {
        grid-row: 1 / span 2;
        align-self: center;
    }

    .assignment-grid-tight {
        grid-template-columns: 1fr;
    }
}

.stats-grid-three {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.finance-project-list {
    display: grid;
    gap: 18px;
}

.finance-project-card {
    display: grid;
    gap: 18px;
    padding: 20px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 22px;
    background: #f8fafc;
}

.finance-project-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 18px;
}

.finance-project-head h3 {
    margin: 0 0 6px;
}

.finance-total {
    display: grid;
    gap: 4px;
    text-align: right;
}

.finance-total strong {
    font-size: 1.4rem;
}

.finance-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.finance-list {
    margin: 10px 0 0;
    padding-left: 18px;
    display: grid;
    gap: 8px;
}

.theme-mode-dark .finance-project-card {
    background: #18212c;
    border-color: rgba(232, 237, 243, 0.12);
}

@media (max-width: 760px) {
    .finance-project-head,
    .finance-breakdown-grid {
        grid-template-columns: 1fr;
        display: grid;
    }

    .finance-total {
        text-align: left;
    }
}

.article-editor-card .ql-toolbar.ql-snow,
.article-editor-card .ql-container.ql-snow {
    border-color: rgba(15, 23, 42, 0.1);
}

.article-editor-shell {
    background: #ffffff;
    border-radius: 18px;
    overflow: hidden;
}

.article-editor {
    min-height: 420px;
    font-size: 1rem;
}

.article-list-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.article-card,
.article-content-card,
.article-card-public {
    overflow: hidden;
}

.article-content-card {
    display: grid;
    gap: 20px;
}

.article-excerpt {
    font-size: 1.1rem;
    color: #526170;
}

.article-richtext {
    line-height: 1.8;
    font-size: 1rem;
}

.article-richtext img {
    max-width: 100%;
    height: auto;
    border-radius: 18px;
    display: block;
    margin: 18px 0;
}

.article-richtext h1,
.article-richtext h2,
.article-richtext h3,
.article-richtext h4 {
    margin-top: 1.4em;
    margin-bottom: 0.5em;
}

.article-richtext p,
.article-richtext ul,
.article-richtext ol,
.article-richtext blockquote {
    margin: 0 0 1em;
}

.article-cover-preview {
    grid-column: 1 / -1;
}

.theme-mode-dark .article-editor-shell,
.theme-mode-dark .ql-toolbar.ql-snow,
.theme-mode-dark .ql-container.ql-snow,
.theme-mode-dark .ql-editor,
.theme-mode-dark .article-content-card,
.theme-mode-dark .article-card {
    background: #18212c;
    color: #e8edf3;
    border-color: rgba(232, 237, 243, 0.12);
}

.theme-mode-dark .article-excerpt {
    color: #c9d3de;
}


.form-grid-wide-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.subsection-card {
    padding: 22px;
    border: 1px solid rgba(23, 33, 43, 0.08);
    border-radius: 18px;
    background: #f8fafc;
}

.feed-side-article {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.feed-side-article-image {
    width: 96px;
    height: 76px;
    border-radius: 14px;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.feed-side-article-copy {
    display: grid;
    gap: 4px;
}

.finance-card-actions {
    display: flex;
    justify-content: flex-end;
}

.invoice-toolbar {
    margin-bottom: 0;
}


.invoice-sheet {
    display: grid;
    gap: 28px;
    max-width: 1120px;
    margin: 0 auto 32px;
    padding: 42px;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 20px 54px rgba(15, 23, 42, 0.1);
}

.invoice-sheet-head {
    display: flex;
    justify-content: space-between;
    gap: 28px;
    align-items: start;
    padding-bottom: 18px;
    border-bottom: 2px solid rgba(23, 33, 43, 0.08);
}

.invoice-sheet-head h2 {
    margin-bottom: 10px;
}

.invoice-meta {
    min-width: 280px;
    display: grid;
    gap: 10px;
}

.invoice-meta div,
.invoice-party,
.invoice-note-box {
    padding: 18px 20px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid rgba(23, 33, 43, 0.08);
}

.invoice-meta strong,
.invoice-party h3 {
    display: block;
    margin-bottom: 6px;
}

.invoice-party p,
.invoice-note-box p {
    margin: 0 0 8px;
    line-height: 1.6;
}

.invoice-parties {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.invoice-block {
    display: grid;
    gap: 14px;
}

.invoice-table th:last-child,
.invoice-table td:last-child {
    text-align: right;
}

.invoice-totals {
    margin-left: auto;
    width: min(420px, 100%);
    display: grid;
    gap: 10px;
}

.invoice-total-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 18px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid rgba(23, 33, 43, 0.08);
}

.invoice-total-grand {
    background: linear-gradient(135deg, rgba(240, 185, 78, 0.34), rgba(200, 115, 32, 0.14));
    border-color: rgba(200, 155, 60, 0.52);
    box-shadow: 0 16px 36px rgba(200, 155, 60, 0.18);
}

@media print {
    .admin-sidebar,
    .invoice-toolbar,
    .messenger-dock,
    .no-print {
        display: none !important;
    }

    .admin-shell {
        display: block;
    }

    .admin-content {
        padding: 0;
    }

    .invoice-sheet {
        margin: 0;
        max-width: none;
        padding: 0;
        box-shadow: none;
        border-radius: 0;
    }
}

.theme-mode-dark .subsection-card,
.theme-mode-dark .invoice-sheet,
.theme-mode-dark .invoice-meta div,
.theme-mode-dark .invoice-party,
.theme-mode-dark .invoice-note-box,
.theme-mode-dark .invoice-total-line,
.theme-mode-dark .feed-side-article {
    background: #18212c;
    color: #e8edf3;
    border-color: rgba(232, 237, 243, 0.12);
}


@media (max-width: 980px) {
    .form-grid-wide-3,
    .invoice-parties,
    .invoice-sheet-head {
        grid-template-columns: 1fr;
        display: grid;
    }

    .invoice-sheet {
        padding: 22px;
    }

    .invoice-toolbar-card {
        flex-direction: column;
        align-items: flex-start;
    }
}
@media (max-width: 900px) {
    .feed-sidebar {
        order: 1;
    }

    .feed-main {
        order: 2;
    }

    .admin-sidebar {
        padding: 16px 14px;
    }

    .admin-nav {
        display: flex;
        gap: 10px;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: thin;
    }

    .admin-nav a {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .admin-header,
    .gallery-admin-head,
    .finance-project-head,
    .feed-post-head,
    .feed-comment-head,
    .section-heading {
        flex-direction: column;
        align-items: flex-start;
    }

    .feed-post-tools,
    .hero-actions,
    .table-actions,
    .photo-admin-actions,
    .finance-card-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 760px) {
    .hero-shell,
    .app-shell,
    .auth-shell,
    .feed-shell {
        padding: 16px 12px 28px;
    }

    .hero-copy,
    .hero-card,
    .app-hero > div,
    .app-status,
    .auth-card,
    .panel-card,
    .stat-card {
        padding: 20px;
        border-radius: 18px;
    }

    .admin-content {
        padding: 14px;
        gap: 16px;
    }

    .admin-brand {
        font-size: 1.18rem;
    }

    h1 {
        font-size: clamp(1.8rem, 8vw, 2.4rem);
    }

    .auth-card h1,
    .app-hero h1,
    .admin-header h1 {
        font-size: clamp(1.6rem, 7vw, 2.2rem);
    }

    h2 {
        font-size: 1.18rem;
    }

    .lead,
    .auth-note,
    .feed-post-body,
    .article-excerpt,
    .article-richtext {
        font-size: 0.96rem;
        line-height: 1.6;
    }

    .hero-actions,
    .table-actions {
        gap: 10px;
        margin-top: 18px;
    }

    .hero-actions .button,
    .table-actions .button,
    .feed-comment-form .button,
    .feed-search-form .button {
        width: 100%;
    }

    .button {
        min-height: 44px;
        padding: 0 16px;
    }

    .feed-layout,
    .feed-main,
    .feed-sidebar,
    .member-grid,
    .article-list-grid,
    .finance-project-list,
    .location-stack,
    .assignment-member-list {
        gap: 16px;
    }

    .feed-topbar {
        gap: 16px;
        margin-bottom: 16px;
    }

    .feed-profile-card {
        padding: 16px;
        gap: 12px;
    }

    .feed-side-item,
    .location-card,
    .gear-check-item,
    .feed-comment-item,
    .messenger-item {
        padding: 12px 14px;
    }

    .feed-composer-head,
    .feed-post-author,
    .member-profile-head,
    .messenger-thread-person {
        align-items: flex-start;
    }

    .feed-avatar,
    .feed-avatar-image,
    .member-avatar,
    .member-avatar-image,
    .member-avatar-large,
    .member-avatar-large-fallback {
        width: 52px;
        height: 52px;
    }

    .member-avatar-large,
    .member-avatar-large-fallback {
        width: 72px;
        height: 72px;
    }

    .feed-avatar-small,
    .feed-avatar-small-image {
        width: 38px;
        height: 38px;
    }

    .feed-post-card,
    .feed-composer-card,
    .feed-side-card,
    .member-card,
    .finance-project-card,
    .invoice-sheet {
        border-radius: 18px;
    }

    .feed-post-title {
        font-size: 1.18rem;
    }

    .feed-meta-row,
    .feed-action-row,
    .feed-pagination-links,
    .section-heading-inline {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .feed-photo-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .feed-photo-grid img,
    .feed-photo-tile img {
        border-radius: 14px;
    }

    .feed-search-form,
    .feed-comment-form,
    .profile-repeat-item,
    .detail-grid,
    .assignment-grid-tight,
    .finance-breakdown-grid,
    .invoice-parties,
    .invoice-sheet-head,
    .form-grid-wide-3 {
        grid-template-columns: 1fr;
    }

    .detail-grid {
        gap: 12px;
    }

    .detail-grid div {
        padding: 12px 14px;
    }

    .location-editor {
        padding: 14px;
    }

    .location-editor-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .location-map {
        height: 220px;
        margin-top: 12px;
    }

    .gallery-admin-head {
        gap: 10px;
    }

    .photo-grid-admin {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .data-table th,
    .data-table td {
        padding: 10px 8px;
        font-size: 0.92rem;
    }

    .stat-card strong {
        font-size: 2.2rem;
    }

    .feed-side-article {
        grid-template-columns: 84px minmax(0, 1fr);
    }

    .feed-side-article-image {
        width: 84px;
        height: 68px;
    }

    .messenger-dock {
        top: 10px;
        right: 10px;
        left: 10px;
        width: auto;
    }

    .messenger-toggle {
        min-height: 40px;
        padding: 0 12px;
    }

    .messenger-panel {
        padding: 12px;
        border-radius: 16px;
    }

    .messenger-workspace {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .messenger-list,
    .messenger-thread-inline,
    .messenger-thread {
        max-height: 260px;
    }

    .invoice-sheet {
        padding: 18px;
        gap: 18px;
    }

    .invoice-meta {
        min-width: 0;
    }

    .invoice-total-line {
        padding: 12px 14px;
    }
}

@media (max-width: 520px) {
    body {
        font-size: 15px;
    }

    .hero-shell,
    .app-shell,
    .auth-shell,
    .feed-shell {
        padding: 12px 10px 22px;
    }

    .hero-copy,
    .hero-card,
    .app-hero > div,
    .app-status,
    .auth-card,
    .panel-card,
    .stat-card {
        padding: 16px;
        border-radius: 16px;
    }

    .eyebrow {
        font-size: 0.72rem;
        letter-spacing: 0.14em;
    }

    .lead,
    .auth-note {
        font-size: 0.92rem;
    }

    .feed-layout,
    .feed-main,
    .feed-sidebar,
    .member-grid,
    .article-list-grid,
    .finance-project-list {
        gap: 12px;
    }

    .feed-post-tools {
        gap: 8px;
        flex-wrap: wrap;
    }

    .feed-photo-grid {
        grid-template-columns: 1fr;
    }

    .feed-photo-more {
        font-size: 1.5rem;
    }

    .lightbox {
        padding: 10px;
    }

    .lightbox-image {
        max-width: 100%;
        max-height: 76vh;
        border-radius: 12px;
    }

    .lightbox-close {
        top: 12px;
        right: 12px;
        width: 42px;
        height: 42px;
        font-size: 1.6rem;
    }

    .lightbox-nav {
        width: 42px;
        height: 42px;
        font-size: 1.5rem;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .photo-grid-admin {
        grid-template-columns: 1fr 1fr;
    }

    .member-profile-head,
    .feed-composer-head,
    .feed-post-author,
    .feed-comment-author-block {
        gap: 10px;
    }

    .contact-list {
        flex-direction: column;
        align-items: stretch;
    }

    .contact-pill {
        justify-content: flex-start;
    }

    .messenger-dock {
        top: 8px;
        right: 8px;
        left: 8px;
    }

    .messenger-panel-head {
        margin-bottom: 10px;
    }

    .messenger-item {
        gap: 10px;
    }

    .messenger-inline-form {
        grid-template-columns: 1fr;
    }
}


@media (max-width: 760px) {
    .user-stats-grid,
    .stats-grid-three,
    .stats-grid-four {
        grid-template-columns: 1fr;
    }

    .user-stats-grid .stat-card strong,
    .stats-grid-three .stat-card strong,
    .stats-grid-four .stat-card strong {
        font-size: 1.9rem;
        line-height: 1.05;
    }
}

.detail-grid-single {
    grid-template-columns: 1fr;
}

.mail-debug-grid {
    margin-bottom: 18px;
}

.mail-debug-grid code {
    display: inline-block;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.mail-debug-failures {
    display: grid;
    gap: 12px;
}

.mail-debug-entry {
    padding: 14px 16px;
    border-radius: 14px;
    background: #f7f9fb;
    border: 1px solid rgba(23, 33, 43, 0.08);
}

.mail-debug-error {
    margin-top: 8px;
    color: #8b2f2f;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.mail-debug-log {
    margin: 0;
    padding: 18px;
    border-radius: 16px;
    background: #0f1720;
    color: #e7edf3;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 0.9rem;
    line-height: 1.6;
}

.feed-avatar,
.feed-avatar-image,
.feed-avatar-small,
.feed-avatar-small-image,
.feed-avatar-tiny,
.feed-avatar-tiny-image,
.member-avatar,
.member-avatar-image,
.member-avatar-large,
.member-avatar-large-fallback {
    flex: 0 0 auto;
    aspect-ratio: 1 / 1;
}

.feed-avatar-image,
.feed-avatar-small-image,
.feed-avatar-tiny-image,
.member-avatar-image,
.member-avatar-large {
    display: block;
    object-fit: cover;
    object-position: center top;
}

.assignment-member-avatar-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.public-site {
    --public-bg: #08111a;
    --public-surface: rgba(9, 16, 25, 0.78);
    --public-surface-strong: rgba(11, 19, 29, 0.9);
    --public-card: rgba(13, 24, 37, 0.76);
    --public-card-light: rgba(244, 247, 250, 0.9);
    --public-line: rgba(255, 255, 255, 0.08);
    --public-gold: #d8a84b;
    --public-gold-strong: #f0c46d;
    --public-text: #edf2f7;
    --public-muted: #9fb0c1;
    font-family: 'Barlow', 'Segoe UI', Tahoma, sans-serif;
    color: var(--public-text);
    background:
        radial-gradient(circle at 12% 14%, rgba(216, 168, 75, 0.2), transparent 22%),
        radial-gradient(circle at 88% 10%, rgba(33, 66, 99, 0.24), transparent 26%),
        linear-gradient(140deg, #061018 0%, #0a1520 36%, #04080d 100%);
}

.public-site-shell {
    min-height: 100vh;
    padding: 24px;
}

.public-nav-shell {
    position: sticky;
    top: 0;
    z-index: 40;
    padding-bottom: 18px;
    backdrop-filter: blur(14px);
}

.public-nav {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 18px;
    border: 1px solid var(--public-line);
    border-radius: 999px;
    background: rgba(6, 14, 22, 0.72);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.22);
}

.public-brand {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2rem;
    letter-spacing: 0.1em;
    color: #fff6e1;
}

.public-menu {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.public-menu a {
    color: var(--public-muted);
    font-weight: 600;
}

.public-menu a:hover,
.public-menu a:focus-visible {
    color: #ffffff;
}

.public-nav-cta {
    min-width: 190px;
}

.public-hero {
    max-width: 1280px;
    margin: 18px auto 34px;
    padding: 42px 0 24px;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 28px;
    align-items: stretch;
}

.public-hero-short {
    grid-template-columns: 1fr;
    padding-bottom: 12px;
}

.public-hero-copy,
.public-hero-visual,
.public-card {
    border: 1px solid var(--public-line);
    border-radius: 28px;
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.28);
}

.public-hero-copy {
    position: relative;
    overflow: hidden;
    padding: 56px;
    background:
        linear-gradient(140deg, rgba(10, 19, 28, 0.92), rgba(9, 17, 26, 0.74)),
        radial-gradient(circle at top right, rgba(240, 196, 109, 0.18), transparent 20%);
}

.public-hero-copy::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 82% 22%, rgba(240, 196, 109, 0.14), transparent 18%),
        radial-gradient(circle at 18% 86%, rgba(56, 88, 126, 0.16), transparent 22%);
    pointer-events: none;
}

.public-hero-copy h1,
.public-section-head h2,
.public-card h2,
.public-card h3,
.public-news-copy h3,
.public-news-copy h2 {
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 0.02em;
}

.public-hero-copy h1 {
    max-width: 100%;
    margin: 0 0 18px;
    font-size: clamp(3.8rem, 4vw, 4.2rem);
    line-height: 0.95;
}

.public-hero-visual {
    display: grid;
    gap: 18px;
    padding: 24px;
    background:
        linear-gradient(160deg, rgba(18, 30, 45, 0.94), rgba(11, 20, 31, 0.86)),
        radial-gradient(circle at top left, rgba(240, 196, 109, 0.16), transparent 20%);
}

.public-hero-badge {
    justify-self: start;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(240, 196, 109, 0.14);
    color: #f9dda5;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    height: fit-content;
}

.public-hero-panel {
    padding: 22px 24px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: grid;
    gap: 10px;
}

.public-hero-panel span,
.public-project-meta span {
    color: var(--public-gold-strong);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.78rem;
    font-weight: 700;
}

.public-hero-panel strong {
    font-size: 1.3rem;
    line-height: 1.35;
}

.public-hero-panel.accent {
    background: linear-gradient(135deg, rgba(216, 168, 75, 0.18), rgba(216, 168, 75, 0.04));
}

.public-highlights {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 28px;
}

.public-highlights div {
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.public-highlights strong {
    display: block;
    margin-bottom: 6px;
    color: #ffffff;
}

.public-highlights span {
    color: var(--public-muted);
    line-height: 1.55;
}

.public-section {
    max-width: 1280px;
    margin: 0 auto 34px;
    display: grid;
    gap: 22px;
}

.public-intro-grid,
.public-service-grid,
.public-why-grid,
.public-business-grid,
.public-contact-grid {
    display: grid;
    gap: 22px;
}

.public-intro-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
}

.public-service-grid,
.public-why-grid,
.public-business-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.public-contact-grid {
    grid-template-columns: minmax(320px, 0.78fr) minmax(0, 1.22fr);
}

.public-card {
    padding: 28px;
    background: var(--public-card);
    backdrop-filter: blur(10px);
}

.public-card h2,
.public-card h3,
.public-section-head h2 {
    margin: 0 0 12px;
}

.public-card p,
.public-contact-list dd,
.public-faq-item p,
.public-news-copy p,
.public-card li {
    margin: 0;
    line-height: 1.7;
    color: var(--public-muted);
}

.public-card-strong {
    background: linear-gradient(140deg, rgba(216, 168, 75, 0.16), rgba(11, 19, 29, 0.86));
}

.public-card-dark {
    background: linear-gradient(145deg, rgba(9, 16, 25, 0.96), rgba(12, 22, 34, 0.9));
}

.public-card-ghost {
    background: rgba(255, 255, 255, 0.03);
}

.public-card-wide {
    width: 100%;
}

.public-section-head {
    max-width: 880px;
    display: grid;
    gap: 10px;
}

.public-section-head.compact {
    max-width: 720px;
}

.public-section-head h2 {
    font-size: clamp(2.2rem, 4vw, 3.8rem);
    line-height: 0.98;
}

.public-project-grid,
.public-gear-grid,
.public-news-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.public-project-card,
.public-gear-card,
.public-news-card {
    display: grid;
    gap: 16px;
}

.public-project-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.public-project-meta strong,
.public-gear-head .auth-note {
    color: #d9e3ee;
}

.public-gallery-grid img,
.public-news-image,
.public-article-hero {
    width: 100%;
    display: block;
    border-radius: 20px;
    object-fit: cover;
    object-position: center top;
}

.public-news-image {
    aspect-ratio: 16 / 10;
}

.public-article-hero {
    max-height: 520px;
}

.public-news-copy {
    display: grid;
    gap: 10px;
}

.public-contact-copy {
    background: linear-gradient(145deg, rgba(12, 21, 32, 0.96), rgba(8, 15, 23, 0.92));
}

.public-contact-list {
    display: grid;
    gap: 16px;
    margin: 20px 0 0;
}

.public-contact-list dt {
    margin-bottom: 6px;
    color: #fff7e6;
    font-weight: 700;
}

.public-contact-list dd {
    margin: 0;
}

.public-contact-list a {
    color: #ffffff;
}

.public-contact-form-card {
    background: var(--public-card-light);
    color: #17212b;
}

.public-contact-form-card label span,
.public-contact-form-card .auth-note {
    color: #3c4d5e;
}

.public-contact-form-card input,
.public-contact-form-card textarea,
.public-contact-form-card select {
    background: #ffffff;
}

.public-faq-list {
    display: grid;
    gap: 12px;
}

.public-faq-item {
    padding: 18px 20px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.public-faq-item summary {
    cursor: pointer;
    font-weight: 700;
    color: #ffffff;
}

.public-faq-item p {
    margin-top: 12px;
}

.public-article-richtext {
    color: #dfe8f1;
}

.public-article-richtext p,
.public-article-richtext li,
.public-article-richtext blockquote {
    color: #d0dae4;
}

.public-site .hero-actions .button-secondary {
    border-color: rgba(255, 255, 255, 0.18);
    color: #eef4fb;
}

.public-site .article-content-card-public {
    background: var(--public-card);
    border: 1px solid var(--public-line);
}

.public-site .article-richtext img {
    border-radius: 18px;
}

.public-site .auth-note {
    color: var(--public-muted);
}

@media (max-width: 1120px) {
    .public-hero,
    .public-intro-grid,
    .public-contact-grid {
        grid-template-columns: 1fr;
    }

    .public-service-grid,
    .public-why-grid,
    .public-business-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .public-project-grid,
    .public-gear-grid,
    .public-news-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .public-site-shell {
        padding: 14px;
    }

    .public-nav-shell {
        position: static;
    }

    .public-nav {
        border-radius: 28px;
        padding: 16px;
        align-items: flex-start;
        flex-direction: column;
    }

    .public-menu {
        gap: 12px 16px;
    }

    .public-nav-cta {
        width: 100%;
    }

    .public-hero {
        margin-top: 8px;
        padding-top: 16px;
    }

    .public-hero-copy,
    .public-card,
    .public-hero-visual {
        padding: 22px;
        border-radius: 22px;
    }

    .public-hero-copy h1 {
        max-width: none;
        font-size: clamp(2.8rem, 11vw, 4.4rem);
    }

    .public-section-head h2 {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    .public-highlights,
    .public-service-grid,
    .public-why-grid,
    .public-business-grid,
    .public-contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .public-site-shell {
        padding: 10px;
    }

    .public-menu {
        flex-direction: column;
        align-items: flex-start;
    }

    .public-hero-copy,
    .public-card,
    .public-hero-visual {
        padding: 18px;
    }

    .public-highlights div,
    .public-faq-item {
        padding: 14px;
    }
}

.public-footer {
    margin-top: 56px;
    border-top: 1px solid rgba(201, 155, 60, 0.18);
    background:
        linear-gradient(180deg, rgba(8, 14, 22, 0.22), rgba(8, 14, 22, 0.86)),
        radial-gradient(circle at top left, rgba(214, 167, 74, 0.12), transparent 34%);
    color: rgba(238, 243, 248, 0.88);
}

.public-footer-inner,
.public-footer-bottom {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

.public-footer-inner {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 24px;
    padding: 28px 0 20px;
}

.public-footer-brand-block strong {
    display: block;
    margin-bottom: 8px;
    color: #fff6df;
    font-size: 1.05rem;
}

.public-footer-brand-block p,
.public-footer-meta {
    margin: 0;
    color: rgba(230, 236, 243, 0.7);
    line-height: 1.7;
}

.public-footer-links,
.public-footer-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.public-footer a {
    color: #f3d68d;
    text-decoration: none;
}

.public-footer a:hover {
    color: #fff1c2;
}

.public-footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 0 0 22px;
    color: rgba(230, 236, 243, 0.58);
    font-size: 0.92rem;
}

@media (max-width: 820px) {
    .public-footer-inner {
        grid-template-columns: 1fr;
    }

    .public-footer-bottom {
        flex-direction: column;
    }
}

.public-social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.public-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 999px;
    color: #fff7e2 !important;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.public-social-link.is-facebook {
    background: linear-gradient(135deg, #1877f2, #0f54b8);
}

.public-social-link.is-instagram {
    background: linear-gradient(135deg, #f58529, #dd2a7b 52%, #8134af 78%, #515bd4);
}

.public-social-link.is-tiktok {
    background: linear-gradient(135deg, #221b22, #09090b);
}

.public-social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
}

.public-social-icon svg {
    width: 100%;
    height: 100%;
}
    border-radius: 999px;
    background: rgba(255,255,255,0.18);
    font-size: 0.82rem;
    text-transform: uppercase;
}

.public-brand {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
}

.public-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    height: fit-content;
}

.public-hero-badge-logo {
    display: block;
    height: auto;
    width: 100%;
    object-fit: contain;
}

@media (max-width: 640px) {
    .public-hero-badge-logo {
        height: auto;
        width: 100%;
    }
}
}

.public-hero-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 62px;
    padding: 10px 18px;
    height: fit-content;
}

.public-hero-badge-logo {
    display: block;
    height: auto;
    width: 100%;
    object-fit: contain;
}

@media (max-width: 640px) {
    .public-hero-badge-logo {
        height: auto;
        width: 100%;
    }
}

.pwa-install-button {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 130;
    border: 0;
    border-radius: 999px;
    padding: 0.9rem 1.15rem;
    background: linear-gradient(135deg, #f4c15d, #d47b28);
    color: #08131f;
    font-weight: 800;
    letter-spacing: 0.02em;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
}

.pwa-install-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.34);
}

.pwa-install-button[hidden] {
    display: none;
}

@media (max-width: 720px) {
    .pwa-install-button {
        right: 0.8rem;
        bottom: 0.8rem;
        width: calc(100% - 1.6rem);
        justify-content: center;
    }
}

.public-nav-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex: 0 0 auto;
}

.public-lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 999px;
    background: rgba(7, 19, 33, 0.72);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.public-lang-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    color: #d7e3f0;
    font-size: 1.1rem;
    text-decoration: none;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.public-lang-link:hover,
.public-lang-link:focus-visible {
    background: rgba(255,255,255,0.08);
    color: #ffffff;
    transform: translateY(-1px);
}

.public-lang-link.is-active {
    background: linear-gradient(135deg, #f0a53a, #ffce73);
    color: #08131f;
    box-shadow: 0 10px 24px rgba(240, 165, 58, 0.22);
}

@media (max-width: 980px) {
    .public-nav-tools {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 640px) {
    .public-nav-tools {
        flex-direction: column;
        align-items: stretch;
    }

    .public-lang-switch {
        justify-content: center;
    }
}

.public-lang-flag {
    display: block;
    width: 26px;
    height: 26px;
    object-fit: cover;
    border-radius: 999px;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.18);
}

body.theme-app.theme-mode-light .lead {
    color: #777D80 !important;
}
