:root {
    --petcare-primary: #6f42c1;
    --petcare-primary-dark: #4b2a88;
    --petcare-soft: #f6f3fb;
}

body {
    min-height: 100vh;
    background: var(--petcare-app-background, #f7f8fb);
    color: #23242a;
}

.petcare-navbar {
    background: linear-gradient(110deg, var(--petcare-primary-dark), var(--petcare-primary));
}

.brand-mark { filter: drop-shadow(0 2px 2px rgba(0,0,0,.2)); }

.hero-section {
    color: #fff;
    background:
        radial-gradient(circle at 80% 20%, rgba(255,255,255,.18), transparent 28rem),
        linear-gradient(135deg, #4b2a88 0%, #7b4bc4 55%, #9b65d1 100%);
}

.hero-card,
.auth-card,
.dashboard-card,
.feature-card,
.stat-card {
    background: #fff;
    border: 1px solid rgba(20, 22, 35, .08);
    border-radius: 1.25rem;
}

.hero-card { padding: 2rem; }
.auth-card { max-width: 42rem; padding: clamp(1.25rem, 4vw, 2.5rem); box-shadow: 0 1rem 3rem rgba(43, 28, 78, .08); }
.dashboard-card { padding: 1.5rem; }
.feature-card { padding: 1.5rem; transition: transform .2s ease, box-shadow .2s ease; }
.feature-card:hover { transform: translateY(-3px); box-shadow: 0 .8rem 2rem rgba(43, 28, 78, .08); }
.feature-icon { font-size: 2rem; margin-bottom: .8rem; }
.stat-card { padding: 1.25rem; text-align: center; }

.btn-primary {
    --bs-btn-bg: var(--petcare-primary);
    --bs-btn-border-color: var(--petcare-primary);
    --bs-btn-hover-bg: var(--petcare-primary-dark);
    --bs-btn-hover-border-color: var(--petcare-primary-dark);
}

a { color: var(--petcare-primary); }
.code-input { letter-spacing: .45rem; font-weight: 700; }

@media (max-width: 575.98px) {
    .auth-card { border-radius: .9rem; }
}

/* PetCare v002: výběrové karty onboardingu */
.selection-card {
    border: 1px solid var(--bs-border-color);
    border-radius: 0.85rem;
    padding: 1rem;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.selection-card:hover {
    border-color: var(--bs-primary);
    box-shadow: 0 .35rem 1rem rgba(0, 0, 0, .06);
    transform: translateY(-1px);
}
.selection-card:has(input:checked) {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .12);
}

/* PetCare v003: domácnosti a profily zvířat */
.household-card,
.animal-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 100%;
    padding: 1rem;
    border: 1px solid rgba(20, 22, 35, .09);
    border-radius: 1rem;
    background: #fff;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.household-card { display: block; }
.household-card:hover,
.animal-card:hover {
    transform: translateY(-2px);
    border-color: rgba(111, 66, 193, .35);
    box-shadow: 0 .65rem 1.6rem rgba(43, 28, 78, .08);
}
.animal-avatar {
    width: 4.25rem;
    height: 4.25rem;
    object-fit: cover;
    border-radius: 1rem;
    flex: 0 0 auto;
    border: 1px solid rgba(20, 22, 35, .08);
    background: var(--petcare-soft);
}
.animal-avatar-lg {
    width: clamp(6rem, 14vw, 9rem);
    height: clamp(6rem, 14vw, 9rem);
    border-radius: 1.4rem;
}
.animal-avatar-placeholder {
    display: grid;
    place-items: center;
    font-size: 1.65rem;
}
.animal-avatar-lg.animal-avatar-placeholder { font-size: 3rem; }
.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    border: 1px dashed rgba(20, 22, 35, .16);
    border-radius: 1rem;
    background: #fafafd;
}
.pre-line { white-space: pre-line; }
.min-w-0 { min-width: 0; }
.last-mb-0:last-child { margin-bottom: 0 !important; }
.nav-link.disabled { opacity: .5; cursor: not-allowed; }


/* PetCare v005: přiměřený náhled fotografie a záznamy péče */
.animal-profile-photo {
    display: block;
    width: min(100%, 300px);
    height: auto;
    max-height: 300px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 1.25rem;
    border: 1px solid rgba(20, 22, 35, .1);
    background: var(--petcare-soft);
    flex: 0 0 auto;
}
.animal-profile-photo.animal-avatar-placeholder { min-width: min(70vw, 220px); }
.record-card { padding: 1rem 0; border-bottom: 1px solid rgba(20,22,35,.09); }
.record-card:first-of-type { padding-top: .25rem; }
.record-card:last-child { border-bottom: 0; padding-bottom: .25rem; }
.record-overdue { border-left: .25rem solid var(--bs-danger); padding-left: .75rem; }
.timeline-list { position: relative; }
.timeline-item { position: relative; display: grid; grid-template-columns: 1rem 1fr; gap: .75rem; padding: 0 0 1.25rem; }
.timeline-item::before { content: ''; position: absolute; left: .32rem; top: .65rem; bottom: -.2rem; width: 2px; background: rgba(111,66,193,.16); }
.timeline-item:last-child::before { display: none; }
.timeline-dot { width: .7rem; height: .7rem; margin-top: .35rem; border-radius: 50%; background: var(--petcare-primary); z-index: 1; }
@media (max-width: 575.98px) { .animal-profile-photo { width: min(100%, 240px); max-height: 240px; } }

/* PetCare v005: média, editace a veřejný deník */
.record-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: .75rem;
}
.record-gallery img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: .85rem;
    border: 1px solid rgba(20,22,35,.1);
    background: var(--petcare-soft);
}
.record-gallery-item { display: grid; gap: .5rem; }
.public-profile-header,
.public-feed-gate {
    padding: clamp(1.25rem, 3vw, 2rem);
    border-radius: 1.25rem;
    background: linear-gradient(135deg, #f6f3fb, #fff);
    border: 1px solid rgba(111,66,193,.16);
}
.public-post-card {
    height: 100%;
    overflow: hidden;
    border-radius: 1.1rem;
    border: 1px solid rgba(20,22,35,.09);
    background: #fff;
    box-shadow: 0 .4rem 1.2rem rgba(43,28,78,.05);
}
.public-post-cover {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
}
.public-story-body {
    font-size: 1.1rem;
    line-height: 1.75;
    margin-top: 1.5rem;
}

/* PetCare v006: vzhled veřejného profilu */
.identity-avatar {
    --identity-color: var(--profile-color, #2563eb);
    width: 4rem;
    height: 4rem;
    flex: 0 0 auto;
    border-radius: 50%;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--identity-color) 12%, white);
    border: 2px solid color-mix(in srgb, var(--identity-color) 35%, white);
}
.identity-avatar svg,
.identity-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.identity-avatar-sm { width: 2rem; height: 2rem; border-width: 1px; }
.identity-avatar-lg { width: 5.25rem; height: 5.25rem; }
.identity-avatar-xl { width: clamp(6rem, 13vw, 9rem); height: clamp(6rem, 13vw, 9rem); }
.identity-avatar-choice { width: 3.9rem; height: 3.9rem; }
.identity-avatar-none { color: var(--identity-color); font-size: 1.6rem; background: #eef1f5; }
.identity-avatar-photo { object-fit: cover; }
.profile-color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(95px, 1fr));
    gap: .65rem;
}
.profile-color-option,
.profile-avatar-option {
    position: relative;
    display: grid;
    place-items: center;
    gap: .45rem;
    padding: .7rem .45rem;
    min-height: 92px;
    border: 1px solid var(--bs-border-color);
    border-radius: .8rem;
    background: #fff;
    cursor: pointer;
    text-align: center;
    font-size: .78rem;
    color: var(--bs-secondary-color);
}
.profile-color-option input,
.profile-avatar-option input { position: absolute; opacity: 0; pointer-events: none; }
.profile-color-option:has(input:checked),
.profile-avatar-option:has(input:checked) {
    border-color: var(--petcare-primary);
    box-shadow: 0 0 0 .18rem rgba(111,66,193,.12);
}
.profile-color-swatch {
    display: block;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 50%;
    background: var(--swatch);
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px rgba(20,22,35,.16);
}
.profile-avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: .65rem;
}
.public-profile-preview { overflow: hidden; }
.profile-preview-accent {
    height: .45rem;
    margin-inline: -1.5rem;
    margin-bottom: -1.5rem;
    background: var(--profile-color);
}
.public-profile-themed {
    color: #fff;
    background:
        radial-gradient(circle at 90% 0%, rgba(255,255,255,.24), transparent 18rem),
        linear-gradient(135deg, color-mix(in srgb, var(--profile-color) 88%, #111827), var(--profile-color));
    border-color: color-mix(in srgb, var(--profile-color) 55%, transparent);
}
.public-profile-themed .identity-avatar { border-color: rgba(255,255,255,.7); }
.public-animal-header {
    padding: 1.25rem;
    border-left: .45rem solid var(--profile-color);
    border-radius: 1rem;
    background: linear-gradient(90deg, color-mix(in srgb, var(--profile-color) 8%, white), #fff 45%);
}

/* PetCare v006: náklady na zvíře */
.expense-stat {
    height: 100%;
    padding: 1rem;
    border-radius: .9rem;
    background: #f8f9fc;
    border: 1px solid rgba(20,22,35,.08);
}
.expense-category-list { display: grid; gap: .55rem; }
.expense-category-list > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: .5rem;
    border-bottom: 1px dashed rgba(20,22,35,.14);
}
.expense-category-list > div:last-child { border-bottom: 0; }
.expense-table th { white-space: nowrap; }
@media (max-width: 767.98px) {
    .profile-color-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .profile-avatar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* PetCare v006.2: responzivní modal galerie fotografií */
.petcare-lightbox-trigger {
    cursor: zoom-in;
}

.petcare-lightbox-trigger img,
img.petcare-lightbox-trigger {
    transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}

.petcare-lightbox-trigger:hover img,
img.petcare-lightbox-trigger:hover,
.petcare-lightbox-trigger:focus-visible img,
img.petcare-lightbox-trigger:focus-visible {
    transform: scale(1.015);
    filter: brightness(.96);
    box-shadow: 0 .55rem 1.4rem rgba(20, 22, 35, .16);
}

img.petcare-lightbox-trigger:focus-visible,
.petcare-lightbox-trigger:focus-visible {
    outline: .2rem solid color-mix(in srgb, var(--petcare-primary) 45%, transparent);
    outline-offset: .2rem;
}

.petcare-image-modal .modal-dialog {
    max-width: min(96vw, 1400px);
}

.petcare-image-modal .modal-content {
    min-height: min(88vh, 900px);
    overflow: hidden;
    color: #fff;
    background: rgba(9, 11, 17, .98);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 1rem;
    box-shadow: 0 1.5rem 5rem rgba(0, 0, 0, .45);
}

.petcare-image-modal .modal-body {
    position: relative;
    min-height: min(72vh, 760px);
    background:
        radial-gradient(circle at center, rgba(255,255,255,.055), transparent 45%),
        #090b11;
}

.petcare-image-stage {
    position: relative;
    display: grid;
    place-items: center;
    min-height: min(72vh, 760px);
    padding: 1rem 4.75rem;
    touch-action: pan-y;
    user-select: none;
}

.petcare-image-display {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: calc(100vh - 11rem);
    object-fit: contain;
    opacity: 1;
    transition: opacity .12s ease;
}

.petcare-image-display.is-loading {
    opacity: .08;
}

.petcare-image-loading {
    position: absolute;
    inset: 50% auto auto 50%;
    z-index: 2;
    transform: translate(-50%, -50%);
}

.petcare-image-nav {
    position: absolute;
    top: 50%;
    z-index: 4;
    display: grid;
    place-items: center;
    width: clamp(2.8rem, 5vw, 4.25rem);
    height: clamp(3.8rem, 8vw, 6rem);
    padding: 0;
    color: #fff;
    background: rgba(0, 0, 0, .42);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: .8rem;
    transform: translateY(-50%);
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.petcare-image-nav:hover,
.petcare-image-nav:focus-visible {
    color: #fff;
    background: rgba(111, 66, 193, .78);
    border-color: rgba(255, 255, 255, .5);
    transform: translateY(-50%) scale(1.04);
    outline: none;
}

.petcare-image-nav span {
    display: block;
    font-size: clamp(2.6rem, 6vw, 4.25rem);
    font-weight: 200;
    line-height: .7;
    transform: translateY(-.08em);
}

.petcare-image-nav-previous { left: .75rem; }
.petcare-image-nav-next { right: .75rem; }

.text-white-75 { color: rgba(255, 255, 255, .75); }

@media (max-width: 575.98px) {
    .petcare-image-modal .modal-content {
        min-height: 100%;
        border: 0;
        border-radius: 0;
    }

    .petcare-image-modal .modal-body,
    .petcare-image-stage {
        min-height: calc(100vh - 7.5rem);
    }

    .petcare-image-stage {
        padding: .5rem 3.25rem;
    }

    .petcare-image-display {
        max-height: calc(100vh - 8.5rem);
    }

    .petcare-image-nav {
        width: 2.65rem;
        height: 4.5rem;
        border-radius: .65rem;
    }

    .petcare-image-nav-previous { left: .3rem; }
    .petcare-image-nav-next { right: .3rem; }
}

/* v007: veřejné organizace, vyhledávání a příběhy na homepage */
.organization-logo-preview,
.public-organization-logo {
    width: 150px;
    height: 150px;
    object-fit: contain;
    border-radius: 1rem;
    background: #fff;
    border: 1px solid #e3e6ef;
    padding: .5rem;
    cursor: zoom-in;
}
.public-organization-logo-placeholder {
    display: grid;
    place-items: center;
    font-size: 3.5rem;
}
.organization-gallery-edit,
.organization-public-gallery {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.organization-gallery-edit-item img,
.organization-public-gallery img {
    width: 100%;
    height: 170px;
    object-fit: cover;
    border-radius: .8rem;
    cursor: zoom-in;
}
.organization-gallery-edit-item { min-width: 0; }
.organization-contact-list > div { margin-bottom: 1rem; }
.organization-contact-list dt { font-size: .8rem; color: #6c757d; text-transform: uppercase; letter-spacing: .04em; }
.organization-contact-list dd { margin-bottom: 0; overflow-wrap: anywhere; }
.public-organization-description { line-height: 1.75; }
.organization-dashboard-logo,
.organization-card-logo,
.search-result-image {
    width: 64px;
    height: 64px;
    object-fit: cover;
    flex: 0 0 64px;
    border-radius: .8rem;
    border: 1px solid #e3e6ef;
    background: #fff;
}
.organization-dashboard-logo-placeholder,
.organization-card-logo-placeholder,
.search-result-placeholder {
    display: grid;
    place-items: center;
    font-size: 1.6rem;
}
.organization-public-card,
.search-result-card {
    display: flex;
    align-items: center;
    gap: .9rem;
    min-height: 92px;
    padding: .85rem;
    border: 1px solid #e1e5ee;
    border-radius: 1rem;
    background: #fff;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.organization-public-card:hover,
.search-result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 .6rem 1.5rem rgba(32, 36, 48, .08);
    border-color: rgba(111, 66, 193, .35);
}
.latest-story-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(280px, 360px);
    gap: 1rem;
    overflow-x: auto;
    padding: .25rem .1rem 1rem;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
}
.latest-story-card {
    scroll-snap-align: start;
    background: #fff;
    border: 1px solid #e1e5ee;
    border-radius: 1rem;
    overflow: hidden;
    min-width: 0;
    box-shadow: 0 .35rem 1.2rem rgba(32, 36, 48, .05);
}
.latest-story-image-wrap {
    display: grid;
    place-items: center;
    height: 210px;
    overflow: hidden;
    background: #fff;
}
.latest-story-image {
    display: block;
    width: 100%;
    height: 100%;
}
.latest-story-image--cover {
    object-fit: cover;
}
.latest-story-image--avatar {
    object-fit: contain;
    object-position: 50% 50%;
    padding: .5rem;
    background: #fff;
}
.latest-story-placeholder {
    display: grid;
    place-items: center;
    font-size: 4rem;
}
.story-slider-button { width: 44px; height: 44px; font-size: 1.6rem; line-height: 1; }
.story-slider-button:disabled { opacity: .35; }

@media (max-width: 575.98px) {
    .latest-story-track { grid-auto-columns: 86vw; }
    .public-organization-logo { width: 120px; height: 120px; }
    .organization-gallery-edit,
    .organization-public-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .organization-gallery-edit-item img,
    .organization-public-gallery img { height: 135px; }
}

/* PetCare v009: veřejné karty, léčebné plány a zpětná vazba */
.record-gallery-editable {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}
.record-gallery-edit-item {
    padding: .75rem;
    border: 1px solid #e1e5ee;
    border-radius: 1rem;
    background: #fff;
}
.record-gallery-preview-wrap {
    position: relative;
    overflow: hidden;
    border-radius: .85rem;
    background: var(--petcare-soft);
}
.record-gallery-editable .record-gallery-preview-wrap img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border: 0;
    border-radius: 0;
}
.record-cover-badge {
    position: absolute;
    top: .5rem;
    left: .5rem;
    box-shadow: 0 .15rem .6rem rgba(0,0,0,.16);
}
.record-crop-source {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    height: min(58vh, 520px);
    overflow: hidden;
    border: 1px solid #dfe3ec;
    border-radius: 1rem;
    background:
        linear-gradient(45deg,#eceef3 25%,transparent 25%) 0 0/20px 20px,
        linear-gradient(-45deg,#eceef3 25%,transparent 25%) 0 10px/20px 20px,
        linear-gradient(45deg,transparent 75%,#eceef3 75%) 10px -10px/20px 20px,
        linear-gradient(-45deg,transparent 75%,#eceef3 75%) -10px 0/20px 20px,
        #f8f9fb;
    cursor: crosshair;
    touch-action: none;
    user-select: none;
}
.record-crop-source img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
}
.record-crop-marker {
    position: absolute;
    width: 2rem;
    height: 2rem;
    margin: -1rem 0 0 -1rem;
    border: 3px solid #fff;
    border-radius: 50%;
    background: rgba(111,66,193,.72);
    box-shadow: 0 0 0 2px rgba(111,66,193,.9), 0 .2rem .8rem rgba(0,0,0,.25);
    pointer-events: none;
}
.record-crop-marker::before,
.record-crop-marker::after {
    content: '';
    position: absolute;
    background: #fff;
    opacity: .95;
}
.record-crop-marker::before { width: 1rem; height: 2px; left: .32rem; top: .82rem; }
.record-crop-marker::after { width: 2px; height: 1rem; left: .82rem; top: .32rem; }
.record-crop-preview {
    width: min(100%, 520px);
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid #dfe3ec;
    border-radius: 1rem;
    background: var(--petcare-soft);
}
.record-crop-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.latest-organization-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(270px, 340px);
    gap: 1rem;
    overflow-x: auto;
    padding: .25rem .1rem 1rem;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
}
.latest-organization-card {
    scroll-snap-align: start;
    min-width: 0;
    border: 1px solid #e1e5ee;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 .35rem 1.2rem rgba(32,36,48,.05);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.latest-organization-card:hover {
    transform: translateY(-2px);
    border-color: rgba(111,66,193,.35);
    box-shadow: 0 .65rem 1.5rem rgba(32,36,48,.08);
}
.latest-organization-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    min-height: 132px;
    color: inherit;
    text-decoration: none;
}
.latest-organization-logo-wrap {
    width: 92px;
    height: 92px;
    flex: 0 0 92px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid #e1e5ee;
    border-radius: 1rem;
    background: #fff;
}
.latest-organization-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: .4rem;
}
.latest-organization-placeholder {
    font-size: 2.6rem;
    background: #f5f1fb;
}
.min-w-0 { min-width: 0; }

@media (max-width: 575.98px) {
    .record-gallery-editable { grid-template-columns: 1fr; }
    .record-crop-source { height: min(52vh, 430px); }
    .latest-organization-track { grid-auto-columns: 86vw; }
    .latest-organization-logo-wrap { width: 78px; height: 78px; flex-basis: 78px; }
}

/* v010 – horní navigace a centrum připomínek */
.petcare-navbar-actions { z-index: 1031; }
.petcare-header-icon-button {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    border: 1px solid rgba(255,255,255,.3);
    background: rgba(255,255,255,.08);
    font-size: 1.15rem;
}
.petcare-header-icon-button:hover,
.petcare-header-icon-button:focus { color:#fff; background:rgba(255,255,255,.18); }
.petcare-reminder-badge { font-size:.65rem; min-width:1.25rem; background-color:#dc3545 !important; color:#fff !important; }
.petcare-reminder-dropdown { width:min(390px, calc(100vw - 1.25rem)); overflow:hidden; }
.petcare-reminder-dropdown-list { max-height: 420px; overflow-y:auto; }
.petcare-profile-menu-button {
    color:#fff;
    border:0;
    padding:.2rem .35rem;
    max-width:190px;
}
.petcare-profile-menu-button:hover,
.petcare-profile-menu-button:focus { color:#fff; background:rgba(255,255,255,.1); }
.header-profile-avatar {
    width:38px;
    height:38px;
    border-radius:50%;
    flex:0 0 38px;
    overflow:hidden;
    display:flex;
    align-items:center;
    justify-content:center;
    background:#fff;
}
.header-profile-avatar.identity-avatar-photo { object-fit:cover; }
.petcare-profile-menu-button .header-profile-avatar { pointer-events:none; }
.header-profile-avatar svg { width:100%; height:100%; display:block; }
.header-profile-avatar.identity-avatar-none { font-size:1.1rem; }
.petcare-profile-menu-name { max-width:100px; }
.petcare-profile-dropdown { min-width:260px; }
.reminder-list .list-group-item:last-child { border-bottom:0; }
.reminder-overdue-sort-form { min-width: 0; }
.reminder-overdue-sort { width: auto; min-width: 10.75rem; }
@media (max-width: 575.98px) {
    .reminder-overdue-sort-form { width: 100%; justify-content: space-between; }
    .reminder-overdue-sort { flex: 1 1 auto; min-width: 0; }
}

@media (max-width: 991.98px) {
    .petcare-navbar .navbar-brand { margin-right:.25rem; }
    .petcare-navbar-actions { margin-left:auto; }
    .petcare-reminder-dropdown { position:fixed !important; top:62px !important; left:.625rem !important; right:.625rem !important; width:auto; transform:none !important; }
    .petcare-profile-dropdown { position:fixed !important; top:62px !important; left:auto !important; right:.625rem !important; transform:none !important; width:min(300px, calc(100vw - 1.25rem)); }
}


/* v011 – krátká videa v deníku */
.diary-video-uploader {
    border: 1px solid #dfe3ec;
    border-radius: 1rem;
    padding: 1rem;
    background: #f8f9fb;
}
.diary-video-preview,
.diary-video-player {
    display: block;
    width: 100%;
    max-height: min(70vh, 680px);
    border-radius: 1rem;
    background: #111;
    object-fit: contain;
}
.diary-video-range-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem;
}
.diary-video-time-summary {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}
.diary-video-status {
    border: 1px solid #dfe3ec;
    border-radius: 1rem;
    padding: 1rem;
    background: #fff;
}
.diary-video-public-warning {
    border-left: .3rem solid #dc3545;
}
.public-story-video-wrap { max-width: 100%; }
.public-post-media-wrap,
.latest-story-image-wrap {
    position: relative;
}
.public-post-media-wrap {
    display: block;
    overflow: hidden;
    background: #111;
}
.video-play-badge {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: grid;
    place-items: center;
    width: 3.5rem;
    height: 3.5rem;
    padding-left: .2rem;
    border: 2px solid rgba(255,255,255,.92);
    border-radius: 50%;
    color: #fff;
    background: rgba(19, 14, 31, .72);
    box-shadow: 0 .35rem 1.2rem rgba(0,0,0,.32);
    font-size: 1.25rem;
    pointer-events: none;
}
.public-post-media-wrap:hover .video-play-badge,
.latest-story-image-wrap:hover .video-play-badge {
    transform: translate(-50%, -50%) scale(1.07);
}
@media (max-width: 575.98px) {
    .diary-video-range-grid { grid-template-columns: 1fr; }
    .diary-video-uploader { padding: .75rem; }
    .video-play-badge { width: 3rem; height: 3rem; }
}

/* v012 – přehled a nastavení uživatelského účtu */
.account-avatar {
    width: 3.25rem;
    height: 3.25rem;
    flex: 0 0 3.25rem;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid rgba(111, 66, 193, .18);
    background: #f3eefb;
}
.account-avatar-photo {
    object-fit: cover;
}
.account-avatar-placeholder {
    color: #6f42c1;
    font-size: 1.45rem;
}
.account-avatar-overview {
    width: 5.25rem;
    height: 5.25rem;
    flex-basis: 5.25rem;
    box-shadow: 0 .4rem 1.3rem rgba(32, 20, 52, .12);
}
.account-avatar-xl {
    width: 6.5rem;
    height: 6.5rem;
    flex-basis: 6.5rem;
}
.header-profile-avatar.account-avatar-photo { object-fit: cover; }
.header-profile-avatar.account-avatar-placeholder {
    color: #6f42c1;
    font-size: 1.1rem;
}
@media (max-width: 575.98px) {
    .account-avatar-overview {
        width: 4.25rem;
        height: 4.25rem;
        flex-basis: 4.25rem;
    }
}
.account-avatar svg {
    width: 100%;
    height: 100%;
    display: block;
}
.account-avatar.identity-avatar-none {
    color: var(--identity-color, #6f42c1);
    font-size: 1.5rem;
}

/* PetCare v013: členové domácnosti, persony a pozvánky */
.member-card,
.invitation-card {
    border: 1px solid var(--bs-border-color);
    border-radius: 1rem;
    padding: 1rem;
    background: #fff;
}

.household-member-avatar {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    flex: 0 0 2.75rem;
    object-fit: cover;
    border: 2px solid rgba(111, 66, 193, .12);
}

.household-member-avatar-initial,
.household-member-avatar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--member-color, #64748b);
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
}

.household-member-avatar-icon {
    background: color-mix(in srgb, var(--member-color, #64748b) 18%, white);
    font-size: 1.35rem;
}

.permission-list,
.permission-grid {
    display: grid;
    gap: .55rem;
}

.permission-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.permission-item {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    padding: .75rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .75rem;
    background: #fff;
    cursor: pointer;
    line-height: 1.3;
}

.permission-item:hover {
    border-color: rgba(111, 66, 193, .45);
    background: rgba(111, 66, 193, .025);
}

.compact-permissions {
    max-height: 28rem;
    overflow: auto;
    padding-right: .15rem;
}

.member-color-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .55rem;
}

.member-color-option,
.avatar-choice {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    min-width: 0;
    padding: .55rem .25rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .75rem;
    cursor: pointer;
    text-align: center;
}

.member-color-option input,
.avatar-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.member-color-option:has(input:checked),
.avatar-choice:has(input:checked) {
    border-color: #6f42c1;
    box-shadow: 0 0 0 2px rgba(111, 66, 193, .12);
}

.member-color-option span {
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 50%;
    background: var(--swatch);
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .18);
}

.member-color-option small,
.avatar-choice small {
    width: 100%;
    font-size: .65rem;
    color: var(--bs-secondary-color);
    overflow: hidden;
    text-overflow: ellipsis;
}

.avatar-choice-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .55rem;
}

.avatar-choice-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    background: #eef1f6;
    font-weight: 800;
}

.member-current-photo {
    display: block;
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
    object-fit: cover;
}

@media (max-width: 767.98px) {
    .permission-grid {
        grid-template-columns: 1fr;
    }

    .member-color-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .avatar-choice-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* PetCare v014.3 – pozvánka známého */
.invite-preview-card {
    position: sticky;
    top: 1.5rem;
}
.invite-message-preview,
.invite-personal-message {
    margin: 0;
    padding: 1rem 1.1rem;
    border-left: 4px solid var(--bs-primary);
    border-radius: .75rem;
    background: rgba(111, 66, 193, .08);
    white-space: pre-line;
}
@media (max-width: 991.98px) {
    .invite-preview-card { position: static; }
}

/* PetCare v015 – sociální feed, přátelé a komentáře */
.social-home {
    --social-card-radius: 1.15rem;
}

.social-composer {
    border: 1px solid rgba(111, 66, 193, .16);
    box-shadow: 0 1rem 2.5rem rgba(54, 39, 84, .07);
}

.social-composer textarea {
    min-height: 7.5rem;
    resize: vertical;
}

.social-feed-list {
    display: grid;
    gap: 1rem;
}

.social-feed-item {
    overflow: hidden;
    border-radius: var(--social-card-radius, 1rem);
    border: 1px solid rgba(33, 37, 41, .09);
    box-shadow: 0 .45rem 1.5rem rgba(33, 37, 41, .055);
}

.social-actor-avatar,
.social-actor-placeholder {
    width: 3.1rem;
    height: 3.1rem;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 3.1rem;
}

.social-actor-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #f0eaff, #e8f6ff);
    border: 1px solid rgba(111, 66, 193, .13);
    font-size: 1.35rem;
}

.social-post-body {
    overflow-wrap: anywhere;
    line-height: 1.62;
}

.social-feed-media {
    position: relative;
    display: block;
    margin: 1rem -1.5rem 0;
    overflow: hidden;
    background: #eef0f4;
}

.social-feed-media img {
    display: block;
    width: 100%;
    max-height: 42rem;
    object-fit: cover;
}

.social-post-actions form {
    margin: 0;
}

.social-post-actions .btn {
    min-height: 2.15rem;
    border-radius: 999px;
}

.social-sidebar-card {
    z-index: 1;
}

.social-comments {
    display: grid;
    gap: 1rem;
}

.social-comment {
    padding: 1rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .95rem;
    background: var(--bs-body-bg);
}

.social-comment-reply {
    margin-left: 3.6rem;
    border-left: 3px solid rgba(111, 66, 193, .28);
    background: rgba(111, 66, 193, .025);
}

.social-comment-avatar {
    width: 2.45rem;
    height: 2.45rem;
    flex: 0 0 2.45rem;
}

.social-connection-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.social-connection-card,
.social-follow-card {
    padding: 1rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .9rem;
    background: var(--bs-body-bg);
}

.social-follow-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: 100%;
}

.social-profile-actions {
    padding: 1rem;
    border: 1px solid rgba(111, 66, 193, .16);
    border-radius: 1rem;
    background: rgba(111, 66, 193, .035);
}

.social-profile-actions form {
    margin: 0;
}

.social-profile-actions .btn {
    border-radius: 999px;
}

@media (max-width: 1199.98px) {
    .social-sidebar-card { position: static !important; }
}

@media (max-width: 767.98px) {
    .social-feed-item,
    .social-composer {
        padding: 1rem;
    }

    .social-feed-media {
        margin-left: -1rem;
        margin-right: -1rem;
    }

    .social-post-actions {
        gap: .4rem !important;
    }

    .social-post-actions .btn {
        min-width: 2.35rem;
        padding-left: .55rem;
        padding-right: .55rem;
    }

    .social-comment-reply {
        margin-left: 1.25rem;
    }

    .social-connection-grid {
        grid-template-columns: 1fr;
    }

    .social-follow-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .social-profile-actions .dropdown {
        margin-left: 0 !important;
    }
}

/* PetCare v015 – náhled sociálního hlášení v administraci */
.admin-social-preview-image {
    width: 180px;
    height: 140px;
    object-fit: cover;
    border-radius: .75rem;
    flex: 0 0 auto;
}
@media (max-width: 767.98px) {
    .admin-social-preview-image {
        width: 100%;
        height: min(55vw, 260px);
    }
}

/* PetCare v017 – sociální videa a zvířata na prvním místě */
.social-post-body-clamped {
    display: -webkit-box;
    max-height: 9.8em;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 6;
}

.social-feed-item-feed .social-feed-media {
    aspect-ratio: 16 / 9;
    max-height: 30rem;
}

.social-feed-item-detail .social-feed-media {
    max-height: min(68vh, 640px);
}

.social-feed-media img,
.social-feed-video {
    width: 100%;
    height: 100%;
}

.social-feed-item-feed .social-feed-media img {
    aspect-ratio: 16 / 9;
    max-height: 30rem;
    object-fit: cover;
}

.social-feed-video-wrap {
    background: #111;
}

.social-feed-video {
    display: block;
    max-height: min(68vh, 640px);
    object-fit: contain;
    background: #111;
}

.social-feed-item-feed .social-feed-video {
    aspect-ratio: 16 / 9;
    max-height: 30rem;
}

.social-own-activity {
    border: 1px solid rgba(111, 66, 193, .18);
    box-shadow: 0 .65rem 1.8rem rgba(54, 39, 84, .055);
}

.social-own-activity-list {
    display: grid;
    gap: .65rem;
}

.social-own-activity-item {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .75rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .9rem;
    color: inherit;
    text-decoration: none;
    background: var(--bs-body-bg);
    transition: border-color .15s ease, background-color .15s ease, transform .15s ease;
}

.social-own-activity-item:hover {
    border-color: rgba(111, 66, 193, .38);
    background: rgba(111, 66, 193, .025);
    transform: translateY(-1px);
}

.social-own-activity-item.is-unread {
    border-color: rgba(111, 66, 193, .34);
    background: rgba(111, 66, 193, .055);
}

.social-own-activity-thumb {
    position: relative;
    width: 6.5rem;
    height: 4.5rem;
    flex: 0 0 6.5rem;
    overflow: hidden;
    border-radius: .7rem;
    background: #eef0f4;
}

.social-own-activity-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.social-own-activity-thumb > span:not(.social-own-activity-placeholder) {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    padding-left: .1rem;
    border-radius: 50%;
    color: #fff;
    background: rgba(19, 14, 31, .72);
    border: 1px solid rgba(255,255,255,.9);
}

.social-own-activity-placeholder {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    font-size: 1.6rem;
}

.social-own-activity-comment {
    overflow: hidden;
    color: var(--bs-secondary-color);
    font-size: .9rem;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.social-own-activity-open {
    margin-left: auto;
    color: var(--bs-primary);
    font-size: 1.8rem;
    line-height: 1;
}

@media (max-width: 575.98px) {
    .social-feed-item-feed .social-feed-media,
    .social-feed-item-feed .social-feed-media img,
    .social-feed-item-feed .social-feed-video {
        max-height: 56vw;
    }

    .social-own-activity-item {
        align-items: flex-start;
        gap: .7rem;
        padding: .65rem;
    }

    .social-own-activity-thumb {
        width: 5rem;
        height: 4rem;
        flex-basis: 5rem;
    }

    .social-own-activity-open {
        display: none;
    }
}

/* v018 – rychlé menu zvířat a přehlednější uživatelská navigace */
.petcare-animal-menu-button {
    color:#fff;
    border:1px solid rgba(255,255,255,.22);
    border-radius:999px;
    padding:.45rem .7rem;
    line-height:1;
    background:rgba(255,255,255,.07);
}
.petcare-animal-menu-button:hover,
.petcare-animal-menu-button:focus { color:#fff; background:rgba(255,255,255,.16); }
.petcare-animal-dropdown { width:min(330px, calc(100vw - 1.25rem)); overflow:hidden; }
.petcare-animal-dropdown-list { max-height: min(55vh, 430px); overflow-y:auto; }
.petcare-animal-dropdown-item { min-height:3.15rem; padding:.55rem .85rem; }
.petcare-animal-menu-avatar {
    width:2.25rem;
    height:2.25rem;
    flex:0 0 2.25rem;
    border-radius:50%;
    object-fit:cover;
    border:1px solid rgba(20,22,35,.1);
    background:var(--petcare-soft);
}
.petcare-animal-menu-placeholder {
    display:inline-grid;
    place-items:center;
    font-size:1rem;
}

@media (max-width: 991.98px) {
    .petcare-animal-dropdown {
        position:fixed !important;
        top:62px !important;
        left:auto !important;
        right:.625rem !important;
        transform:none !important;
    }
}

/* PetCare v020 – kontextová nápověda a podrobné představení systému */
.petcare-help-button > span {
    display: inline-grid;
    place-items: center;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid currentColor;
    border-radius: 50%;
    font-size: .82rem;
    font-weight: 800;
    line-height: 1;
}

.petcare-help-modal .modal-content {
    border: 0;
    border-radius: 1.25rem;
    box-shadow: 0 1.5rem 4rem rgba(30, 20, 50, .25);
}

.petcare-help-header {
    color: #fff;
    border: 0;
    padding: 1.4rem 1.5rem;
    background: linear-gradient(135deg, #5b2ca0, #7c3aed 58%, #a855f7);
}

.petcare-test-badge {
    color: #4c1d95;
    background: #f3e8ff;
}

.petcare-help-card {
    padding: 1.1rem;
    border: 1px solid rgba(111, 66, 193, .16);
    border-radius: 1rem;
    background: linear-gradient(180deg, #fff, rgba(111, 66, 193, .025));
}

.petcare-help-icon {
    display: grid;
    place-items: center;
    width: 2.65rem;
    height: 2.65rem;
    flex: 0 0 2.65rem;
    border-radius: .85rem;
    font-size: 1.35rem;
    background: rgba(111, 66, 193, .1);
}

.petcare-help-list {
    display: grid;
    gap: .35rem;
    padding-left: 1.15rem;
    color: var(--bs-secondary-color);
    font-size: .94rem;
}

.petcare-system-section {
    position: relative;
    overflow: hidden;
}

.petcare-system-section::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 13rem;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(111, 66, 193, .07), transparent);
}

.petcare-system-kicker {
    letter-spacing: .08em;
    text-transform: uppercase;
}

.petcare-system-step,
.petcare-system-feature,
.petcare-privacy-panel {
    height: 100%;
    padding: 1.25rem;
    border: 1px solid rgba(111, 66, 193, .14);
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 .75rem 2rem rgba(50, 36, 78, .055);
}

.petcare-system-step-number {
    display: inline-grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    margin-bottom: .85rem;
    border-radius: 50%;
    color: #fff;
    font-weight: 800;
    background: var(--bs-primary);
}

.petcare-system-feature-icon {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    margin-bottom: .85rem;
    border-radius: .9rem;
    font-size: 1.45rem;
    background: rgba(111, 66, 193, .1);
}

.petcare-testing-callout {
    position: relative;
    overflow: hidden;
    color: #fff;
    border-radius: 1.35rem;
    background: linear-gradient(135deg, #32204f, #6332a6 58%, #8b5cf6);
    box-shadow: 0 1.2rem 3rem rgba(55, 32, 90, .2);
}

.petcare-testing-callout::after {
    content: '🐾';
    position: absolute;
    right: 1rem;
    bottom: -2.4rem;
    font-size: 9rem;
    line-height: 1;
    opacity: .08;
    transform: rotate(-15deg);
}

.petcare-testing-benefit {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
}

.petcare-testing-benefit > span:first-child {
    flex: 0 0 auto;
}

@media (max-width: 767.98px) {
    .petcare-help-header {
        padding: 1.1rem;
    }

    .petcare-help-card {
        padding: .95rem;
    }

    .petcare-help-modal .modal-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .petcare-help-modal .modal-footer > div:last-child,
    .petcare-help-modal .modal-footer .btn {
        width: 100%;
    }

    .petcare-testing-callout {
        border-radius: 1rem;
    }
}

/* PetCare v024 – skupiny */
.group-card {
    height: 100%;
    transition: transform .15s ease, box-shadow .15s ease;
}
.group-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 .75rem 1.75rem rgba(28, 46, 74, .09);
}
.group-card-description {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
}
.group-hero {
    overflow: hidden;
    position: relative;
}
.group-hero::after {
    content: "🐾";
    position: absolute;
    right: 1.5rem;
    bottom: -2.2rem;
    font-size: 8rem;
    opacity: .035;
    pointer-events: none;
}
.group-hero > * {
    position: relative;
    z-index: 1;
}
.group-hero-actions {
    min-width: 13rem;
}
.group-rules {
    padding-left: 1.25rem;
}
.group-rules li::marker {
    font-weight: 700;
}
.group-detail .social-feed-list {
    min-width: 0;
}
@media (max-width: 991.98px) {
    .group-hero-actions {
        min-width: 0;
        width: 100%;
    }
}

/* PetCare v025 – photo-first soukromé zprávy. */
.chat-page-narrow { max-width: 820px; }
.chat-page { max-width: 1040px; }
.chat-shell { max-width: 900px; margin: 0 auto; }
.chat-header { position: sticky; top: .5rem; z-index: 20; }
.chat-household-avatar {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #e0f2fe, #ede9fe);
    color: #1e3a8a;
    font-size: 1.35rem;
}
.chat-inbox-list .list-group-item { border-left: 0; border-right: 0; }
.chat-inbox-unread { background: rgba(37, 99, 235, .055); }
.chat-unread-dot {
    width: .72rem;
    height: .72rem;
    flex: 0 0 .72rem;
    border-radius: 50%;
    background: var(--bs-primary);
    box-shadow: 0 0 0 .22rem rgba(37, 99, 235, .13);
}
.chat-messages {
    min-height: 44vh;
    max-height: calc(100vh - 300px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    scroll-behavior: smooth;
}
.chat-empty {
    margin: auto;
    text-align: center;
    color: var(--bs-secondary-color);
    padding: 3rem 1rem;
}
.chat-message {
    display: flex;
    flex-direction: column;
    max-width: min(82%, 680px);
}
.chat-message-mine { align-self: flex-end; align-items: flex-end; }
.chat-message-other { align-self: flex-start; align-items: flex-start; }
.chat-message-meta {
    display: flex;
    gap: .55rem;
    align-items: baseline;
    font-size: .75rem;
    color: var(--bs-secondary-color);
    margin: 0 .35rem .25rem;
}
.chat-message-mine .chat-message-meta { justify-content: flex-end; }
.chat-bubble {
    border-radius: 1.15rem;
    overflow: hidden;
    box-shadow: 0 .15rem .6rem rgba(15, 23, 42, .08);
    background: #fff;
    border: 1px solid rgba(15, 23, 42, .08);
}
.chat-message-mine .chat-bubble {
    background: #eaf2ff;
    border-color: rgba(37, 99, 235, .15);
    border-bottom-right-radius: .35rem;
}
.chat-message-other .chat-bubble { border-bottom-left-radius: .35rem; }
.chat-message-text { padding: .75rem .9rem; line-height: 1.45; overflow-wrap: anywhere; }
.chat-photo-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px;
    background: rgba(15, 23, 42, .08);
}
.chat-photo-count-1 { grid-template-columns: minmax(0, 1fr); }
.chat-photo-count-3 .chat-photo-link:first-child,
.chat-photo-count-5 .chat-photo-link:first-child { grid-row: span 2; }
.chat-photo-link {
    display: block;
    min-width: 0;
    background: #eef2f7;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}
.chat-photo-count-1 .chat-photo-link { aspect-ratio: auto; max-height: 520px; }
.chat-photo-link img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-photo-count-1 .chat-photo-link img { max-height: 520px; object-fit: contain; background: #eef2f7; }
.chat-report-trigger { font-size: .72rem; text-decoration: none; }
.chat-composer { position: sticky; bottom: .5rem; z-index: 15; }
.chat-composer textarea { resize: vertical; min-height: 3.25rem; max-height: 10rem; }
.chat-photo-picker .form-text { margin-top: .5rem; }

/* PetCare v025.3: focení je mobilní akce; na zařízení s přesným ukazatelem zůstává jen galerie. */
.chat-camera-action { display: none; }
@media (hover: none) and (pointer: coarse) {
    .chat-camera-action { display: inline-flex; }
}
.chat-photo-preview {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .5rem;
    margin-top: .75rem;
}
.chat-photo-preview-item {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: .75rem;
    overflow: hidden;
    background: #eef2f7;
}
.chat-photo-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.chat-photo-preview-remove {
    position: absolute;
    top: .25rem;
    right: .25rem;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 50%;
    padding: 0;
    line-height: 1;
    font-size: 1.25rem;
    box-shadow: 0 .15rem .35rem rgba(0, 0, 0, .2);
}
.chat-upload-status .progress { height: .55rem; }
.admin-chat-report-photo { width: 140px; height: 140px; object-fit: cover; border-radius: .75rem; }

@media (max-width: 767.98px) {
    .chat-page { padding-left: .5rem; padding-right: .5rem; }
    .chat-shell { width: 100%; }
    .chat-header { top: .25rem; padding: .75rem; }
    .chat-messages {
        min-height: 52vh;
        max-height: calc(100vh - 255px);
        border-radius: 1rem;
        padding: .75rem .55rem;
    }
    .chat-message { max-width: 92%; }
    .chat-composer { bottom: .25rem; padding: .75rem; border-radius: 1rem; }
    .chat-photo-preview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .chat-photo-picker .btn { flex: 1 1 8rem; }
}

.petcare-payment-qr {
    width: min(260px, 100%);
    min-height: 220px;
    display: grid;
    place-items: center;
}
.petcare-payment-qr svg { width: 100%; height: auto; }
@media print {
    .petcare-navbar, footer, .d-print-none, .petcare-feedback-button { display: none !important; }
    .petcare-proforma-page { padding: 0 !important; max-width: none !important; }
    .petcare-proforma-page article { border: 0 !important; }
}

/* ============================================================
   PetCare v027.0 – mobilní PWA
   ============================================================ */
html { min-width: 0; }
body { min-width: 0; }
.pwa-connectivity-banner,
.pwa-update-banner {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1090;
    width: min(92vw, 620px);
    padding: .65rem .9rem;
    border-radius: 0 0 .85rem .85rem;
    box-shadow: 0 .35rem 1rem rgba(15, 23, 42, .2);
    font-weight: 600;
    text-align: center;
}
.pwa-connectivity-banner { top: 0; background: #fff3cd; color: #664d03; }
.pwa-update-banner {
    top: 0;
    background: #173b70;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .8rem;
}
.pwa-prompt-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.1rem;
    border: 1px solid #b9d4ff;
    border-radius: 1.15rem;
    background: linear-gradient(145deg, #eef6ff, #f8f4ff);
}
.pwa-prompt-icon { font-size: 2rem; line-height: 1; }
.petcare-mobile-page { max-width: 900px; }
.mobile-task-card,
.mobile-animal-card {
    background: #fff;
    border: 1px solid rgba(111, 66, 193, .14);
    border-radius: 1.15rem;
    box-shadow: 0 .2rem .8rem rgba(15, 23, 42, .055);
}
.mobile-task-card { padding: 1rem; scroll-margin-top: 6rem; }
.mobile-task-highlight { outline: 3px solid rgba(13, 110, 253, .35); }
.mobile-task-avatar,
.mobile-animal-avatar {
    flex: 0 0 auto;
    width: 3.6rem;
    height: 3.6rem;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(111, 66, 193, .22);
}
.mobile-task-avatar-placeholder {
    display: grid;
    place-items: center;
    background: #f3efff;
}
.mobile-task-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45rem;
}
.mobile-task-actions form { margin: 0; }
.mobile-animal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.mobile-animal-card { overflow: hidden; }
.mobile-animal-main { display: flex; align-items: center; gap: .8rem; padding: 1rem; min-width: 0; }
.mobile-animal-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid #ececf2; }
.mobile-animal-actions a { padding: .7rem .25rem; text-align: center; text-decoration: none; font-size: .82rem; }
.mobile-animal-actions a + a { border-left: 1px solid #ececf2; }
.mobile-more-list {
    display: grid;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 1.1rem;
    background: #fff;
}
.mobile-more-list > a,
.mobile-more-list > button {
    display: grid;
    grid-template-columns: 2.4rem minmax(0, 1fr) auto;
    gap: .75rem;
    align-items: center;
    padding: .95rem 1rem;
    color: var(--bs-body-color);
    text-decoration: none;

    width: 100%;
    border: 0;
    background: #fff;
    text-align: left;}
.mobile-more-list > a + a,
.mobile-more-list > a + button,
.mobile-more-list > button + a,
.mobile-more-list > button + button { border-top: 1px solid #ececf2; }
.mobile-more-list > a:hover,
.mobile-more-list > button:hover { background: #f8f7fc; }
.mobile-more-list strong,
.mobile-more-list small { display: block; }
.mobile-more-list small { color: var(--bs-secondary-color); margin-top: .12rem; }
.mobile-more-icon { font-size: 1.35rem; text-align: center; }
.pwa-device-form .form-check { padding-top: .2rem; padding-bottom: .2rem; }

.petcare-mobile-nav { display: none; }

@media (max-width: 991.98px) {
    body.petcare-authenticated { overflow-x: clip; }
    .petcare-navbar .container {
        max-width: 100%;
        min-width: 0;
        flex-wrap: nowrap;
        padding-left: .75rem;
        padding-right: .75rem;
    }
    .petcare-navbar { min-height: 4.35rem; padding-top: .45rem; padding-bottom: .45rem; }
    .petcare-navbar .navbar-brand {
        min-width: 0;
        margin-right: .35rem;
        font-size: 1.3rem;
        white-space: nowrap;
    }
    .petcare-navbar-actions {
        min-width: 0;
        gap: .35rem !important;
        flex-shrink: 0;
    }
    .petcare-header-animal-dropdown,
    .petcare-auth-nav-toggler { display: none !important; }
    .petcare-header-icon-button { width: 2.65rem; height: 2.65rem; padding: 0; }
    .petcare-profile-menu-button { max-width: 3rem; min-width: 3rem; padding: .15rem !important; }
    .petcare-profile-menu-button::after { display: none; }
    .header-profile-avatar { width: 2.65rem !important; height: 2.65rem !important; }
    .petcare-profile-dropdown,
    .petcare-reminder-dropdown { max-width: calc(100vw - 1rem); }
    .navbar-collapse { min-width: 0; }

    body.has-mobile-nav { padding-bottom: calc(4.35rem + env(safe-area-inset-bottom, 0px)); }
    body.has-mobile-nav footer { margin-bottom: 0; }
    .petcare-mobile-nav {
        position: fixed;
        z-index: 1060;
        left: 0;
        right: 0;
        bottom: 0;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        padding: .32rem .25rem calc(.32rem + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid rgba(15, 23, 42, .13);
        background: rgba(255, 255, 255, .97);
        box-shadow: 0 -.3rem 1rem rgba(15, 23, 42, .1);
        backdrop-filter: blur(12px);
    }
    .petcare-mobile-nav a {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: .12rem;
        min-width: 0;
        min-height: 3.55rem;
        padding: .25rem .1rem;
        border-radius: .8rem;
        color: #68707c;
        text-decoration: none;
        font-size: .7rem;
        font-weight: 600;
        line-height: 1.05;
    }
    .petcare-mobile-nav a.active { color: var(--petcare-primary); background: var(--petcare-soft); }
    .petcare-mobile-nav-icon { font-size: 1.22rem; line-height: 1; }
    .petcare-mobile-nav-badge {
        position: absolute;
        top: .2rem;
        left: calc(50% + .45rem);
        min-width: 1.15rem;
        padding: .12rem .28rem;
        border-radius: 999px;
        background: #dc3545;
        color: #fff;
        font-size: .61rem;
        line-height: 1;
        text-align: center;
    }
    .petcare-chat-detail .petcare-mobile-nav { display: none; }
    body.petcare-chat-detail { padding-bottom: 0; }
    .petcare-chat-detail .chat-composer { bottom: max(.25rem, env(safe-area-inset-bottom, 0px)); }
    .petcare-mobile-page { padding-left: .85rem; padding-right: .85rem; }
}

@media (max-width: 575.98px) {
    .petcare-navbar .navbar-brand { font-size: 1.12rem; }
    .petcare-navbar .brand-mark { font-size: 1.05rem; }
    .petcare-help-button { display: none; }
    .mobile-animal-grid { grid-template-columns: minmax(0, 1fr); }
    .mobile-task-card { padding: .9rem; }
    .mobile-task-avatar { width: 3.2rem; height: 3.2rem; }
    .mobile-task-actions .btn { min-height: 2.35rem; }
    .pwa-prompt-card { flex-direction: column; }
}

@media (display-mode: standalone) {
    .petcare-navbar { padding-top: calc(.45rem + env(safe-area-inset-top, 0px)); }
}

@media print {
    .petcare-mobile-nav,.pwa-connectivity-banner,.pwa-update-banner { display: none !important; }
}


/* ============================================================
   PetCare v029.4 – sociální navigace a objevování
   ============================================================ */
.petcare-social-nav-item { display: flex; align-items: center; }
.petcare-social-nav-link {
    position: relative;
    display: grid;
    place-items: center;
    width: 2.65rem;
    height: 2.65rem;
    padding: .35rem !important;
    border-radius: 50%;
}
.petcare-social-nav-link:hover,
.petcare-social-nav-link:focus-visible { background: rgba(255,255,255,.14); }
.petcare-social-nav-svg { width: 1.45rem; height: 1.45rem; fill: currentColor; }
.petcare-nav-dot,
.petcare-inline-new-dot {
    display: inline-block;
    width: .68rem;
    height: .68rem;
    border-radius: 50%;
    background: #dc3545;
    box-shadow: 0 0 0 2px #fff;
}
.petcare-nav-dot { position: absolute; top: .22rem; right: .18rem; }
.petcare-inline-new-dot { flex: 0 0 auto; box-shadow: none; }
.discover-list { display: grid; gap: .8rem; }
.discover-card {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    align-items: center;
    gap: .8rem;
    padding: .8rem;
    border: 1px solid rgba(15,23,42,.09);
    border-radius: 1rem;
    background: #fff;
}
.discover-card-main { display: flex; align-items: center; gap: .8rem; min-width: 0; }
.discover-card-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .35rem; }
.discover-card-actions form { margin: 0; }
.discover-animal-placeholder { display: grid; place-items: center; background: var(--petcare-soft); }
@media (max-width: 1199.98px) {
    .discover-card { grid-template-columns: minmax(0,1fr); }
    .discover-card-actions { justify-content: flex-start; padding-left: 4.3rem; }
}
@media (max-width: 991.98px) {
    .petcare-social-nav-item { display: none; }
    .discover-columns > section + section { margin-top: .25rem; }
}
@media (min-width: 992px) {
    .pwa-update-banner { display: none !important; }
}


/* PetCare v029.8 – pohyblivý výřez, oddálení a mobilní bezpečná zóna. */
.avatar-crop-stage {
    position: relative;
    width: min(100%, 430px);
    aspect-ratio: 1 / 1;
    margin-inline: auto;
    overflow: hidden;
    border-radius: 1.25rem;
    background: #1f2632;
    border: 1px solid rgba(20, 22, 35, .2);
    touch-action: none;
    cursor: grab;
    user-select: none;
}
.avatar-crop-stage:active { cursor: grabbing; }
.avatar-crop-background {
    position: absolute;
    left: -9%;
    top: -9%;
    z-index: 0;
    width: 118%;
    height: 118%;
    object-fit: cover;
    filter: blur(22px) brightness(.68) saturate(.88);
    opacity: .88;
    transform: scale(1.04);
    pointer-events: none;
    -webkit-user-drag: none;
}
.avatar-crop-source {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 1;
    max-width: none;
    max-height: none;
    transform-origin: center;
    pointer-events: none;
    -webkit-user-drag: none;
}
.avatar-crop-circle-guide {
    position: absolute;
    z-index: 2;
    inset: 7%;
    border: 3px solid rgba(255, 255, 255, .96);
    border-radius: 50%;
    box-shadow: 0 0 0 999px rgba(8, 12, 20, .44), 0 0 0 1px rgba(0,0,0,.18) inset;
    pointer-events: none;
}
.avatar-crop-circle-guide::before,
.avatar-crop-circle-guide::after {
    content: '';
    position: absolute;
    background: rgba(255,255,255,.38);
}
.avatar-crop-circle-guide::before { left: 50%; top: 0; bottom: 0; width: 1px; }
.avatar-crop-circle-guide::after { top: 50%; left: 0; right: 0; height: 1px; }
.avatar-crop-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .65rem;
    color: #fff;
    z-index: 3;
}
.avatar-crop-preview-grid { display: grid; gap: 1rem; justify-items: center; }
.avatar-crop-preview-grid figure { margin: 0; text-align: center; }
.avatar-crop-preview-grid figcaption { margin-top: .45rem; font-size: .82rem; color: var(--bs-secondary-color); }
.avatar-crop-preview {
    width: min(42vw, 150px);
    height: min(42vw, 150px);
    object-fit: cover;
    background: #eef1f5;
    border: 2px solid rgba(111, 66, 193, .22);
    box-shadow: 0 .35rem 1rem rgba(32, 20, 52, .1);
}
.avatar-crop-preview-circle { border-radius: 50%; }
.avatar-crop-preview-square { border-radius: 1rem; }
.avatar-crop-inline {
    margin-top: .75rem;
    display: flex;
    gap: .75rem;
    align-items: center;
    padding: .65rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .85rem;
    background: #fafafd;
}
.avatar-crop-inline img {
    width: 4.25rem;
    height: 4.25rem;
    flex: 0 0 4.25rem;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid rgba(111, 66, 193, .2);
}
@media (max-width: 991.98px) {
    body.avatar-crop-open { padding-bottom: 0 !important; }
    body.avatar-crop-open .petcare-mobile-nav { display: none !important; }
    #petcareAvatarCropModal { z-index: 1085; }
    #petcareAvatarCropModal .modal-footer {
        position: sticky;
        bottom: 0;
        z-index: 5;
        flex-wrap: nowrap;
        gap: .65rem;
        padding-bottom: calc(.75rem + env(safe-area-inset-bottom, 0px));
        background: var(--bs-modal-bg, #fff);
        box-shadow: 0 -.35rem 1rem rgba(15, 23, 42, .08);
    }
    #petcareAvatarCropModal .modal-footer .btn { flex: 1 1 0; }
}
@media (max-width: 575.98px) {
    #petcareAvatarCropModal .modal-content { min-height: 100dvh; }
    #petcareAvatarCropModal .modal-body { padding-bottom: 1rem; }
    #petcareAvatarCropModal .avatar-crop-stage {
        width: min(100%, 58dvh, 430px);
        min-width: 240px;
    }
}
@media (min-width: 992px) {
    .avatar-crop-preview-grid { position: sticky; top: .5rem; }
}


/* PetCare v029.10 – veřejné právní dokumenty navazují na přepínač CS/EN/DE. */
.petcare-public-language-form {
    margin: 0;
}

.petcare-public-language-select {
    min-width: 6.4rem;
    border-color: rgba(255, 255, 255, .55);
    background-color: rgba(255, 255, 255, .96);
    color: #212529;
    font-weight: 700;
    letter-spacing: .02em;
}

.petcare-public-language-select:focus {
    border-color: #fff;
    box-shadow: 0 0 0 .2rem rgba(255, 255, 255, .2);
}

@media (max-width: 991.98px) {
    .petcare-public-language-item {
        width: 100%;
        padding-top: .35rem;
        padding-bottom: .35rem;
    }

    .petcare-public-language-select {
        width: 100%;
    }
}
