:root {
    --app-bg: #f3f0eb;
    --surface: #ffffff;
    --surface-2: #f8f6f2;
    --text: #1f2d3a;
    --muted: #607080;
    --primary: #a45b2a;
    --primary-2: #8f4d22;
    --outline: #d6dce2;
    --elev-1: 0 2px 8px rgba(27, 36, 48, 0.09);
    --elev-2: 0 10px 24px rgba(27, 36, 48, 0.14);
    --radius-card: 20px;
    --radius-control: 14px;
}

html, body {
    font-family: 'Nunito Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100%;
    color: var(--text);
    background: var(--app-bg);
}

a, .btn-link {
    color: #2f567a;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    border-color: var(--primary-2);
    box-shadow: 0 8px 18px rgba(136, 79, 38, 0.25);
    border-radius: var(--radius-control);
    min-height: 2.85rem;
    font-weight: 700;
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, #c77b41, #a55d2b);
    border-color: #8f4d22;
}

.btn {
    border-radius: var(--radius-control);
    min-height: 2.75rem;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(175, 106, 52, 0.3);
}

.content {
    padding-top: 0.8rem;
}

h1:focus {
    outline: none;
}

h1, h2, h3 {
    color: #1f2d3a;
    letter-spacing: 0.01em;
}

h1 {
    font-size: clamp(1.4rem, 5.4vw, 2rem);
    font-weight: 800;
}

h2 {
    font-size: clamp(1.05rem, 4.2vw, 1.35rem);
    font-weight: 750;
}

.form-label {
    font-weight: 600;
    color: #3f5163;
}

.form-control,
.form-select {
    border-radius: var(--radius-control);
    border: 1px solid var(--outline);
    min-height: 2.9rem;
    background: var(--surface-2);
}

.form-control::placeholder,
.form-select::placeholder {
    color: #6b7786;
}

.btn-outline-primary,
.btn-outline-secondary {
    border-radius: var(--radius-control);
    min-height: 2.8rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.journey-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.9rem;
    margin-bottom: 1rem;
}

.journey-card {
    background: var(--surface);
    border: 1px solid #e3e7ec;
    border-radius: var(--radius-card);
    padding: 1rem;
    box-shadow: var(--elev-1);
    color: var(--text);
}

.journey-card h2,
.journey-card h3,
.journey-card strong,
.journey-card .form-label {
    color: #1f2d3a;
}

.journey-card .text-muted {
    color: var(--muted) !important;
}

.leaderboard-filter-group {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.leaderboard-filter-btn {
    border: 1px solid #cfa57f;
    background: #f7ecdf;
    color: #5f3a1d;
    border-radius: 999px;
    padding: 0.45rem 0.85rem;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.2;
}

.leaderboard-filter-btn:hover {
    background: #f0dfcd;
    color: #4f3119;
}

.leaderboard-filter-btn.is-active {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    border-color: var(--primary-2);
    color: #ffffff;
}

.leaderboard-list .leaderboard-row {
    color: inherit;
    border-color: #ead8c5;
    background: #fffdf9;
}

.leaderboard-list .leaderboard-row:hover {
    background: #fbf3ea;
    color: inherit;
}

.leaderboard-rank-badge {
    background: #e7c8a9;
    color: #5c3316;
    font-weight: 800;
}

.friend-request-btn {
    border: 1px solid #cfa57f;
    background: #f7ecdf;
    color: #5f3a1d;
    font-weight: 700;
}

.friend-request-btn:hover,
.friend-request-btn:focus-visible {
    background: #f0dfcd;
    border-color: #c08f63;
    color: #4f3119;
}

.friend-request-btn:disabled {
    background: #f6eee4;
    border-color: #dcc4ad;
    color: #9a7a5f;
}

.incoming-request-grid {
    margin-top: 0.7rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 0.7rem;
}

.incoming-request-card {
    border: 1px solid #d8e2ec;
    border-radius: 1rem;
    background: #f7fafd;
    padding: 0.7rem;
    display: grid;
    gap: 0.6rem;
}

.incoming-request-user {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 0.6rem;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.incoming-request-user:hover,
.incoming-request-user:focus-visible {
    text-decoration: none;
}

.incoming-request-avatar {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    object-fit: cover;
    border: 2px solid #ffffff;
    box-shadow: 0 4px 10px rgba(57, 70, 84, 0.18);
    background: #eef2f7;
}

.incoming-request-name {
    font-weight: 700;
    color: #1f2d3a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.incoming-request-actions {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.settings-shell {
    display: grid;
    gap: 1rem;
}

.settings-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.settings-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    border: 1px solid #d4dde7;
    background: #f8fbff;
    color: #35506b;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
}

.settings-chip:hover {
    background: #edf4fb;
    color: #24394d;
}

.settings-layout-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.settings-section {
    scroll-margin-top: 5.5rem;
}

.settings-kicker {
    margin: 0 0 0.6rem;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6a8097;
    font-weight: 700;
}

.settings-title {
    margin-top: 0.25rem;
    margin-bottom: 0.9rem;
    font-size: 1.12rem;
}

.settings-subtitle {
    margin-top: 0;
    margin-bottom: 0.65rem;
    font-size: 1rem;
}

.settings-divider {
    margin: 1rem 0;
    border-color: #e6edf3;
}

.settings-danger-zone {
    border: 1px solid #f1d7d9;
    background: #fff8f8;
    border-radius: 0.75rem;
    padding: 0.8rem;
}

.settings-danger-panel details > summary {
    cursor: pointer;
    font-weight: 700;
    color: #7f1d1d;
}

.settings-danger-panel details > summary::marker {
    color: #b91c1c;
}

.metrics-card {
    margin-top: 1rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.6rem 0.85rem;
}

.journey-map {
    width: 100%;
    min-height: 360px;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid #cfd7df;
}

.table {
    background: var(--surface);
    border-radius: 14px;
    overflow: hidden;
}

.table thead th {
    background: #f0f4f8;
    color: #364a5c;
    border-bottom: 1px solid #d9e0e8;
}

.table tbody td {
    vertical-align: middle;
}

.daily-entries-list {
    display: grid;
    gap: 0.65rem;
    margin-top: 0.7rem;
}

.daily-entry-card {
    border: 1px solid #d7e0e8;
    border-radius: 0.9rem;
    background: #f7fafc;
    padding: 0.75rem 0.85rem;
}

.daily-entry-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.12rem 0;
}

