:root {
    --oam-pwa-navy: #14213d;
    --oam-pwa-blue: #075985;
    --oam-pwa-light: #f4f6f8;
    --oam-pwa-border: #d7dee8;
    --oam-pwa-text: #111827;
    --oam-pwa-muted: #5b6472;
}

body.oam-pwa-app-page {
    background: var(--oam-pwa-light);
}

body.oam-pwa-app-page main,
body.oam-pwa-app-page .site-main,
body.oam-pwa-app-page .site-content,
body.oam-pwa-app-page .content-area,
body.oam-pwa-app-page .entry-content,
body.oam-pwa-app-page .wp-site-blocks,
body.oam-pwa-app-page .wp-block-post-content {
    width: 100%;
    max-width: none;
}

body.oam-pwa-app-page article > .entry-header,
body.oam-pwa-app-page article > .post-header,
body.oam-pwa-app-page article > .post-meta,
body.oam-pwa-app-page .wp-block-post-title,
body.oam-pwa-app-page .wp-block-post-author,
body.oam-pwa-app-page .wp-block-post-date,
body.oam-pwa-app-page .entry-title,
body.oam-pwa-app-page .entry-meta {
    display: none !important;
}

.oam-pwa-shell {
    width: min(100%, 1500px);
    margin: 0 auto;
    color: var(--oam-pwa-text);
}

.oam-pwa-topbar {
    position: sticky;
    top: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px clamp(14px, 3vw, 34px);
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 0 0 18px 18px;
    background: linear-gradient(135deg, #14213d, #243b63);
    box-shadow: 0 12px 34px rgba(20,33,61,.22);
    color: #fff;
}

.oam-pwa-shell.is-bidder .oam-pwa-topbar {
    background: linear-gradient(135deg, #075985, #0c7db1);
}

.admin-bar .oam-pwa-topbar {
    top: 32px;
}

.oam-pwa-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    color: #fff !important;
    text-decoration: none !important;
}

.oam-pwa-brand img {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    border-radius: 13px;
    box-shadow: 0 5px 16px rgba(0,0,0,.22);
}

.oam-pwa-brand span {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.oam-pwa-brand strong {
    font-size: clamp(1.05rem, 2.6vw, 1.35rem);
    line-height: 1.1;
}

.oam-pwa-brand small {
    overflow: hidden;
    color: rgba(255,255,255,.82);
    font-size: .82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.oam-pwa-main {
    padding: clamp(14px, 2.5vw, 30px);
}

.oam-pwa-tabs {
    position: sticky;
    top: 82px;
    z-index: 70;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    padding: 10px clamp(12px, 3vw, 30px);
    border-bottom: 1px solid var(--oam-pwa-border);
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(14px);
}

.admin-bar .oam-pwa-tabs {
    top: 114px;
}

.oam-pwa-tab {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    border: 1px solid var(--oam-pwa-border);
    border-radius: 11px;
    background: #fff;
    color: #273449 !important;
    font-size: .9rem;
    font-weight: 800;
    line-height: 1.15;
    text-align: center;
    text-decoration: none !important;
}

.oam-pwa-tab.is-active {
    border-color: #075985;
    background: #075985;
    color: #fff !important;
    box-shadow: 0 6px 18px rgba(7,89,133,.23);
}

.oam-pwa-install {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.oam-pwa-install-button,
.oam-pwa-primary {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border: 1px solid rgba(255,255,255,.55);
    border-radius: 11px;
    background: #fff;
    color: #14213d !important;
    font: inherit;
    font-size: .9rem;
    font-weight: 850;
    line-height: 1;
    text-decoration: none !important;
    cursor: pointer;
}

.oam-pwa-install-button:disabled {
    cursor: wait;
    opacity: .7;
}

.oam-pwa-installed {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.18);
    color: #fff;
    font-size: .85rem;
    font-weight: 800;
}

.oam-pwa-install-status {
    max-width: 280px;
    color: inherit;
    font-size: .78rem;
    line-height: 1.3;
}

.oam-pwa-network {
    position: sticky;
    top: 0;
    z-index: 95;
    padding: 10px 16px;
    text-align: center;
    font-weight: 800;
}

.oam-pwa-network.is-offline {
    background: #991b1b;
    color: #fff;
}

.oam-pwa-network.is-online {
    background: #166534;
    color: #fff;
}

.oam-pwa-ios-dialog {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15,23,42,.68);
}

.oam-pwa-ios-dialog[hidden] {
    display: none !important;
}

.oam-pwa-ios-card {
    position: relative;
    width: min(100%, 430px);
    padding: 28px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(0,0,0,.35);
    color: #111827;
}

.oam-pwa-ios-card h3 {
    margin: 0 36px 10px 0;
}

.oam-pwa-ios-card p {
    margin: 0;
    color: #465264;
    line-height: 1.6;
}

.oam-pwa-dialog-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: #eef2f7;
    color: #111827;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.oam-pwa-access {
    max-width: 620px;
    margin: 60px auto;
    padding: 30px;
    border: 1px solid var(--oam-pwa-border);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(15,23,42,.12);
    text-align: center;
}

.oam-pwa-access .oam-pwa-primary {
    border-color: #075985;
    background: #075985;
    color: #fff !important;
}

.oam-pwa-standalone-nav {
    display: none;
}

html.oam-pwa-standalone .oam-pwa-standalone-nav {
    position: fixed;
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    left: max(10px, env(safe-area-inset-left));
    z-index: 9998;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 8px;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 18px;
    background: rgba(15,23,42,.94);
    box-shadow: 0 14px 40px rgba(0,0,0,.32);
    backdrop-filter: blur(16px);
}

html.oam-pwa-standalone .oam-pwa-standalone-nav a {
    display: grid;
    gap: 2px;
    min-height: 50px;
    place-items: center;
    border-radius: 12px;
    color: #fff !important;
    font-size: .72rem;
    font-weight: 800;
    text-decoration: none !important;
}

html.oam-pwa-standalone .oam-pwa-standalone-nav a:active {
    background: rgba(255,255,255,.14);
}

html.oam-pwa-standalone body:has(.oam-pwa-standalone-nav) {
    padding-bottom: calc(78px + env(safe-area-inset-bottom));
}

.oam-pwa-admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    max-width: 1100px;
    margin: 22px 0;
}

