* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, sans-serif;
    color: #1a1a1a;
}

.site-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.logo {
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
    color: inherit;
}

.site-header nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

.site-header a {
    color: #444;
    text-decoration: none;
}

.site-header a:hover {
    color: #000;
}

.user-name {
    color: #888;
    font-size: 0.9rem;
}

#map {
    height: calc(100vh - 57px);
    width: 100%;
}

.form-page {
    max-width: 380px;
    margin: 3rem auto;
    padding: 0 1rem;
}

.form-page h1 {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
}

.form-page form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-page label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: #555;
}

input,
select,
textarea {
    padding: 0.55rem 0.7rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #666;
}

button {
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 6px;
    background: #1a1a1a;
    color: #fff;
    font-size: 0.95rem;
    cursor: pointer;
}

button:hover {
    background: #333;
}

.error {
    color: #c62828;
    font-size: 0.85rem;
    min-height: 1.2em;
    margin: 0;
}

.hint {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: #666;
}

.pin span {
    display: block;
    width: 18px;
    height: 18px;
    border: 2px solid #fff;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.popup {
    width: 180px;
}

.popup img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.popup-label {
    display: inline-block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    margin-bottom: 0.35rem;
}

.popup-label.lost {
    background: #ffebee;
    color: #c62828;
}

.popup-label.found {
    background: #e8f5e9;
    color: #2e7d32;
}

.popup-title {
    display: block;
    font-weight: 500;
    color: #1a1a1a;
    text-decoration: none;
    line-height: 1.3;
}

.popup-title:hover {
    text-decoration: underline;
}

.popup-meta {
    margin-top: 0.3rem;
    font-size: 0.8rem;
    color: #888;
}

.map-legend {
    position: absolute;
    bottom: 1.5rem;
    left: 1rem;
    z-index: 1000;
    background: #fff;
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
    font-size: 0.85rem;
}

