:root {
    --bg: #f2f0e9;
    --card: #ffffff;
    --text: #171915;
    --muted: #6f736a;
    --border: #dcded6;
    --green: #1e6c42;
    --green-soft: #dcefe4;
    --shadow: 0 14px 45px rgba(20, 30, 20, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
                 "Segoe UI", sans-serif;
}

button,
input {
    font: inherit;
}

button,
a,
input[type="checkbox"] {
    touch-action: manipulation;
}

a {
    color: inherit;
}

/* Mobile-first: comfortable on a phone without making desktop feel stretched. */
.container,
.admin-container {
    width: 100%;
    max-width: 1040px;
    margin: 0 auto;
    padding: max(14px, env(safe-area-inset-top)) 14px
             calc(34px + env(safe-area-inset-bottom));
}

.hero {
    min-height: 60svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    padding: 40px 20px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: background 250ms ease, transform 250ms ease;
}

.hero-here {
    background: var(--green);
    color: white;
}

.hero-away {
    background: #272c25;
    color: white;
}

.status-badge {
    display: inline-block;
    padding: 8px 13px;
    margin-bottom: 18px;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .14em;
}

.hero h1 {
    margin: 0;
    max-width: 100%;
    font-size: clamp(3rem, 16vw, 5.6rem);
    line-height: .9;
    letter-spacing: -.06em;
}

.status-message {
    margin: 24px auto 0;
    max-width: 560px;
    font-size: clamp(1.18rem, 5vw, 1.55rem);
    line-height: 1.3;
}

.since-text,
.eta-text {
    margin: 10px 0 0;
    opacity: .78;
    font-size: .98rem;
}

.public-info-grid {
    display: grid;
    gap: 14px;
}

.card {
    margin-top: 14px;
    padding: 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 5px 20px rgba(20,30,20,.035);
}

.card h2 {
    margin: 0 0 16px;
    font-size: 1.3rem;
}

.latest-card h2 {
    margin-bottom: 4px;
    font-size: 1.55rem;
}

.eyebrow {
    margin: 0 0 7px;
    color: var(--muted);
    font-size: .73rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.muted {
    color: var(--muted);
}

.section-heading,
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.section-heading h2,
.admin-header h1 {
    margin: 0;
}

.live-dot {
    font-size: .78rem;
    font-weight: 700;
    color: var(--green);
}

.update-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 14px 0;
    border-top: 1px solid var(--border);
}

.update-row:first-child {
    border-top: 0;
}

.update-row time {
    color: var(--muted);
    font-size: .86rem;
}

.refresh-note {
    margin: 16px 0 0;
    text-align: center;
    color: var(--muted);
    font-size: .8rem;
}

/* Admin: large controls for thumb use. */
.admin-header {
    align-items: flex-start;
    flex-direction: column;
    margin: 6px 2px 18px;
}

.admin-header h1 {
    font-size: 1.9rem;
}

.header-links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: .9rem;
}

.admin-grid {
    display: grid;
    gap: 0;
}

form {
    display: grid;
    gap: 14px;
}

label {
    display: grid;
    gap: 7px;
    font-size: .9rem;
    font-weight: 700;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    min-height: 50px;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: white;
    color: var(--text);
    font-size: 16px; /* prevents iOS zoom-on-focus */
}

input:focus {
    outline: 2px solid rgba(30,108,66,.25);
    border-color: var(--green);
}

.primary-button,
.quick-button {
    min-height: 52px;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 750;
    -webkit-tap-highlight-color: transparent;
}

.primary-button {
    width: 100%;
    padding: 14px 18px;
    background: var(--text);
    color: white;
}

.quick-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.quick-grid form {
    display: block;
}

.quick-button {
    width: 100%;
    padding: 13px 14px;
    background: #eef0eb;
    color: var(--text);
    border: 1px solid var(--border);
    text-align: left;
}

.park-toggle {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    background: var(--green-soft);
    border-radius: 15px;
}

.park-toggle input {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
}

.park-toggle span {
    display: grid;
    gap: 3px;
}

.park-toggle strong {
    font-size: 1.05rem;
}

.park-toggle small {
    color: var(--muted);
    font-weight: 500;
    line-height: 1.35;
}

.login-page {
    display: grid;
    place-items: center;
    min-height: 100svh;
    padding: max(18px, env(safe-area-inset-top)) 14px
             max(18px, env(safe-area-inset-bottom));
}

.login-card {
    width: min(430px, 100%);
    padding: 24px 20px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.login-card h1 {
    margin-top: 0;
}

.error {
    padding: 10px 12px;
    background: #f9dddd;
    border-radius: 8px;
    color: #7f2222;
}

.back-link {
    display: inline-block;
    margin-top: 20px;
    color: var(--muted);
    font-size: .9rem;
}

/* Tablet: use horizontal space without shrinking tap targets. */
@media (min-width: 700px) {
    .container,
    .admin-container {
        padding: 34px 24px 70px;
    }

    .hero {
        min-height: 500px;
        padding: 64px 32px;
        border-radius: 28px;
    }

    .hero h1 {
        font-size: clamp(4.4rem, 10vw, 6.4rem);
    }

    .card {
        margin-top: 20px;
        padding: 26px;
        border-radius: 20px;
    }

    .public-info-grid {
        grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
        gap: 20px;
    }

    .public-info-grid .card {
        height: 100%;
    }

    .update-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 16px;
    }

    .admin-header {
        flex-direction: row;
        align-items: center;
        margin-bottom: 4px;
    }

    .admin-grid {
        grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
        gap: 20px;
    }

    .admin-grid .card {
        height: calc(100% - 20px);
    }

    .primary-button {
        width: auto;
        justify-self: start;
        min-width: 170px;
    }

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

/* Laptop/desktop: wider composition and denser admin shortcuts. */
@media (min-width: 1000px) {
    .container,
    .admin-container {
        padding-top: 46px;
    }

    .hero {
        min-height: 480px;
        padding-inline: 60px;
    }

    .hero h1 {
        font-size: 6.6rem;
    }

    .status-message {
        font-size: 1.55rem;
    }

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

    .quick-button {
        text-align: center;
    }

    .login-card {
        padding: 32px;
    }
}