.oam-pwa-admin-card {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    padding: 22px;
    border: 1px solid #c9d1dc;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 7px 24px rgba(15,23,42,.07);
}

.oam-pwa-admin-card img {
    border-radius: 20px;
}

.oam-pwa-admin-card h2 {
    margin-top: 0;
}

.oam-pwa-admin-card code {
    display: block;
    overflow-wrap: anywhere;
}

@media (max-width: 782px) {
    .admin-bar .oam-pwa-topbar { top: 46px; }
    .admin-bar .oam-pwa-tabs { top: 128px; }
    .oam-pwa-topbar {
        align-items: flex-start;
        padding: 12px;
        border-radius: 0 0 14px 14px;
    }
    .oam-pwa-brand img {
        width: 46px;
        height: 46px;
    }
    .oam-pwa-install.is-compact .oam-pwa-install-button {
        min-height: 40px;
        padding: 9px 11px;
        font-size: .78rem;
    }
    .oam-pwa-install.is-compact .oam-pwa-install-status {
        display: none;
    }
    .oam-pwa-tabs {
        top: 72px;
        gap: 5px;
        padding: 8px;
    }
    .oam-pwa-tab {
        min-height: 44px;
        padding: 7px 4px;
        font-size: .74rem;
    }
    .oam-pwa-main {
        padding: 10px;
    }
    .oam-pwa-admin-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .oam-pwa-brand small { display: none; }
    .oam-pwa-brand strong { font-size: 1rem; }
    .oam-pwa-install.is-compact .oam-pwa-install-button {
        max-width: 112px;
        line-height: 1.15;
        white-space: normal;
    }
    .oam-pwa-admin-card {
        grid-template-columns: 68px minmax(0, 1fr);
        padding: 16px;
    }
    .oam-pwa-admin-card img {
        width: 68px;
        height: 68px;
    }
}

