/*.required-mark {
    color: var(--red);
}*/

.account-button {
    right: var(--header-edge);
}

.matching-section {
    margin: 100px auto 0;
    max-width: 1440px;
    text-align: center;
}

/*.matching-section[hidden] { display: none; }*/
.matching-section h2 {
    margin: 0;
    color: var(--navy);
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1.15;
}
.matching-subtitle {
    margin: 14px 0 52px;
    font-size: clamp(1rem, 1.7vw, 1.5rem);
}
.matching-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
    text-align: left;
}
.match-card {
    overflow: hidden;
    padding: 30px;
    border: 1px solid #edf0f5;
    border-radius: 26px;
    background: #f8f8f8;
}
.match-image {
    display: grid;
    overflow: hidden;
    min-height: 198px;
    place-items: center;
    margin-bottom: 20px;
    border-radius: 17px;
    background: #dedede;
    color: #777;
    font-size: 14px;
}
.match-image img { 
    width: 100%; 
    height: 198px; 
    object-fit: cover; 
}
.match-image.wallet { background: #f1f0ed; }
.match-image.keys { background: #d9d9cb; }

.match-card h3 {
    margin: 0 0 10px;
    color: var(--navy);
    font-size: 24px;
}

.match-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.badge, .match-score {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    border-radius: 999px;
    padding: 6px 16px;
    font-size: 17px;
    font-weight: 600;
}

.badge.lost { 
    background: #ffe4e1; 
    color: var(--red);
}
.badge.found { 
    background: #e1f1e7; 
    color: var(--green);
}
.match-score { 
    background: #edf3f7; 
    color: #666; 
}
.match-location { 
    margin: 0; 
    font-size: 20px; 
}

.entry-section h2 {
    margin-bottom: 72px;
}

.form-row {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}
.form-row > label,
.form-row > .field-label {
    position: relative;
}
.required-mark {
    position: absolute;
    right: 100%;
    margin-right: 2px;
    color: var(--red);
}

.form-row input:not([type="radio"]):not([type="file"]),
.form-row select,
.form-row textarea {
    width: 100%;
    min-width: 0;
    
    max-width: 100%;
}


.status-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 42px;
    padding: 3px;
    border-radius: 12px;
    background: #ececec;
}

.status-toggle label {
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: #929292;
    cursor: pointer;
    font-size: 13px;
}

.status-toggle input { 
    position: absolute; 
    opacity: 0; 
    pointer-events: none;
}
.status-toggle label:has(input:checked) {
    background: #fff;
    box-shadow: 0 1px 4px rgb(0 0 0 / 12%);
}
.status-toggle label:has(input[value="Lost"]:checked) { color: var(--red); }
.status-toggle label:has(input[value="Found"]:checked) { color: var(--green); }


.date-fields, .time-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.date-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.time-fields { 
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 10px;
}

.date-input-group, .description-field { min-width: 0; }

.date-note, .char-count {
    display: block;
    font-size: 11px;
    color: var(--muted);
}
.date-note { margin: 0 2px 4px; }
.char-count { margin: 2px 2px 0; text-align: right; }


.time-fields input[type="time"] { /*To reduce the width of time-fields on mobile*/
    -webkit-appearance: none;
    appearance: none;
    min-inline-size: 0;
}

.description-row { align-items: start; }
.description-row > label { padding-top: 9px; }

.upload-control {
    display: block;
    width: 100%;
    color: #767b84;
    font-size: 12px;
}

.upload-control::file-selector-button {
    margin-right: 9px;
    border: 1px solid #deded9;
    border-radius: 8px;
    padding: 8px 10px;
    background: #fff;
    color: #4d5666;
    font: inherit;
    cursor: pointer;
}

.submit-button {
    display: block;
    margin-top: var(--form-action-gap);
}
.submit-button:disabled { cursor: wait; opacity: .7; }

.debug-panel {
    width: min(100%, 900px);
    margin: 72px auto 0;
}
.debug-panel summary {
    cursor: pointer;
    color: var(--navy);
    font-size: 14px;
}

.debug-section {
    margin-top: 24px;
}
.debug-section h2 {
    color: var(--navy);
}

#output {
    overflow: auto;
    padding: 10px;
    border-radius: 8px;
    background: #f4f4f4;
}

#reports_container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.report-card {
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 5px rgb(0 0 0 / 8%);
}

.report-card img {
    width: 100%;
    height: 200px;
    margin-bottom: 10px;
    border-radius: 6px;
    object-fit: cover;
}



/* Additional states for the search-first workflow. */
/*#image_upload_row[hidden], 
#search_feedback[hidden] { 
    display: none;
}*/
.search-feedback { 
    margin: 18px auto 0; 
    font-size: 13px; 
    text-align: center; 
}
.search-feedback p { 
    margin: 0 0 12px; 
}
.report-option { 
    border: 1px solid var(--navy); 
    border-radius: 10px; 
    padding: 10px 18px;
    background: transparent; 
    color: var(--navy); 
    font: inherit; 
    cursor: pointer;
}

.category-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@media (max-width: 800px) {
    .matching-grid { grid-template-columns: 1fr; gap: 18px; }
    .matching-section { margin-top: 72px; }
    .match-card { padding: 20px; }
    .match-image { min-height: 180px; }
}

@media (max-width: 560px) {
    .account-button { right: 20px; }
    .entry-section h2 { margin-bottom: 40px; }
    .form-row { grid-template-columns: minmax(0, 1fr); gap: 7px; margin-bottom: 15px; }
    .required-mark { position: static; margin-right: 0; }
    .description-row > label { padding-top: 0; }
}