.daily-entry-label {
    font-size: 0.78rem;
    color: #607488;
}

.daily-entry-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1f2d3a;
    text-align: right;
}

.daily-entry-actions {
    margin-top: 0.55rem;
}

.daily-entry-actions .btn {
    width: 100%;
}

.daily-entries-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.75rem;
}

.progress {
    border-radius: 999px;
    height: 0.9rem;
    background: #e3e9ef;
}

.progress-bar {
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.map-layout-root {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.full-map-page {
    position: relative;
    width: 100%;
    min-height: 26rem;
    height: calc(100vh - 2.5rem);
}

.full-map-toolbar {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.6rem;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

@media (min-width: 900px) {
    .journey-card {
        padding: 1.2rem;
        box-shadow: var(--elev-2);
    }

    .settings-layout-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    .daily-entries-list {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    }

    .daily-entry-actions .btn {
        width: auto;
    }

    .content {
        padding-top: 1.2rem;
    }
}

.full-map-label {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
}

.full-map-account {
    width: 120px;
}

.full-map-legend {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-left: 0.25rem;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
}

.legend-swatch {
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 999px;
}

.legend-swatch-red {
    background: #c92a2a;
}

.legend-swatch-blue {
    background: #0b7285;
}

.legend-swatch-orange {
    background: #f08c00;
}

.full-journey-map {
    width: 100%;
    height: 100%;
}

.avatar-marker {
    background: transparent;
    border: none;
}

.avatar-marker img {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 2px solid #f08c00;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    object-fit: cover;
    background: #fff;
}

.avatar-marker-self img {
    width: 40px;
    height: 40px;
    border-color: #c92a2a;
}

.route-poi-card-preview-wrap {
    max-width: 520px;
}

.route-poi-card-preview-image {
    display: none;
    width: 100%;
    aspect-ratio: 1 / 1;
    border: 1px solid #dbe4ea;
    border-radius: 0.5rem;
    box-shadow: 0 0.45rem 1rem rgba(0, 0, 0, 0.12);
    background: #eef2f7;
}

.route-poi-card-preview-loading {
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 1 / 1;
    border: 1px dashed #c6d4e1;
    border-radius: 0.5rem;
    background: #f5f8fb;
}

.route-poi-card-preview {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 0;
    border: 1px solid #dbe4ea;
    background: #e9e4d2;
    color: #1f2a36;
    box-shadow: 0 0.45rem 1rem rgba(0, 0, 0, 0.12);
    padding: 0.5rem;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 0.3rem;
}

.route-poi-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.route-poi-bg-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(20, 21, 24, 0.24), rgba(24, 25, 28, 0.36) 44%, rgba(22, 23, 26, 0.48) 100%);
    z-index: 0;
}

.route-poi-card-preview > *:not(.route-poi-bg):not(.route-poi-bg-overlay) {
    position: relative;
    z-index: 1;
}

.route-poi-header {
    background: #e7eff7;
    border: 1px solid #c5d4e2;
    border-radius: 0.6rem;
    padding: 0.24rem 0.4rem;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
}

.route-poi-name {
    margin: 0;
    color: #1a2432;
    font-size: clamp(1.05rem, 3.4vw, 1.55rem);
    font-weight: 700;
    line-height: 1.08;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.route-poi-image-wrap {
    border-radius: 0.6rem;
    overflow: hidden;
    border: 2px solid rgba(142, 117, 44, 0.58);
    background: #f5f0e1;
    min-height: 96px;
}

.route-poi-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.route-poi-content {
    padding: 0.34rem;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 0.12rem;
    background: transparent;
    border: none;
    border-radius: 0.65rem;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    min-height: 0;
    overflow: hidden;
}

.route-poi-user {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 0.3rem;
    align-items: center;
    min-width: 0;
    background: #edf3f8;
    border: 1px solid #c7d6e3;
    border-radius: 0.5rem;
    padding: 0.18rem;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.route-poi-avatar {
    width: 52px;
    height: 52px;
    border-radius: 999px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.62);
    display: block;
}

.route-poi-user-name {
    font-size: clamp(0.92rem, 2.45vw, 1.22rem);
    font-weight: 700;
    line-height: 1.08;
    color: #1c2634;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.route-poi-subtitle {
    font-size: clamp(0.8rem, 1.95vw, 1rem);
    line-height: 1.08;
    color: #253244;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.route-poi-meta {
    font-size: clamp(0.68rem, 1.65vw, 0.82rem);
    color: #2f3c4e;
}

.route-poi-brandline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0 0.15rem;
}

.route-poi-attribution {
    font-size: 0.58rem;
    color: rgba(243, 244, 248, 0.9);
    line-height: 1;
}

.route-poi-watermark {
    font-size: 0.58rem;
    color: rgba(243, 244, 248, 0.9);
    opacity: 0.95;
    line-height: 1;
}


.route-poi-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.16rem;
}