/* Hidden install state must win over component display rules. */
.oam-pwa-installed[hidden],
.oam-pwa-install-button[hidden],
.oam-push-enable[hidden],
.oam-push-disable[hidden],
.oam-push-toast[hidden] {
    display: none !important;
}

.oam-pwa-topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.oam-pwa-alert-button {
    display: inline-grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid rgba(255,255,255,.55);
    border-radius: 12px;
    background: rgba(255,255,255,.12);
    color: #fff !important;
    font: inherit;
    font-size: 1.2rem;
    text-decoration: none !important;
    cursor: pointer;
}

.oam-pwa-alert-button.is-enabled {
    background: #fff;
    color: #075985 !important;
    box-shadow: 0 0 0 3px rgba(255,255,255,.18);
}

.oam-push-settings {
    margin-top: 22px;
    padding: clamp(18px, 4vw, 28px);
    border: 1px solid #cbd8e6;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 12px 34px rgba(15,23,42,.08);
}

.oam-push-settings-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.oam-push-settings h3 {
    margin: 2px 0 4px;
    font-size: clamp(1.3rem, 4vw, 1.8rem);
}

.oam-push-eyebrow {
    margin: 0;
    color: #0369a1;
    font-size: .76rem;
    font-weight: 900;
    letter-spacing: .09em;
}

.oam-push-state {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    padding: 6px 11px;
    border-radius: 999px;
    background: #eef2f7;
    color: #475569;
    font-size: .82rem;
    font-weight: 850;
}

.oam-push-state.is-enabled {
    background: #dcfce7;
    color: #166534;
}

.oam-push-state.is-blocked {
    background: #fee2e2;
    color: #991b1b;
}

.oam-push-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0;
}

.oam-push-enable,
.oam-push-disable {
    min-height: 46px;
    padding: 10px 18px;
    border: 0;
    border-radius: 11px;
    font: inherit;
    font-weight: 850;
    cursor: pointer;
}

.oam-push-enable {
    background: #075985;
    color: #fff;
}

.oam-push-disable {
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #334155;
}

.oam-push-settings fieldset {
    display: grid;
    gap: 12px;
    margin: 18px 0 8px;
    padding: 16px;
    border: 1px solid #dbe3ec;
    border-radius: 12px;
}

.oam-push-settings fieldset label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 750;
}

.oam-push-settings input[type="checkbox"] {
    width: 22px;
    height: 22px;
}

.oam-push-note,
.oam-push-status {
    color: #5b6472;
    font-size: .9rem;
}

.oam-push-status.is-error {
    color: #b91c1c;
    font-weight: 700;
}

.oam-push-toast {
    position: fixed;
    z-index: 100000;
    right: 16px;
    bottom: 18px;
    width: min(calc(100vw - 32px), 390px);
    padding: 13px 16px;
    border-radius: 12px;
    background: #0f172a;
    box-shadow: 0 16px 42px rgba(0,0,0,.28);
    color: #fff;
    font-weight: 750;
}

.oam-push-toast.is-error {
    background: #991b1b;
}

@media (max-width: 620px) {
    .oam-pwa-topbar {
        align-items: flex-start;
    }
    .oam-pwa-topbar-actions {
        flex-direction: column;
        align-items: flex-end;
    }
    .oam-pwa-install.is-compact .oam-pwa-install-button {
        max-width: 152px;
        min-height: 42px;
        padding: 9px 12px;
        line-height: 1.15;
        white-space: normal;
    }
    .oam-push-settings-heading {
        flex-direction: column;
    }
}

/* v0.6.1: the private manager header should scroll away with the page. */
.oam-pwa-shell.is-manager .oam-pwa-topbar,
.admin-bar .oam-pwa-shell.is-manager .oam-pwa-topbar {
    position: relative;
    top: auto;
}

/* v0.7.0 manager app navigation */
.oam-pwa-manager-tabs{grid-template-columns:repeat(2,minmax(0,1fr))}
.oam-pwa-shell.is-manager .oam-pwa-manager-tabs{top:0}
.admin-bar .oam-pwa-shell.is-manager .oam-pwa-manager-tabs{top:32px}
@media(max-width:782px){.admin-bar .oam-pwa-shell.is-manager .oam-pwa-manager-tabs{top:46px}}
