*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

body {
    font-family: system-ui, sans-serif;
    background: #1c2023;
    color: #dde3e8;
    min-height: 100vh;
}

/* ── Header ── */
header {
    background: #252c31;
    border-bottom: 1px solid #3a4a54;
    padding: 0.75rem 1.5rem;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-width: 1200px;
    margin: 0 auto;
}
.site-title { font-size: 1.3rem; font-weight: 700; color: #a8d8ea; text-decoration: none; }
nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; justify-content: flex-end; }
nav a, nav .link-btn { color: #b8d2e2; text-decoration: none; font-size: 0.9rem; }
nav a:hover, nav .link-btn:hover { color: #dde3e8; }
.link-btn { background: none; border: none; cursor: pointer; padding: 0; font: inherit; }

/* ── Get App button ── */
.get-app-wrap { position: relative; display: none; align-items: center; }
.get-app-btn {
    background: #a8d8ea; color: #000; border: none; border-radius: 5px;
    padding: 0.3rem 0.75rem; font-size: 0.85rem; font-weight: 700;
    cursor: pointer; line-height: 1.4;
}
.get-app-btn:hover { background: #8bc5d8; }
.get-app-popup {
    display: none; position: absolute; top: calc(100% + 0.5rem); right: 0;
    background: #0d2236; border: 1px solid #2a4a63; border-radius: 8px;
    padding: 0.85rem 1rem; width: 240px; font-size: 0.85rem; color: #c8dce8;
    z-index: 200; box-shadow: 0 4px 16px rgba(0,0,0,0.5); line-height: 1.5;
}
.get-app-popup.visible { display: block; }
.get-app-steps { display: flex; flex-direction: column; gap: 0.3rem; margin: 0.5rem 0 0.4rem; }
.get-app-step { display: flex; align-items: center; gap: 0.4rem; }
.get-app-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.3rem; height: 1.3rem; background: #1a3a54; border-radius: 50%;
    font-size: 0.75rem; font-weight: 700; color: #a8d8ea; flex-shrink: 0;
}
.get-app-note { font-size: 0.75rem; color: #6a8a9a; }

/* ── Main ── */
main { max-width: 1200px; margin: 1.5rem auto; padding: 0 1rem; }

/* ── Notifications bar ── */
.notif-bar {
    display: flex; align-items: center; gap: 0.75rem;
    margin-bottom: 1rem; position: relative;
}
#save-indicator {
    position: absolute; right: 0; top: -1.1rem;
}
.last-scrape { font-size: 0.8rem; color: #8ab0c2; margin-left: auto; }


/* ── Status grid ── */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}
.group h3 {
    font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em;
    color: #b8d2e2; margin-bottom: 0.4rem; padding-bottom: 0.25rem;
    border-bottom: 1px solid #3a4a54;
}

.item {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.2rem 0.3rem; border-radius: 4px;
    cursor: pointer; font-size: 0.82rem; line-height: 1.3;
}
.item input[type=checkbox] { accent-color: #3a7a9a; flex-shrink: 0; }
.item span:first-of-type { flex: 1; }

/* Status background colours */
.item.open       { background: rgba(72,187,120,0.30); }
.item.closed     { background: rgba(245,101,101,0.28); }
.item.on_hold    { background: rgba(236,201,75,0.28); }
.item.scheduled  { background: rgba(99,179,237,0.25); }
.item.hiking     { background: rgba(104,211,145,0.18); }
.item.unknown    { background: rgba(143,168,184,0.18); }

.badge {
    font-size: 0.7rem; font-weight: 600; padding: 0.1rem 0.35rem;
    border-radius: 3px; flex-shrink: 0; white-space: nowrap;
}
.badge.open       { background: #1e4d35; color: #9ae6b4; }
.badge.closed     { background: #4a1f1f; color: #feb2b2; }
.badge.on_hold    { background: #4a3510; color: #fefcbf; }
.badge.scheduled  { background: #1a3050; color: #90cdf4; }
.badge.hiking     { background: #1a3a28; color: #9ae6b4; }
.badge.unknown    { background: #2c3840; color: #8ab0c2; }

/* ── Tabs ── */
.tab-bar {
    display: flex; flex-wrap: wrap; gap: 0; margin: 1rem 0 0;
    border-bottom: 2px solid #3a4a54;
}
.tab-btn {
    background: transparent; color: #8ab0c2; border: none;
    padding: 0.6rem 1.5rem; font-size: 0.95rem; font-weight: 600;
    cursor: pointer; border-bottom: 2px solid transparent;
    margin-bottom: -2px; border-radius: 0;
}
.tab-btn:hover { color: #dde3e8; }
.tab-btn.active { color: #a8d8ea; border-bottom-color: #a8d8ea; }
.section-select-all-label { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; }
.section-select-all { margin: 0; }
.tab-pane { display: none; padding-top: 1rem; }
.tab-pane.active { display: block; }

/* ── Collapsible sections ── */
details.group > summary { cursor: pointer; list-style: none; }
details.group > summary::-webkit-details-marker { display: none; }
details.group > summary h3 { display: inline-flex; }
details.group > summary h3::before { content: "\25B6"; margin-right: 2rem; font-size: 0.7em; transition: transform 0.2s; display: none; padding: 0.3rem; }
details[open].group > summary h3::before { transform: rotate(90deg); }

@media (max-width: 560px) {
    details.group > summary h3::before { display: inline; }
    .section-select-all { min-width: 1.2rem; min-height: 1.2rem; }
    .get-app-wrap { display: inline-flex; }
}

/* ── Status actions ── */
.status-actions {
    margin-top: 1rem; display: flex; gap: 1rem; align-items: center;
}

/* ── Cards ── */
.card {
    background: #252c31; border: 1px solid #3a4a54;
    border-radius: 8px; padding: 1.5rem; margin-bottom: 1rem;
}
.card.center { max-width: 380px; margin: 3rem auto; }
.card h3 { font-size: 1rem; margin-bottom: 1rem; color: #a8d8ea; }

/* ── Forms ── */
label { display: block; margin-bottom: 0.75rem; font-size: 0.9rem; color: #b8d2e2; }
label input:not([type=checkbox]) { display: block; width: 100%; margin-top: 0.25rem; }
input[type=text], input[type=email], input[type=password] {
    background: #4a6275; border: 1px solid #5a7585; color: #ffffff;
    padding: 0.5rem 0.75rem; border-radius: 4px; font-size: 0.9rem;
    width: 100%;
}
input:focus { outline: 2px solid #a8d8ea; }

button {
    background: #3a6a80; color: #fff; border: none;
    padding: 0.5rem 1.25rem; border-radius: 4px; cursor: pointer;
    font-size: 0.9rem; font-weight: 600;
}
button:hover { background: #2d5468; }
.btn-on  { background: #1e4d35; }
.btn-on:hover  { background: #163828; }
.btn-off { background: #3a4a54; }
.btn-off:hover { background: #2c3840; }

/* ── Settings ── */
.settings-wrap { max-width: 700px; }
.settings-wrap h2 { margin-bottom: 1rem; }
section.card h3 { border-bottom: 1px solid #3a4a54; padding-bottom: 0.5rem; }
.section-label { display: block; color: #b8d2e2; font-size: 0.75rem; text-transform: uppercase;
    letter-spacing: 0.07em; margin: 0.75rem 0 0.3rem; }
.checkbox-list { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.5rem; }
.checkbox-list label { color: #dde3e8; font-size: 0.85rem; display: flex; align-items: center; gap: 0.5rem; }

/* ── Messages ── */
.error   { color: #fc8181; margin-bottom: 0.75rem; font-size: 0.9rem; }
.success { color: #68d391; margin-bottom: 0.75rem; font-size: 0.9rem; }

a { color: #a8d8ea; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Mobile ── */
@media (max-width: 560px) {
    nav { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; justify-content: flex-end; }
    nav a, nav .link-btn { padding: 0.35rem 0; min-height: 44px; display: inline-flex; align-items: center; }
    .tab-btn { padding: 0.5rem 0.7rem; font-size: 0.85rem; }
    .notif-bar button { padding: 0.3rem 0.7rem; font-size: 0.75rem; }
}
