/* Small layout safeguards kept separate from the base theme for easy review. */
.table-wrap {
    width: 100%;
    max-width: 100%;
    contain: paint;
    overscroll-behavior-inline: contain;
}

body {
    overflow-x: clip;
}

.image-placeholder__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Keep the enquiry status compact beside its heading. */
.detail-title {
    align-items: flex-start;
}

.detail-title .badge {
    align-self: flex-start;
    margin-top: 4px;
    white-space: nowrap;
}

/* Form controls share a deliberate vertical rhythm instead of relying on
   browser/widget defaults.  This also keeps the CAPTCHA visually connected
   to the action it protects. */
.login-card form,
.panel form {
    display: grid;
    gap: 20px;
}

.login-card .input,
.panel .input,
.login-card .check {
    margin-bottom: 0;
}

.g-recaptcha {
    width: 304px;
    max-width: 100%;
    margin: 2px 0;
}

/* A capped form column reads more comfortably on wide screens and prevents
   the login image from feeling disconnected from the form. */
.login-grid {
    grid-template-columns: minmax(0, 620px) minmax(360px, 1fr);
    gap: clamp(32px, 5vw, 64px);
}

.login-section {
    padding: clamp(40px, 5vw, 72px) 0;
}

.login-card {
    padding: clamp(28px, 4vw, 44px);
}

@media (max-width: 850px) {
    .login-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .header-inner {
        align-items: flex-start;
        padding: 14px 0;
        gap: 8px;
    }

    .brand {
        font-size: 1.0625rem;
    }

    .primary-nav {
        justify-content: space-between;
    }

    .admin-login-link {
        padding: 8px 12px;
    }

    .login-section {
        min-height: auto;
        padding: 32px 0 48px;
    }

    .login-card {
        padding: 24px 20px;
        border-radius: 12px;
    }

    .login-card form,
    .panel form {
        gap: 18px;
    }

    .table-wrap {
        overflow-x: auto;
    }
}

/* reCAPTCHA's normal widget is 304px wide. Scale it only on the few
   viewports narrower than the page gutter can accommodate. */
@media (max-width: 360px) {
    .g-recaptcha {
        transform: scale(.9);
        transform-origin: left top;
        height: 70px;
        margin-bottom: -6px;
    }
}