.map-legend div {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.map-legend div+div {
    margin-top: 0.3rem;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.dot.lost {
    background: #d32f2f;
}

.dot.found {
    background: #2e7d32;
}

.listing-page {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1rem;
}

@media (max-width: 800px) {
    .listing-page {
        grid-template-columns: 1fr;
    }
}

.gallery #main-photo {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: 8px;
}

.thumbs {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.thumbs img {
    width: 70px;
    height: 52px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.7;
}

.thumbs img:hover {
    opacity: 1;
}

.badge {
    display: inline-block;
    font-size: 0.75rem;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    margin-top: 1rem;
}

.badge.lost {
    background: #ffebee;
    color: #c62828;
}

.badge.found {
    background: #e8f5e9;
    color: #2e7d32;
}

.listing-page h1 {
    font-size: 1.5rem;
    margin: 0.5rem 0 1.5rem;
}

.props {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 0.5rem 1rem;
    margin: 0 0 1.5rem;
    font-size: 0.95rem;
}

.props dt {
    color: #888;
}

.props dd {
    margin: 0;
}

.props .note {
    color: #888;
    font-size: 0.85rem;
}

.description {
    line-height: 1.6;
    white-space: pre-line;
}

.contact-card,
.respond-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.contact-name {
    font-weight: 500;
    margin-bottom: 0.3rem;
}

.phone {
    font-size: 1.1rem;
    color: #1a1a1a;
    text-decoration: none;
}

#mini-map {
    height: 220px;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.respond-card h3 {
    font-size: 1rem;
    margin: 0 0 0.75rem;
}

.respond-card form {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.success {
    color: #2e7d32;
    font-size: 0.9rem;
}

.create-page {
    max-width: 640px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.create-page h1 {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
}

.create-page form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.create-page label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: #555;
}

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

.kind-choice {
    display: flex;
    gap: 1rem;
}

.kind-choice label {
    flex: 1;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    cursor: pointer;
    color: #1a1a1a;
}

.kind-choice label:has(input:checked) {
    border-color: #1a1a1a;
    background: #fafafa;
}

fieldset {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    margin: 0;
}

legend {
    font-size: 0.9rem;
    color: #555;
    padding: 0 0.4rem;
}

.address-search {
    display: flex;
    gap: 0.5rem;
}

.address-search input {
    flex: 1;
}

.address-search button {
    background: #555;
}

.hint-small {
    font-size: 0.8rem;
    color: #888;
    margin: 0.5rem 0;
}

#picker-map {
    height: 280px;
    border-radius: 6px;
    margin-top: 0.5rem;
}

.coords {
    font-size: 0.85rem;
    color: #2e7d32;
    margin: 0.5rem 0 0;
}

.photo-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.photo-preview img {
    width: 90px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
}

button:disabled {
    background: #999;
    cursor: default;
}

.my-page {
    max-width: 760px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.my-page h1 {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
}

.my-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.my-card {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
}

.card-photo {
    width: 120px;
    height: 90px;
    object-fit: cover;
    border-radius: 6px;
}

.card-photo.empty {
    background: #f0f0f0;
}

.card-tags {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.4rem;
}

.status {
    font-size: 0.8rem;
    color: #888;
}

.card-title {
    display: block;
    font-weight: 500;
    color: #1a1a1a;
    text-decoration: none;
}

.card-title:hover {
    text-decoration: underline;
}

.card-meta {
    font-size: 0.85rem;
    color: #888;
}

.toggle-responses {
    margin-top: 0.6rem;
    padding: 0.35rem 0.7rem;
    font-size: 0.85rem;
    background: #f0f0f0;
    color: #333;
}

.toggle-responses:hover {
    background: #e4e4e4;
}

.responses {
    margin-top: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.response-item {
    border-left: 3px solid #e0e0e0;
    padding-left: 0.8rem;
}

.response-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.response-head a {
    color: #1a1a1a;
}

.response-status {
    font-size: 0.75rem;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    background: #f0f0f0;
    color: #666;
}

.response-status.accepted {
    background: #e8f5e9;
    color: #2e7d32;
}

.response-status.rejected {
    background: #fafafa;
    color: #999;
}

.response-message {
    margin: 0.4rem 0;
    font-size: 0.95rem;
    line-height: 1.5;
    white-space: pre-line;
}

.response-foot {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.set-status {
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
}

.set-status.secondary {
    background: #f0f0f0;
    color: #555;
}

.loading {
    color: #888;
    font-size: 0.9rem;
}

.matches-block {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

.matches-block h2 {
    font-size: 1.1rem;
    margin: 0 0 0.4rem;
}

.match-card {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 0.9rem;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-top: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.match-card:hover {
    border-color: #999;
}

.match-card img,
.match-photo.empty {
    width: 90px;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
    background: #f0f0f0;
}

.match-title {
    font-weight: 500;
    line-height: 1.3;
}

.match-meta {
    font-size: 0.85rem;
    color: #888;
    margin-top: 0.2rem;
}

.match-score {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.score-bar {
    flex: 1;
    max-width: 140px;
    height: 5px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
}

.score-bar span {
    display: block;
    height: 100%;
    background: #2e7d32;
}

.score-value {
    font-size: 0.8rem;
    color: #666;
}

.feed-page {
    max-width: 760px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.feed-page h1 {
    font-size: 1.4rem;
    margin-bottom: 1.25rem;
}

.filters {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.filter-tabs {
    display: flex;
    gap: 0.5rem;
}

.filter-tabs label {
    padding: 0.4rem 0.9rem;
    border: 1px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
}

.filter-tabs label:has(input:checked) {
    background: #1a1a1a;
    border-color: #1a1a1a;
    color: #fff;
}

.filter-tabs input {
    display: none;
}

.filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
}

.filter-row label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.85rem;
    color: #666;
}

@media (max-width: 640px) {
    .filter-row {
        grid-template-columns: 1fr;
    }
}

.feed-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.feed-card {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 1rem;
    padding: 0.85rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
}

.feed-card:hover {
    border-color: #999;
}

.feed-card img,
.feed-photo.empty {
    width: 120px;
    height: 90px;
    object-fit: cover;
    border-radius: 6px;
    background: #f0f0f0;
}

.feed-title {
    font-weight: 500;
    margin: 0.35rem 0 0.2rem;
    line-height: 1.3;
}

.feed-details {
    font-size: 0.85rem;
    color: #666;
}

.feed-meta {
    font-size: 0.8rem;
    color: #999;
    margin-top: 0.3rem;
}

.feed-more {
    text-align: center;
    margin-top: 1.5rem;
}

.feed-more button {
    background: #f0f0f0;
    color: #333;
}

.feed-more button:hover {
    background: #e4e4e4;
}

.lang-switch {
    display: flex;
    gap: 0.4rem;
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

.lang-current {
    color: #1a1a1a;
    font-weight: 500;
}

.lang-switch a {
    color: #bbb;
}

.lang-switch a:hover {
    color: #666;
}
