:root {
    --ink: #f1f7fa;
    --muted: #9db4bd;
    --line: rgba(255, 255, 255, .1);
    --bg: #071727;
    --panel: rgba(6, 22, 37, .84);
    --panel-solid: #061625;
    --accent: #14c7c2;
    --accent-2: #ff7a45;
    --accent-3: #247c8a;
    --green: #66d49b;
    --red: #ff8d86;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
    margin: 0;
    background: linear-gradient(135deg, #06162d 0%, #0b2a33 55%, #123c42 100%);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
    min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
.topbar {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 14px 34px;
    background: rgba(6, 22, 37, .94);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 20;
}
.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    min-width: 0;
}
.brand-zone {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.brand {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.brand img {
    width: 34px;
    height: 34px;
    border-radius: 8px;
}
.profile-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 6px 12px 6px 7px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, .055);
    color: #fff;
}
.profile-chip img,
.profile-chip span {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
}
.profile-chip span {
    display: grid;
    place-items: center;
    background: rgba(20,199,194,.18);
    font-weight: 900;
}
.header-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(255,255,255,.045);
}
.header-icon svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}
.header-icon.active,
.header-icon:hover {
    color: #fff;
    background: rgba(20, 199, 194, .12);
}
.message-icon.has-unread {
    color: #fff;
    border-color: rgba(255,255,255,.42);
    animation: messagePulse 1.6s ease-in-out infinite;
}
.message-icon span {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #ff7a45;
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    border: 2px solid #061625;
}
@keyframes messagePulse {
    0%, 100% { transform: translateY(0); box-shadow: 0 0 0 rgba(255,255,255,0); }
    50% { transform: translateY(-2px); box-shadow: 0 0 24px rgba(255,255,255,.22); }
}
nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
nav a {
    color: var(--muted);
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
}
nav a.active, nav a:hover { background: rgba(20, 199, 194, .12); color: #fff; }
nav svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    fill: currentColor;
}
.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, .05);
}
.lang-switch a {
    color: var(--muted);
    width: 38px;
    height: 30px;
    padding: 5px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
}
.lang-switch a.active, .lang-switch a:hover {
    background: rgba(20, 199, 194, .16);
    color: #fff;
}
.flag {
    position: relative;
    display: block;
    width: 24px;
    height: 16px;
    overflow: hidden;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(255,255,255,.22);
}
.flag i { display: none; }
.flag-pl { background: linear-gradient(#fff 0 50%, #dc143c 50% 100%); }
.flag-de { background: linear-gradient(#111 0 33.33%, #dd0000 33.33% 66.66%, #ffce00 66.66% 100%); }
.flag-ua { background: linear-gradient(#0057b7 0 50%, #ffd700 50% 100%); }
.flag-gb {
    background:
        linear-gradient(27deg, transparent 44%, #fff 44% 50%, #c8102e 50% 55%, #fff 55% 61%, transparent 61%),
        linear-gradient(153deg, transparent 44%, #fff 44% 50%, #c8102e 50% 55%, #fff 55% 61%, transparent 61%),
        linear-gradient(#012169 0 100%);
}
.flag-gb::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, transparent 38%, #fff 38% 62%, transparent 62%),
        linear-gradient(transparent 30%, #fff 30% 70%, transparent 70%);
}
.flag-gb::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, transparent 43%, #c8102e 43% 57%, transparent 57%),
        linear-gradient(transparent 38%, #c8102e 38% 62%, transparent 62%);
}
.container { width: min(1180px, calc(100% - 32px)); margin: 28px auto 52px; }
.page-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 18px;
    margin-bottom: 24px;
}
h1, h2, h3 { margin: 0 0 10px; line-height: 1.15; }
h1 { font-size: 34px; }
h2 { font-size: 21px; }
h3 { font-size: 18px; }
p { margin: 0 0 14px; }
.muted, small { color: var(--muted); }
.button, button {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .06);
    color: var(--ink);
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
}
.danger {
    border-color: rgba(255, 141, 134, .36);
    color: var(--red);
}
.primary, button.primary {
    background: linear-gradient(135deg, #ff7a45, #24b8c9);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 14px 28px rgba(36, 184, 201, .22);
}
.auth-shell {
    min-height: calc(100vh - 110px);
    display: grid;
    place-items: center;
    background:
        linear-gradient(135deg, rgba(3, 38, 85, .92), rgba(7, 23, 39, .72)),
        url("https://images.unsplash.com/photo-1507525428034-b723cf961d3e?auto=format&fit=crop&w=1600&q=80");
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    padding: 44px 28px;
}
.auth-panel, .panel, .card, .metric {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .35);
    backdrop-filter: blur(18px);
}
.auth-panel { width: min(500px, 100%); padding: 34px; }
.auth-stats {
    display: grid;
    gap: 3px;
    margin: 0 0 18px;
    padding: 13px 14px;
    border: 1px solid rgba(20, 199, 194, .24);
    border-radius: 8px;
    background: rgba(20, 199, 194, .08);
}
.auth-stats strong {
    color: var(--accent);
    font-size: 30px;
    line-height: 1;
}
.auth-stats span {
    color: #fff;
    font-weight: 900;
}
.auth-stats small {
    margin-top: 3px;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.form-grid:not(.wide) { grid-template-columns: 1fr; }
label { display: grid; gap: 7px; font-weight: 700; color: #dce9ee; }
input, textarea, select {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 8px;
    padding: 11px 12px;
    font: inherit;
    background: rgba(2, 14, 29, .72);
    color: #fff;
}
input::placeholder, textarea::placeholder { color: #78939e; }
textarea { resize: vertical; }
.check-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, .04);
}
.check-card input {
    width: 22px;
    height: 22px;
    margin-top: 3px;
    flex: 0 0 auto;
    accent-color: var(--accent);
}
.check-card span { display: grid; gap: 4px; }
.check-card small {
    color: var(--muted);
    font-weight: 500;
    line-height: 1.45;
}
.full { grid-column: 1 / -1; }
.alert {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    background: rgba(6, 22, 37, .9);
    border: 1px solid var(--line);
}
.alert.success { border-color: rgba(102, 212, 155, .45); color: var(--green); }
.alert.error { border-color: rgba(255, 141, 134, .45); color: var(--red); }
.cards, .metric-grid, .stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}
.list-tools {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(190px, 240px) auto auto;
    gap: 12px;
    align-items: end;
    margin: 0 0 18px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, .035);
}
.list-tools label {
    margin: 0;
}
.list-tools label span {
    color: var(--muted);
    font-size: 13px;
}
.dashboard-panels { margin-top: 26px; }
.metric {
    color: inherit;
    text-decoration: none;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.metric:hover, .link-panel:hover {
    transform: translateY(-2px);
    border-color: rgba(20, 199, 194, .34);
    background: rgba(8, 28, 45, .82);
}
.link-panel {
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.card, .panel, .metric { padding: 18px; }
.card { position: relative; }
.trip-card { padding-right: 64px; }
.trip-flag {
    position: absolute;
    top: 16px;
    right: 16px;
    display: grid;
    place-items: center;
    min-width: 38px;
    height: 30px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .14);
    font-size: 20px;
    line-height: 1;
}
.unread-message {
    border-color: rgba(255, 122, 69, .35);
    box-shadow: 0 20px 54px rgba(255, 122, 69, .09);
}
.card.plan { border-left: 4px solid var(--accent-2); }
.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 4px;
}
.card-actions form { margin: 0; }
.metric strong { display: block; font-size: 34px; color: var(--accent); }
.split {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(280px, .9fr);
    gap: 18px;
    margin-bottom: 24px;
}
.map {
    width: 100%;
    height: 420px;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: #0e2b34;
    margin-bottom: 16px;
}
.form-map {
    height: 360px;
    margin: 4px 0 6px;
}
.map-popup-button {
    display: inline-flex;
    margin-top: 8px;
    padding: 7px 10px;
    border-radius: 8px;
    background: linear-gradient(135deg, #ff7a45, #24b8c9);
    color: #fff !important;
    font-weight: 800;
}
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    background: #061625;
    color: #f1f7fa;
}
.leaflet-popup-content {
    color: #f1f7fa;
}
.map.large { height: 680px; }
.map-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    padding: 12px;
    margin: 14px 0 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, .035);
}
.map-toggle,
.map-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 8px;
    background: rgba(2, 14, 29, .42);
    color: #dce9ee;
    font-weight: 800;
}
.map-toggle input {
    width: 20px;
    height: 20px;
    accent-color: var(--accent);
}
.map-toggle-soft {
    color: var(--muted);
}
.map-control select {
    min-width: 130px;
    padding: 7px 28px 7px 10px;
}
.map-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: -4px 0 14px;
    color: var(--muted);
}
.map-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-weight: 800;
}
.map-legend i {
    width: 14px;
    height: 14px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--dot);
    box-shadow: 0 2px 10px rgba(0,0,0,.28);
}
.page-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}
.route-summary {
    display: grid;
    gap: 4px;
    margin: -2px 0 16px;
    padding: 12px 14px;
    border: 1px solid rgba(20, 199, 194, .2);
    border-radius: 8px;
    background: rgba(20, 199, 194, .08);
}
.start-info {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    margin: -2px 0 16px;
    padding: 16px;
    border: 1px solid rgba(124, 92, 255, .42);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(124, 92, 255, .22), rgba(6, 22, 37, .82));
    box-shadow: 0 18px 42px rgba(124, 92, 255, .1);
}
.photo-map-info {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    margin: -2px 0 16px;
    padding: 16px;
    border: 1px solid rgba(247, 201, 72, .42);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(247, 201, 72, .18), rgba(6, 22, 37, .82));
    box-shadow: 0 18px 42px rgba(247, 201, 72, .08);
}
.photo-info-dot {
    width: 22px;
    height: 22px;
    border: 4px solid #fff;
    border-radius: 50%;
    background: #f7c948;
    box-shadow: 0 0 0 6px rgba(247, 201, 72, .2), 0 10px 24px rgba(0, 0, 0, .34);
    margin-top: 3px;
}
.photo-map-info strong {
    display: block;
    color: #ffe38a;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 5px;
}
.photo-map-info h2 { margin-bottom: 6px; }
.photo-map-info p { margin-bottom: 0; color: var(--muted); }
.start-info-dot {
    width: 22px;
    height: 22px;
    border: 4px solid #fff;
    border-radius: 50%;
    background: #7c5cff;
    box-shadow: 0 0 0 6px rgba(124, 92, 255, .24), 0 10px 24px rgba(0, 0, 0, .34);
    margin-top: 3px;
}
.start-info strong {
    display: block;
    color: #bfb4ff;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 5px;
}
.start-info h2 { margin-bottom: 6px; }
.start-info p { margin-bottom: 6px; }
.start-info small { color: #d6d0ff; }
.route-summary span {
    color: #8ff2ee;
    font-size: 22px;
    font-weight: 900;
}
.form-section {
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 8px;
    background: rgba(255, 255, 255, .035);
}
.form-section h2 { margin-bottom: 14px; }
.form-grid.nested { margin-top: 0; }
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin: 10px 0 22px;
}
.gallery.compact {
    grid-template-columns: repeat(auto-fill, minmax(120px, 160px));
    justify-content: start;
    margin-bottom: 0;
}
.trip-gallery {
    grid-template-columns: repeat(auto-fill, minmax(180px, 240px));
    justify-content: start;
}
.gallery img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
}
.photo-tile {
    position: relative;
    margin: 0;
    min-width: 0;
}
.photo-tile img {
    display: block;
}
.photo-tile form {
    position: absolute;
    top: 8px;
    right: 8px;
    margin: 0;
    opacity: 0;
    transition: opacity .18s ease;
}
.photo-tile:hover form,
.photo-tile:focus-within form {
    opacity: 1;
}
.photo-delete {
    width: auto;
    min-height: 30px;
    padding: 6px 9px;
    border-radius: 999px;
    border: 1px solid rgba(255, 141, 134, .5);
    background: rgba(6, 22, 37, .92);
    color: #ffb1ac;
    font-size: 12px;
    font-weight: 900;
    box-shadow: 0 8px 22px rgba(0,0,0,.32);
}
.photo-delete:hover {
    background: rgba(255, 141, 134, .18);
    color: #fff;
}
.list-row, .bar-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
}
.list-row:last-child, .bar-row:last-child { border-bottom: 0; }
.country-stat {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}
.country-stat:last-child { border-bottom: 0; }
.country-stat .bar-row {
    padding: 0;
    border-bottom: 0;
}
.country-mini-map {
    height: 58px;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: #0e2b34;
}
.country-mini-map .leaflet-control-container {
    display: none;
}
.pill {
    display: inline-block;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(20, 199, 194, .12);
    color: #8ff2ee;
    margin: 0 6px 8px 0;
    font-weight: 700;
}
.place-stat-badge {
    display: inline-flex;
    width: fit-content;
    margin: -4px 0 10px;
    padding: 5px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .12);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}
