/* Sniff — "Signal" (design handoff option 2a)
   Light editorial: Space Grotesk, warm bone white, near-black ink, coral accent. */

:root {
    --bg: #FAF9F6;
    --ink: #16150F;
    --secondary: #6B675E;
    --tertiary: #8A867C;
    --body: #514D44;
    --accent: #FF5C38;
    --accent-deep: #C23A1C;
    --tint-bg: #FFF1EC;
    --tint-border: #FFD2C4;
    --hairline: #E9E5DC;
    --input-border: #DDD8CC;
    --dashed: #C9C4B6;
    --pill-bg: #F3F0E8;
    --good-fg: #3A7D44;
    --good-bg: #EDF5EC;
    --good-border: #C8DEC6;
    --warn-fg: #9A6B1F;
    --warn-bg: #F8F1E2;
    --stripes: repeating-linear-gradient(45deg, #EFEBE2 0 12px, #E9E4D8 12px 24px);
    --stripes-sm: repeating-linear-gradient(45deg, #EFEBE2 0 10px, #E9E4D8 10px 20px);
    --font: 'Space Grotesk', sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
}

.hidden {
    display: none !important;
}

button {
    font-family: var(--font);
}

/* ==================== Header ==================== */

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 26px 48px;
    border-bottom: 1px solid var(--hairline);
    max-width: 1020px;
    margin: 0 auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--ink);
}

.wordmark {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.8px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 26px;
}

.nav-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--secondary);
    text-decoration: none;
    transition: color .15s;
}

.nav-link:hover {
    color: var(--ink);
}

/* ==================== Hero + form grid ==================== */

.home,
.shelters {
    max-width: 1020px;
    margin: 0 auto;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 56px;
    align-items: start;
    padding: 48px 48px 16px;
}

.hero-h1 {
    margin: 0;
    font-size: 58px;
    font-weight: 700;
    letter-spacing: -2.5px;
    line-height: 1.02;
}

.hero-h1 .accent {
    color: var(--accent);
}

.hero-chips {
    display: flex;
    gap: 8px;
    margin-top: 26px;
    flex-wrap: wrap;
}

.chip {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--body);
    border: 1px solid var(--input-border);
    padding: 6px 12px;
    border-radius: 999px;
}

/* ==================== Tabs ==================== */

.tabs {
    display: flex;
    gap: 32px;
    border-bottom: 1.5px solid var(--hairline);
}

.tab {
    padding: 14px 4px;
    margin-bottom: -1.5px;
    background: none;
    border: none;
    border-bottom: 2.5px solid transparent;
    font-size: 16.5px;
    font-weight: 600;
    color: var(--tertiary);
    cursor: pointer;
    transition: all .15s;
}

.tab.is-active {
    color: var(--ink);
    border-bottom-color: var(--accent);
}

.panel {
    display: none;
    padding-top: 26px;
}

.panel.is-active {
    display: block;
}

.panel-heading {
    margin: 0;
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.panel-sub {
    margin: 4px 0 0;
    font-size: 14.5px;
    color: var(--secondary);
}

/* ==================== Upload dropzones ==================== */

.dropzone {
    margin-top: 18px;
    border: 1.5px dashed var(--dashed);
    border-radius: 16px;
    background: #FFFFFF;
    padding: 36px 24px;
    text-align: center;
    cursor: pointer;
    transition: all .15s;
}

.dropzone--compact {
    padding: 28px 24px;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--accent);
}

.drop-plus {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--tint-bg);
    color: var(--accent);
    font-size: 24px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.drop-plus--sm {
    width: 40px;
    height: 40px;
    font-size: 22px;
}

.drop-title {
    font-size: 15.5px;
    font-weight: 600;
    margin-top: 10px;
}

.drop-hint {
    font-size: 13px;
    color: var(--tertiary);
    margin-top: 4px;
}

.preview-wrap {
    margin-top: 18px;
}

/* Height follows the image's aspect ratio up to a cap; tall photos are
   letterboxed (centered) by object-fit against the striped backdrop. The
   min-height keeps a visible placeholder box while loading or on a broken
   image. Pure CSS — no per-photo class toggling needed. */
.preview-media {
    display: block;
    width: 100%;
    height: auto;
    min-height: 140px;
    max-height: 420px;
    object-fit: contain;
    border-radius: 16px;
    background: var(--stripes);
}

.preview-media--sm {
    min-height: 110px;
    max-height: 320px;
}

/* ==================== Buttons & links ==================== */

.btn-primary {
    display: block;
    width: 100%;
    margin-top: 18px;
    padding: 17px;
    border: none;
    border-radius: 999px;
    background: var(--ink);
    color: var(--bg);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}

.btn-primary:hover {
    background: var(--accent);
    color: var(--ink);
}

.btn-primary:disabled {
    opacity: .6;
    cursor: default;
}

.btn-primary:disabled:hover {
    background: var(--ink);
    color: var(--bg);
}

.btn-outline {
    display: block;
    width: 100%;
    padding: 14px;
    border: 1.5px solid var(--ink);
    border-radius: 999px;
    background: var(--bg);
    color: var(--ink);
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}