.route-poi-stat {
    display: grid;
    gap: 0.05rem;
    background: #f1f6fb;
    border: 1px solid #c9d8e5;
    border-radius: 0.45rem;
    padding: 0.18rem 0.28rem;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.route-poi-stat-label {
    font-size: 0.52rem;
    color: #2c3542;
    line-height: 1.1;
}

.route-poi-stat strong {
    font-size: 0.64rem;
    color: #1d232d;
    line-height: 1.2;
}

.route-poi-lower {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: 0.2rem;
    align-items: stretch;
    min-height: 0;
    height: 118px;
}

.route-poi-route-wrap {
    margin-top: 0.35rem;
}

.route-poi-route-title {
    font-size: 0.54rem;
    opacity: 0.9;
    margin-bottom: 0.15rem;
}

.route-poi-position-wrap {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 0.12rem;
    margin-top: 0;
    min-width: 0;
    min-height: 0;
    height: 100%;
    padding: 0.14rem;
    background: #eaf1f8;
    border: 1px solid #c7d6e3;
    border-radius: 0.5rem;
    overflow: hidden;
}

.route-poi-position-map {
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: 0;
    display: block;
    background: #eef4f9;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid #c9d8e5;
    box-shadow: none;
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

.route-poi-photo-wrap {
    min-width: 0;
    min-height: 0;
    height: 100%;
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: #d9e4ef;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 1px solid #c7d6e3;
    box-shadow: none;
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

.route-poi-photo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: contrast(1.08) saturate(1.06) brightness(1.01);
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

#route-poi-mini-map {
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
    overflow: hidden;
}

@media (max-width: 576px) {
    .route-poi-lower {
        height: 114px;
    }

    .route-poi-position-wrap,
    .route-poi-photo-wrap {
        padding-bottom: 0.2rem;
    }
}

.route-poi-generated {
    text-align: left;
    white-space: nowrap;
    opacity: 0.85;
    margin-top: 0.03rem;
    line-height: 1;
}

.route-poi-footnote {
    display: grid;
    gap: 0.08rem;
    padding-top: 0.06rem;
    border-top: 1px solid rgba(255, 255, 255, 0.5);
}

.route-poi-distance {
    line-height: 1.2;
}

.route-poi-source {
    display: flex;
    align-items: baseline;
    gap: 0.32rem;
    flex-wrap: wrap;
}

.route-poi-source a {
    color: #1c2d4f;
    font-weight: 700;
    text-decoration: none;
    font-size: 0.62rem;
}

.route-poi-source span {
    font-size: 0.58rem;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.route-poi-source a:hover,
.route-poi-source a:focus {
    text-decoration: underline;
}

.profile-hero-card {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 0.9rem;
    align-items: center;
    background: linear-gradient(140deg, #fff6ee, #fffefc 58%, #f2f7fb);
}

.profile-hero-avatar {
    width: 88px;
    height: 88px;
    border-radius: 999px;
    object-fit: cover;
    border: 3px solid #ffffff;
    box-shadow: 0 8px 16px rgba(57, 70, 84, 0.2);
    background: #f6f8fb;
}

.profile-hero-copy {
    min-width: 0;
}

.profile-hero-name {
    margin: 0;
    font-size: clamp(1.25rem, 5vw, 1.8rem);
}

.profile-hero-username {
    margin: 0.15rem 0 0;
    color: #48607a;
    font-weight: 600;
}

.profile-hero-joined {
    margin: 0.35rem 0 0;
    color: #5f7487;
    font-size: 0.92rem;
}

.profile-hidden-badge {
    margin: 0.5rem 0 0;
    display: inline-block;
    border: 1px solid #f0b369;
    border-radius: 999px;
    background: #fff0df;
    color: #8a3f00;
    padding: 0.22rem 0.62rem;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

.profile-stats-card,
.profile-visibility-card,
.profile-routes-card,
.profile-countries-card,
.profile-sources-card,
.profile-friends-card {
    margin-top: 1rem;
}

.profile-visibility-card {
    background: linear-gradient(140deg, #fff9f3, #fffefc 58%, #f8f2ea);
}

.profile-visibility-warning {
    border: 1px solid #e8c8a7;
    border-radius: 0.8rem;
    background: #fff3e6;
    color: #7a3f16;
    padding: 0.7rem 0.8rem;
    font-weight: 600;
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 0.75rem;
    margin-top: 0.55rem;
}

.profile-stat-item {
    border: 1px solid #d8e2ec;
    border-radius: 1rem;
    background: #f6fafd;
    padding: 0.8rem 0.95rem;
}

.profile-stat-label {
    margin: 0;
    color: #587189;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 700;
}

.profile-stat-value {
    margin-top: 0.2rem;
    display: block;
    color: #1d3247;
    font-size: clamp(1.15rem, 4.2vw, 1.6rem);
}

.profile-route-list {
    margin-top: 0.65rem;
    display: grid;
    gap: 0.65rem;
}

.profile-route-item {
    border: 1px solid #ead8c5;
    border-radius: 1rem;
    background: #fffdf9;
    padding: 0.8rem 0.95rem;
}

.profile-route-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.profile-route-line {
    color: #3e2a1d;
    font-weight: 700;
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.profile-route-point {
    overflow-wrap: anywhere;
}

.profile-route-arrow {
    color: #8a6241;
}

.profile-route-current {
    display: inline-block;
    border-radius: 999px;
    background: #f7ecdf;
    color: #5f3a1d;
    border: 1px solid #cfa57f;
    padding: 0.18rem 0.58rem;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.profile-route-progress-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.65rem;
    align-items: center;
    margin-top: 0.55rem;
}

.profile-route-progress {
    height: 0.72rem;
    background: #f0e1cf;
}

.profile-route-progress .progress-bar {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.profile-route-progress-value {
    color: #5f3a1d;
    font-size: 0.92rem;
}

.profile-country-list {
    list-style: none;
    padding: 0;
    margin: 0.65rem 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.profile-country-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    border: 1px solid #cfdbe7;
    background: #eff5fb;
    color: #294660;
    padding: 0.35rem 0.72rem;
    font-weight: 650;
    font-size: 0.86rem;
}

.profile-country-name {
    line-height: 1;
}

.profile-source-link {
    color: inherit;
    text-decoration: none;
    line-height: 1;
}

.profile-source-link:hover,
.profile-source-link:focus-visible {
    text-decoration: underline;
}

.profile-friend-link {
    color: inherit;
    text-decoration: none;
}

.profile-friend-link:hover,
.profile-friend-link:focus-visible {
    text-decoration: underline;
}

.profile-friend-grid {
    margin-top: 0.7rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.65rem;
}

.profile-friend-card {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid #d6e1eb;
    border-radius: 0.95rem;
    background: #f5f9fd;
    color: #1f2d3a;
    text-decoration: none;
}

.profile-friend-card:hover,
.profile-friend-card:focus-visible {
    background: #ebf3fb;
    border-color: #bfd2e4;
    text-decoration: none;
}

.profile-friend-avatar {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    object-fit: cover;
    border: 2px solid #ffffff;
    box-shadow: 0 4px 10px rgba(57, 70, 84, 0.18);
    background: #eef2f7;
}

.profile-friend-card-name {
    font-weight: 700;
    color: #1f2d3a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-country-remove-x {
    display: inline-block;
    border: 0;
    background: transparent;
    color: #c81e1e;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1;
    padding: 0;
    cursor: pointer;
}

.profile-country-remove-x:hover,
.profile-country-remove-x:focus-visible {
    color: #a31515;
}

.profile-country-remove-x:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-width: 576px) {
    .profile-hero-card {
        grid-template-columns: 1fr;
        text-align: center;
        justify-items: center;
    }

    .profile-hero-copy {
        text-align: center;
    }
}