.place-stat-badge.is-counted {
    border-color: rgba(244, 191, 74, .42);
    background: rgba(244, 191, 74, .12);
    color: #f6d47f;
}
.recommendation-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 10px 0 4px;
}
.recommendation-tags span {
    display: inline-flex;
    width: fit-content;
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(20, 199, 194, .12);
    color: #8ff2ee;
    font-size: 12px;
    font-weight: 900;
}
.inline-form { display: flex; gap: 8px; margin-top: 12px; }
.site-footer {
    border-top: 1px solid rgba(20, 199, 194, .16);
    background:
        radial-gradient(circle at 28% 0%, rgba(20, 199, 194, .1), transparent 32%),
        rgba(2, 14, 29, .72);
    padding: 36px 16px 26px;
    margin-top: 52px;
}
.footer-container {
    width: min(1180px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(320px, 1.6fr);
    gap: 28px;
    align-items: center;
}
.footer-brand p {
    color: var(--muted);
    margin-top: 10px;
    max-width: 360px;
}
.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    font-size: 22px;
    font-weight: 900;
}
.footer-logo img {
    width: 38px;
    height: 38px;
    border-radius: 8px;
}
.footer-apps-title {
    margin: 0 0 12px;
    color: #dce9ee;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.footer-apps-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.footer-app-link {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 9px;
    min-width: 0;
    color: #fff;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 8px;
    background: rgba(255, 255, 255, .045);
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.footer-app-link:hover {
    transform: translateY(-2px);
    border-color: rgba(20, 199, 194, .42);
    background: rgba(20, 199, 194, .08);
}
.footer-app-link img {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
}
.footer-app-link span {
    display: grid;
    gap: 2px;
    min-width: 0;
}
.footer-app-link strong,
.footer-app-link small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.footer-app-link strong {
    font-size: 14px;
    line-height: 1.15;
}
.footer-app-link small {
    color: var(--muted);
    font-size: 11px;
}
.footer-bottom {
    width: min(1180px, 100%);
    margin: 28px auto 0;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}
.timeline { display: grid; gap: 12px; }
.timeline-item { padding: 16px; border-left: 4px solid var(--accent); background: var(--panel); border-radius: 8px; }
.empty { color: var(--muted); padding: 18px 0; }
.profile-card { text-align: center; }
.profile-avatar-large {
    width: 118px;
    height: 118px;
    border-radius: 18px;
    object-fit: cover;
    margin: 0 auto 14px;
    border: 1px solid rgba(255,255,255,.18);
}
.profile-avatar-large.placeholder {
    display: grid;
    place-items: center;
    background: rgba(20,199,194,.18);
    color: #fff;
    font-size: 44px;
    font-weight: 900;
}
.custom-marker span {
    display: block;
    width: 18px;
    height: 18px;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0,0,0,.28);
}
.custom-marker.year-marker {
    width: auto !important;
    height: 22px !important;
}
.custom-marker.year-marker .marker-wrap {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transform: translateY(-2px);
}
.custom-marker.year-marker span {
    flex: 0 0 auto;
}
.marker-year {
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(6, 22, 37, .92);
    border: 1px solid rgba(255,255,255,.18);
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.2;
    box-shadow: 0 2px 10px rgba(0,0,0,.28);
}
.custom-marker.selected-marker span {
    width: 26px;
    height: 26px;
    border: 4px solid #fff;
    box-shadow: 0 0 0 6px rgba(255, 122, 69, .25), 0 10px 24px rgba(0, 0, 0, .38);
}
.map-photo-thumb {
    display: block;
    width: 170px;
    max-width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    margin-top: 8px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.18);
}