.btn-outline:hover {
    background: var(--ink);
    color: var(--bg);
}

.text-link {
    display: inline-block;
    margin-top: 8px;
    padding: 0;
    background: none;
    border: none;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-deep);
    cursor: pointer;
    text-decoration: none;
}

.text-link--back {
    font-size: 14px;
    margin-top: 0;
}

.form-clear {
    display: block;
    margin: 12px auto 0;
}

.report-again {
    margin-top: 18px;
}

/* ==================== Banners ==================== */

.banner {
    margin-top: 18px;
    padding: 13px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
}

.banner--accent {
    background: var(--tint-bg);
    border: 1px solid var(--tint-border);
    color: var(--accent-deep);
}

.banner--success {
    background: var(--good-bg);
    border: 1px solid var(--good-border);
    color: var(--good-fg);
}

.banner--neutral {
    background: var(--pill-bg);
    color: var(--body);
}

.banner--error {
    background: var(--tint-bg);
    border: 1px solid var(--tint-border);
    color: var(--accent-deep);
}

.banner--pill {
    border-radius: 999px;
    font-size: 13.5px;
    text-align: center;
    margin-top: 10px;
}

/* ==================== Question pills (report flow) ==================== */

.question {
    margin-top: 20px;
}

.question-label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.question-hint {
    font-size: 12.5px;
    color: var(--tertiary);
    margin-top: 6px;
}

.qpill-row {
    display: flex;
    gap: 10px;
}

.qpill {
    flex: 1;
    text-align: center;
    padding: 12px 16px;
    border-radius: 999px;
    border: 1.5px solid var(--input-border);
    background: #FFFFFF;
    color: var(--secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}

.qpill.is-selected {
    border-color: var(--accent);
    background: var(--tint-bg);
    color: var(--accent-deep);
}

.reveal {
    margin-top: 12px;
}

/* ==================== Inputs ==================== */

.pill-input {
    width: 100%;
    padding: 14px 18px;
    border: 1.5px solid var(--input-border);
    border-radius: 999px;
    font-family: var(--font);
    font-size: 14.5px;
    background: #FFFFFF;
    color: var(--ink);
    outline: none;
}

.area-input {
    width: 100%;
    margin-top: 12px;
    padding: 16px 18px;
    border: 1.5px solid var(--input-border);
    border-radius: 18px;
    font-family: var(--font);
    font-size: 14.5px;
    background: var(--bg);
    color: var(--ink);
    outline: none;
    resize: vertical;
}

.pill-input::placeholder,
.area-input::placeholder {
    color: var(--tertiary);
}

/* ==================== Match results ==================== */

.match-card {
    margin-top: 10px;
    border: 1.5px solid var(--hairline);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: #FFFFFF;
    cursor: pointer;
    transition: all .15s;
}

.match-card:first-of-type {
    margin-top: 12px;
}

.match-card:hover {
    border-color: var(--accent);
}

.match-thumb {
    width: 84px;
    height: 84px;
    flex: none;
    border-radius: 12px;
    object-fit: cover;
    background: var(--stripes-sm);
}

.match-body {
    flex: 1;
    min-width: 0;
}

.match-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.match-meta {
    font-size: 13px;
    color: var(--secondary);
    margin-top: 3px;
}

.pill-row {
    display: flex;
    gap: 6px;
    margin-top: 9px;
    flex-wrap: wrap;
}

.pill {
    font-size: 12px;
    font-weight: 600;
    color: var(--body);
    background: var(--pill-bg);
    padding: 4px 10px;
    border-radius: 999px;
}

.pill--good {
    color: var(--good-fg);
    background: var(--good-bg);
}

.pill--warn {
    color: var(--warn-fg);
    background: var(--warn-bg);
}

.pill--neutral {
    color: var(--secondary);
    background: var(--pill-bg);
}

.match-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.pct-chip {
    flex: none;
    background: var(--ink);
    color: var(--bg);
    font-size: 12.5px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 999px;
    white-space: nowrap;
}

.pct-chip--green {
    background: #1e7d32;
}

.pct-chip--yellow {
    background: #b8860b;
}

.pct-chip--orange {
    background: #c2560c;
}

.pct-chip--gray {
    background: #6b7280;
}

.view-cue {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-deep);
}

/* ==================== Match detail ==================== */

.detail-photo {
    display: block;
    width: 100%;
    margin-top: 14px;
    height: 280px;
    object-fit: cover;
    border-radius: 18px;
    background: var(--stripes);
}

.detail-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
}

.detail-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.4px;
}

.detail-meta {
    font-size: 13.5px;
    color: var(--secondary);
    margin-top: 4px;
}

.info-card {
    margin-top: 18px;
    border: 1.5px solid var(--hairline);
    border-radius: 16px;
    padding: 10px 18px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 9px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--hairline);
}

.info-row:last-child {
    border-bottom: none;
}

.info-row .k {
    color: var(--secondary);
}

.info-row .v {
    font-weight: 700;
    text-align: right;
}

