.hp-offline-body {
    margin: 0;
    padding: 1rem;
    background: #f7faf3;
    color: #18230f;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.hp-offline-shell {
    width: min(920px, 100%);
    margin: 0 auto;
}

.hp-offline-capture-shell {
    display: grid;
    gap: .85rem;
}

.hp-offline-hero,
.hp-sync-status-card,
.hp-offline-app-card,
.hp-sync-details {
    background: #fff;
    border: 1px solid #d8e5c8;
    border-radius: 8px;
    padding: 1rem;
    margin: .75rem 0;
}

.hp-offline-hero-quiet {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.hp-offline-hero h1 {
    margin: .1rem 0 0;
    font-size: clamp(1.65rem, 8vw, 2.5rem);
    line-height: 1.05;
}

.hp-offline-kicker,
.hp-offline-hero p,
.muted {
    color: #5d684f;
}

.hp-offline-kicker {
    display: block;
    font-weight: 700;
    font-size: .9rem;
}

.hp-offline-mini-state,
.hp-sync-network {
    display: inline-flex;
    align-items: center;
    min-height: 2.25rem;
    border: 1px solid #d8e5c8;
    border-radius: 999px;
    padding: .35rem .8rem;
    background: #f7faf3;
    color: #4d5c3f;
    font-size: .92rem;
}

.hp-sync-network.online,
.hp-offline-mini-state.online {
    background: #edf8e7;
    border-color: #9bd18a;
    color: #1f5424;
}

.hp-sync-network.offline,
.hp-offline-mini-state.offline {
    background: #fff8e8;
    border-color: #e8c46f;
    color: #6b4a07;
}

.hp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    border: 1px solid #b7c9a5;
    border-radius: 8px;
    padding: .65rem .95rem;
    background: #fff;
    color: #18230f;
    text-decoration: none;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.hp-btn.primary,
.primary {
    background: #4f8f2f;
    border-color: #4f8f2f;
    color: #fff;
}

.hp-offline-app-primary {
    display: grid;
    gap: 1rem;
}

.hp-offline-page-head {
    align-items: center;
}

.hp-offline-app-head,
.hp-sync-status-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.hp-offline-app-head h2,
.hp-sync-status-head h2 {
    margin-top: 0;
}

.hp-offline-ref-state {
    padding: .7rem .85rem;
    border: 1px solid #d8e5c8;
    border-radius: 8px;
    background: #f7faf3;
    color: #5d684f;
}

.hp-offline-ref-state.ok {
    background: #edf8e7;
    border-color: #9bd18a;
    color: #1f5424;
}

.hp-offline-ref-state.warning {
    background: #fff8e8;
    border-color: #e8c46f;
    color: #6b4a07;
}

.hp-offline-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem;
}

.hp-offline-action-panel {
    border: 1px solid #d8e5c8;
    border-radius: 8px;
    background: #fbfdf8;
    overflow: hidden;
}

.hp-offline-action-panel[open] {
    background: #fff;
    box-shadow: 0 8px 24px rgba(31, 60, 24, .08);
}

.hp-offline-action-button {
    display: grid;
    gap: .2rem;
    min-height: 4.5rem;
    padding: 1rem;
    cursor: pointer;
    list-style: none;
}

.hp-offline-action-button::-webkit-details-marker {
    display: none;
}

.hp-offline-action-button strong {
    font-size: 1.25rem;
}

.hp-offline-action-button span {
    color: #5d684f;
}

.hp-offline-form {
    display: grid;
    gap: .75rem;
    padding: 0 1rem 1rem;
}

.hp-offline-form label {
    display: grid;
    gap: .35rem;
    color: #18230f;
    font-weight: 700;
}

.hp-offline-form input,
.hp-offline-form select,
.hp-offline-form textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #b7c9a5;
    border-radius: 8px;
    padding: .72rem;
    background: #fff;
    font: inherit;
}

.hp-offline-toolbar,
.hp-offline-actions,
.hp-sync-actions {
    display: flex;
    gap: .65rem;
    flex-wrap: wrap;
}

.hp-sync-details {
    padding: 0;
}

.hp-sync-details > summary {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: .9rem 1rem;
    cursor: pointer;
    list-style: none;
    font-weight: 800;
}

.hp-sync-details > summary::-webkit-details-marker {
    display: none;
}

.hp-sync-details .hp-sync-status-card {
    margin: 0;
    border-width: 1px 0 0;
    border-radius: 0 0 8px 8px;
}

.hp-sync-inline-counts {
    display: inline-flex;
    gap: .35rem;
    align-items: center;
    color: #5d684f;
    font-weight: 600;
    font-size: .92rem;
}

.hp-sync-inline-counts strong {
    color: #18230f;
}

.hp-sync-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .65rem;
    margin-bottom: .85rem;
}

.hp-sync-summary > div {
    border: 1px solid #d8e5c8;
    border-radius: 8px;
    padding: .8rem;
    text-align: center;
    background: #fbfdf8;
}

.hp-sync-summary strong {
    display: block;
    font-size: 1.6rem;
    line-height: 1;
}

.hp-sync-summary span {
    color: #5d684f;
}

.hp-sync-item {
    border: 1px solid #d8e5c8;
    border-radius: 8px;
    padding: .85rem 1rem;
    margin: .75rem 0;
}

.hp-sync-item > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.hp-sync-item span {
    display: block;
    color: #5d684f;
    font-size: .9rem;
}

.hp-sync-item.status-failed {
    border-color: #edb4a9;
    background: #fff7f5;
}

.hp-sync-item.status-done {
    opacity: .72;
}

.hp-sync-item-actions {
    display: flex;
    gap: .5rem;
    margin-top: .7rem;
}

.hp-sync-item-actions button {
    border: 1px solid #b7c9a5;
    border-radius: 8px;
    padding: .45rem .65rem;
    background: #fff;
}

.hp-pwa-toast {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 9999;
    max-width: 720px;
    margin: auto;
    border-radius: 8px;
    padding: .85rem 1rem;
    background: #18230f;
    color: #fff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .22);
}

.hp-offline-inline {
    border-radius: 8px;
    padding: .75rem 1rem;
    margin: .75rem 0;
}

.hp-offline-inline.success {
    background: #edf8e7;
    border: 1px solid #9bd18a;
}

.hp-offline-inline.danger {
    background: #fff7f5;
    border: 1px solid #edb4a9;
}

.hp-pwa-install-hint[hidden] {
    display: none !important;
}

@media (max-width: 760px) {
    .hp-offline-body {
        padding: .75rem;
    }

    .hp-offline-hero-quiet,
    .hp-offline-app-head,
    .hp-sync-status-head,
    .hp-sync-details > summary,
    .hp-sync-item > div:first-child {
        display: grid;
    }

    .hp-offline-action-grid,
    .hp-sync-summary {
        grid-template-columns: 1fr;
    }

    .hp-btn {
        width: 100%;
    }
}