.pwa-install-btn {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 80;
    width: min(248px, calc(100vw - 32px));
    display: grid;
    gap: 3px;
    justify-items: start;
    padding: 13px 16px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(255, 122, 69, .96), rgba(36, 184, 201, .96));
    color: #fff;
    box-shadow: 0 18px 42px rgba(0, 0, 0, .34);
}
.pwa-install-btn span {
    color: rgba(255,255,255,.82);
    font-size: 12px;
    font-weight: 800;
}
.pwa-install-btn strong {
    font-size: 16px;
    line-height: 1.2;
}
.pwa-install-help {
    position: fixed;
    right: 22px;
    bottom: 92px;
    z-index: 82;
    width: min(320px, calc(100vw - 32px));
    padding: 18px 42px 18px 18px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 8px;
    background: rgba(6, 22, 37, .96);
    color: var(--ink);
    box-shadow: 0 22px 70px rgba(0, 0, 0, .42);
}
.pwa-install-help p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 14px;
}
.install-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    min-height: 28px;
    padding: 0;
    border-radius: 8px;
}

@media (max-width: 820px) {
    .topbar, .page-head { align-items: flex-start; flex-direction: column; }
    .page-actions { justify-content: flex-start; }
    .topbar {
        position: static;
        gap: 14px;
        padding: 14px 16px;
    }
    .topbar-actions {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }
    .brand-zone {
        width: 100%;
        flex-wrap: wrap;
    }
    .profile-chip {
        max-width: 100%;
    }
    nav {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
    }
    nav a {
        justify-content: center;
        min-width: 0;
        padding: 9px 8px;
    }
    nav a span { display: none; }
    nav svg { width: 22px; height: 22px; }
    .lang-switch {
        align-self: flex-start;
        width: auto;
    }
    .split, .form-grid.wide { grid-template-columns: 1fr; }
    h1 { font-size: 28px; }
    .map.large { height: 520px; }
    .container {
        width: min(100% - 20px, 720px);
        margin-top: 16px;
    }
    .auth-shell {
        min-height: calc(100vh - 170px);
        padding: 18px;
    }
    .auth-panel { padding: 24px; }
    .cards, .metric-grid, .stat-grid {
        grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    }
}

@media (max-width: 520px) {
    .brand { font-size: 21px; }
    .brand img { width: 31px; height: 31px; }
    nav { grid-template-columns: repeat(4, 1fr); }
    .list-tools { grid-template-columns: 1fr; }
    .form-grid, .form-grid.wide { grid-template-columns: 1fr; }
    .page-head { gap: 10px; }
    h1 { font-size: 24px; }
    h2 { font-size: 19px; }
    .button, button { width: 100%; }
    .page-actions { width: 100%; }
    .card-actions { flex-direction: column; }
    .inline-form { flex-direction: column; }
    .footer-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .footer-apps-list {
        grid-template-columns: 1fr;
    }
    .map { height: 340px; }
    .form-map { height: 320px; }
    .map.large { height: 430px; }
    .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .trip-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .photo-tile form { opacity: 1; }
    .list-row, .bar-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }
    .stat-grid, .cards, .metric-grid {
        grid-template-columns: 1fr;
    }
    .pwa-install-btn {
        right: 12px;
        bottom: 12px;
    }
    .pwa-install-help {
        right: 12px;
        bottom: 82px;
    }
}
