:root {
    --bg-color: #f5eedc;
    --surface-color: #fff8ed;
    --surface-strong: #ffffff;
    --text-color: #1b2328;
    --muted-color: #64584e;
    --accent-color: #d56839;
    --accent-soft: #f9cd72;
    --line-color: rgba(59, 39, 22, 0.14);
    --shadow-lg: 0 24px 60px rgba(53, 33, 19, 0.12);
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: 'Manrope', sans-serif;
    background:
        radial-gradient(circle at top left, rgba(249, 205, 114, 0.4), transparent 28%),
        linear-gradient(180deg, #f6efe0 0%, #f2e9d7 100%);
    color: var(--text-color);
}

body {
    min-height: 100vh;
}

a {
    color: inherit;
}

h1,
h2,
h3 {
    margin: 0;
    font-family: 'Instrument Serif', serif;
    font-weight: 400;
    line-height: 0.95;
}

h1 {
    font-size: clamp(2.6rem, 7vw, 5.6rem);
}

h2 {
    font-size: clamp(1.5rem, 3vw, 2.4rem);
}

p {
    line-height: 1.7;
}

.page-shell {
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
}

.hero-panel,
.stats-grid,
.feature-grid,
.dashboard-shell,
.detail-shell,
.legal-shell,
.form-shell {
    padding: 2rem 0 2.5rem;
}

.hero-panel {
    display: grid;
    grid-template-columns: 1.4fr 0.9fr;
    gap: 1.2rem;
    align-items: stretch;
}

.hero-copy,
.hero-card,
.feature-card,
.stat-card,
.auth-card-panel,
.item-card,
.detail-card,
.detail-comments,
.legal-shell,
.form-panel {
    border: 1px solid var(--line-color);
    border-radius: 1.6rem;
    background: rgba(255, 248, 237, 0.88);
    box-shadow: var(--shadow-lg);
}

.hero-copy {
    padding: 2rem;
}

.hero-copy p,
.hero-card p {
    max-width: 56ch;
    color: var(--muted-color);
}

.hero-kicker {
    display: inline-block;
    margin-bottom: 1rem;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: rgba(213, 104, 57, 0.1);
    color: var(--accent-color);
    font-weight: 700;
}

.hero-actions,
.button-row,
.filter-row {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    align-items: center;
}

.sunburst-card {
    padding: 2rem;
    background:
        radial-gradient(circle at top right, rgba(249, 205, 114, 0.95), transparent 40%),
        linear-gradient(180deg, #fff8ed 0%, #f6ddae 100%);
}

.stats-grid,
.feature-grid,
.item-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

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

.stat-card,
.feature-card {
    padding: 1.4rem;
}

.stat-card strong {
    display: block;
    font-size: 2.8rem;
}

.auth-shell {
    display: flex;
    justify-content: center;
    padding: 3rem 0;
}

.auth-card-panel {
    width: min(34rem, 100%);
    padding: 2rem;
}

.auth-card-panel.wide {
    width: min(42rem, 100%);
}

.stack-form {
    display: grid;
    gap: 1rem;
}

.stack-form label,
.split-fields {
    display: grid;
    gap: 0.45rem;
}

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

.check-row {
    grid-template-columns: auto 1fr;
    align-items: start;
}

.form-control,
.form-select {
    border-radius: 1rem;
    border: 1px solid rgba(27, 35, 40, 0.14);
    background: rgba(255, 255, 255, 0.75);
    padding: 0.85rem 1rem;
}

.form-control:focus,
.form-select:focus,
.btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(213, 104, 57, 0.18);
}

.btn {
    border-radius: 999px;
    padding: 0.8rem 1.2rem;
    font-weight: 700;
}

.btn-dark {
    background: #141b1f;
    border-color: #141b1f;
}

.btn-outline-dark {
    border-width: 1px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1.2rem;
}

.filter-chip {
    border: 1px solid var(--line-color);
    background: rgba(255, 255, 255, 0.75);
    border-radius: 999px;
    padding: 0.7rem 1rem;
}

.filter-chip.active {
    background: #141b1f;
    color: #fff;
}

.map-frame {
    height: 32rem;
    border-radius: 1.5rem;
    overflow: hidden;
    border: 1px solid var(--line-color);
    box-shadow: var(--shadow-lg);
    margin-bottom: 1rem;
}

.map-frame.compact {
    height: 22rem;
}

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

.item-card-link {
    text-decoration: none;
}

.item-card {
    padding: 0;
    overflow: hidden;
}

.item-card-media {
    min-height: 12rem;
    background: linear-gradient(135deg, #f2dec2, #d1b08c);
    background-size: cover;
    background-position: center;
    position: relative;
}

.item-card>div:last-child,
.owner-card>div:not(.item-card-media),
.detail-card,
.detail-comments,
.legal-shell,
.form-panel {
    padding: 1.3rem;
}

.item-pill {
    display: inline-flex;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
}

.item-pill.lost {
    background: rgba(188, 58, 32, 0.14);
    color: #b9472e;
}

.item-pill.found {
    background: rgba(40, 117, 93, 0.14);
    color: #1f6d59;
}

.item-card-media .item-pill {
    position: absolute;
    left: 1rem;
    top: 1rem;
    background: rgba(255, 248, 237, 0.9);
}

.detail-shell {
    display: grid;
    grid-template-columns: 1.4fr 0.9fr;
    gap: 1rem;
}

.gallery-strip {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 16rem;
    gap: 0.75rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.gallery-strip img,
.gallery-fallback {
    width: 100%;
    height: 13rem;
    border-radius: 1rem;
    object-fit: cover;
    background: linear-gradient(135deg, #ead4b2, #caa37b);
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-header,
.detail-facts {
    margin-bottom: 1rem;
}

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

.detail-facts dt,
.detail-facts dd {
    margin: 0;
}

.detail-facts dt {
    color: var(--muted-color);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.comment-list {
    display: grid;
    gap: 0.8rem;
}

.comment-card {
    padding: 1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid var(--line-color);
}

.form-gallery {
    grid-auto-columns: 11rem;
}

.editable-image {
    display: grid;
    gap: 0.55rem;
}

.editable-image img {
    width: 100%;
    height: 8.5rem;
    object-fit: cover;
    border-radius: 1rem;
}

.owner-actions {
    justify-content: flex-end;
}

.comment-card small {
    display: block;
    color: var(--muted-color);
    margin: 0.2rem 0 0.5rem;
}

.upload-list {
    margin: 0;
    padding-left: 1.2rem;
}

.legal-shell {
    padding: 2rem;
}

.validation-message {
    color: #b9472e;
    font-size: 0.92rem;
}

.leaflet-popup-content-wrapper {
    border-radius: 1rem;
}

.findmy-marker {
    width: 3.4rem;
    height: 3.4rem;
    border-radius: 1.2rem;
    background-size: cover;
    background-position: center;
    border: 3px solid rgba(255, 255, 255, 0.92);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    position: relative;
}

.findmy-marker::after {
    content: '';
    position: absolute;
    right: -0.25rem;
    bottom: -0.25rem;
    width: 1rem;
    height: 1rem;
    border-radius: 999px;
    background: var(--marker-color, #d56839);
    border: 2px solid #fff;
}

@media (max-width: 960px) {

    .hero-panel,
    .detail-shell,
    .compact-grid,
    .feature-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .page-shell {
        width: min(100% - 1rem, 1120px);
    }

    .app-main {
        padding-top: 4.4rem;
    }

    .split-fields,
    .section-heading,
    .detail-facts {
        grid-template-columns: 1fr;
        display: grid;
    }

    .section-heading {
        align-items: start;
    }
}