/* App-style shell: bottom bar on phones (and the installed app), offline page */
.bottom-nav { display: none; }
.offline-box { text-align: center; padding: var(--space-7) var(--space-5); }
.offline-logo { border-radius: 22px; margin: 0 auto var(--space-4); display: block; }
@media (max-width: 800px) {
    body.has-bottom-nav { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
    .topbar { padding-top: calc(var(--space-2) + env(safe-area-inset-top)); }
    .bottom-nav {
        display: flex; position: fixed; inset-inline: 0; bottom: 0; z-index: 22; align-items: stretch; justify-content: space-around;
        background: var(--color-chrome); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 18px rgba(15, 12, 35, .28);
        border-radius: 18px 18px 0 0;
    }
    .bn-item {
        flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; min-width: 0;
        color: #B9B4D6; text-decoration: none; background: none; border: 0; font: inherit; font-size: 11.5px; line-height: 1.2; cursor: pointer;
        border-radius: 12px; padding: 4px 2px; -webkit-tap-highlight-color: transparent;
    }
    .bn-item .icon { width: 24px; height: 24px; }
    .bn-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .bn-item:active { background: var(--color-chrome-hover); }
    .bn-item[aria-current="page"] { color: var(--white); font-weight: 700; }
    .bn-item[aria-current="page"] .icon { color: var(--color-accent); }
    .bn-item:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }
    /* the main action: a raised rose button in the middle */
    .bn-main { flex: 0 0 auto; width: 64px; margin-top: -22px; color: var(--white); }
    .bn-main .bn-fab { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; background: var(--color-primary); border: 4px solid var(--color-chrome); box-shadow: 0 6px 14px rgba(0, 0, 0, .35); }
    .bn-main .bn-fab .icon { width: 28px; height: 28px; color: var(--white); }
    .bn-main span.bn-label { color: #B9B4D6; }
    .bn-main[aria-current="page"] span.bn-label { color: var(--white); font-weight: 700; }
}
@media print { .bottom-nav { display: none !important; } }

/* ---- Offline mode ---- */
.bp-notice { position: fixed; inset-inline: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 40; padding: 12px 16px; border-radius: 12px; background: var(--color-chrome); color: var(--white); box-shadow: 0 8px 24px rgba(0, 0, 0, .3); font-weight: 500; }
.bp-notice--ok { border-inline-start: 6px solid #2fa36b; }
.bp-notice--error { background: #8f1d14; }
#bp-offline-bar { position: sticky; top: 0; z-index: 35; padding: 8px 14px; background: #8a3f06; color: #fff; font-size: 14px; text-align: center; padding-top: calc(8px + env(safe-area-inset-top)); }
#bp-offline-bar[hidden], .bp-notice[hidden] { display: none; }
.bp-outbox { border-inline-start: 6px solid var(--color-accent); }
.bp-outbox h2 { margin-top: 0; }
.bp-outbox-row { display: flex; flex-direction: column; gap: 4px; padding: 10px 0; border-top: 1px solid var(--color-border); }
.bp-outbox-row:first-of-type { border-top: 0; }
.bp-outbox-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.bp-review small, .bp-error small { color: #8a3f06; font-weight: 700; }
.bp-diffs { margin: 4px 0 0; padding-inline-start: 18px; font-size: 14px; }
.ov-body { min-height: 100vh; background: var(--color-bg); }
.ov { max-width: 720px; margin: 0 auto; padding: calc(16px + env(safe-area-inset-top)) 16px 32px; }
.ov-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.ov-head h1 { margin: 0; font-size: 20px; }
.ov-head p { margin: 2px 0 0; font-size: 13px; }
.ov-logo { border-radius: 12px; }
.ov-actions, .ov-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ov-search { margin-bottom: 8px; }
.ov-list { display: flex; flex-direction: column; gap: 8px; }
.ov-day { margin: 12px 0 0; font-size: 14px; color: var(--color-text-muted); direction: ltr; text-align: right; }
.ov-row { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; }
.ov-phone { direction: ltr; text-align: right; color: var(--color-primary); font-weight: 700; text-decoration: none; }