.shelters-block {
    margin-top: 16px;
}

.shelters-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--tertiary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.shelter-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--hairline);
    font-size: 14px;
}

.shelter-row .name {
    font-weight: 600;
}

.shelter-row .meta {
    color: var(--secondary);
    flex: none;
}

/* ==================== Post-report validation card ==================== */

.validate-card {
    margin-top: 12px;
    border: 1.5px solid var(--hairline);
    border-radius: 16px;
    padding: 18px;
    background: #FFFFFF;
}

.validate-heading {
    font-size: 15.5px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.validate-sub {
    font-size: 13.5px;
    color: var(--secondary);
    margin-top: 4px;
}

.validate-body {
    margin-top: 14px;
    display: flex;
    gap: 14px;
    align-items: center;
}

.validate-thumb {
    width: 76px;
    height: 76px;
    flex: none;
    border-radius: 12px;
    object-fit: cover;
    background: var(--stripes-sm);
}

.validate-label {
    font-size: 14.5px;
    font-weight: 700;
}

.validate-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.btn-dark-sm {
    flex: 1;
    text-align: center;
    padding: 13px;
    border: none;
    border-radius: 999px;
    background: var(--ink);
    color: var(--bg);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all .15s;
}

.btn-dark-sm:hover {
    background: var(--accent);
    color: var(--ink);
}

.btn-outline-sm {
    flex: 1;
    text-align: center;
    padding: 13px;
    border-radius: 999px;
    border: 1.5px solid var(--input-border);
    background: none;
    color: var(--body);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all .15s;
}

.btn-outline-sm:hover {
    border-color: var(--ink);
}

/* ==================== Nearby shelters dialog ==================== */

.shelters-dialog {
    width: 90%;
    max-width: 420px;
    border: 1.5px solid var(--hairline);
    border-radius: 20px;
    padding: 24px 26px;
    background: #FFFFFF;
    color: var(--ink);
    font-family: var(--font);
}

.shelters-dialog::backdrop {
    background: rgba(22, 21, 15, .45);
}

.shelters-dialog .shelter-row:last-of-type {
    border-bottom: none;
}

.dialog-note {
    margin-top: 12px;
    font-size: 13.5px;
    color: var(--secondary);
}

.services-card {
    margin-top: 14px;
    margin-bottom: 6px;
    padding: 14px 16px;
    border: 1.5px solid var(--tint-border);
    background: var(--tint-bg);
    border-radius: 12px;
}

.services-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-deep);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.services-name {
    font-size: 14.5px;
    font-weight: 700;
    margin-top: 6px;
}

.services-dist {
    font-weight: 600;
    font-size: 12.5px;
    color: var(--secondary);
}

.services-meta {
    font-size: 13px;
    color: var(--body);
    margin-top: 3px;
}

.services-phone {
    font-weight: 700;
}

.shelters-dialog-close {
    display: block;
    width: 100%;
    margin-top: 18px;
}

/* ==================== No-results / alert signup ==================== */

.alert-form {
    margin-top: 14px;
    border: 1.5px solid var(--hairline);
    border-radius: 16px;
    padding: 18px;
    background: #FFFFFF;
}

.alert-form .pill-input {
    margin-top: 10px;
}

/* ==================== /shelters page ==================== */

.shelters {
    max-width: 620px;
    padding: 44px 48px 24px;
}

.page-h1 {
    margin: 18px 0 0;
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -1.5px;
    line-height: 1.08;
}

.page-copy {
    margin: 14px 0 0;
    font-size: 15.5px;
    line-height: 1.6;
    color: var(--body);
}

.shelter-card {
    margin-top: 26px;
    background: #FFFFFF;
    border: 1.5px solid var(--hairline);
    border-radius: 20px;
    padding: 28px 30px;
}

.shelter-card .banner {
    margin-top: 0;
    font-size: 14.5px;
}

.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.shelter-card .pill-input {
    background: var(--bg);
}

.shelter-card .btn-primary {
    margin-top: 14px;
}

/* ==================== Footer ==================== */

.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 48px;
    font-size: 13px;
    color: var(--tertiary);
    max-width: 1020px;
    margin: 0 auto;
}

/* ==================== Responsive ==================== */

@media (max-width: 900px) {

    .header,
    .footer {
        padding-left: 22px;
        padding-right: 22px;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 32px 22px 12px;
    }

    .hero-h1 {
        font-size: 40px;
        letter-spacing: -1.5px;
    }

    .hero-chips {
        margin-top: 18px;
    }

    .shelters {
        padding: 32px 22px 16px;
    }

    .page-h1 {
        font-size: 32px;
        letter-spacing: -1px;
    }

    .input-grid {
        grid-template-columns: 1fr;
    }

    .footer {
        flex-direction: column;
        gap: 6px;
        text-align: center;
    }
}

@media (max-width: 520px) {
    .qpill-row {
        flex-direction: column;
    }

    .match-side {
        align-items: flex-start;
    }

    .match-card {
        flex-wrap: wrap;
    }
}
