/* Original tables return for print; only new presentation controls are omitted. */
@media screen {
html[data-ios-pwa] .ios-pwa-row-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px 12px;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

html[data-ios-pwa] .ios-pwa-view-options {
    display: flex;
    gap: 4px;
}

html[data-ios-pwa] .ios-pwa-view-button {
    min-height: 44px;
    min-width: 64px;
    padding: 8px 12px;
    border: 1px solid var(--border-control);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
}

html[data-ios-pwa] .ios-pwa-view-button[aria-pressed="true"] {
    border-color: var(--primary-text);
    box-shadow: inset 0 0 0 1px var(--primary-text);
    font-weight: 600;
}

html[data-ios-pwa] .ios-pwa-view-button:focus-visible,
html[data-ios-pwa] .ios-pwa-help-toggle:focus-visible {
    outline: 2px solid var(--primary-text);
    outline-offset: 2px;
}

html[data-ios-pwa] .ios-pwa-column-help {
    flex: 1 1 145px;
    min-width: 0;
}

html[data-ios-pwa] .ios-pwa-column-help[open] {
    flex-basis: 100%;
}

html[data-ios-pwa] .ios-pwa-column-help[hidden] {
    display: none;
}

html[data-ios-pwa] .ios-pwa-columns {
    flex: 1 1 145px;
    min-width: 0;
    max-width: 100%;
}

html[data-ios-pwa] .ios-pwa-columns[open] {
    flex-basis: 100%;
}

html[data-ios-pwa] .ios-pwa-columns-panel {
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    overflow-wrap: anywhere;
}

html[data-ios-pwa] .ios-pwa-columns-options {
    margin: 0 0 8px;
    padding: 0;
    min-width: 0;
    border: 0;
}

html[data-ios-pwa] .ios-pwa-columns-legend {
    padding: 0;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-primary);
}

html[data-ios-pwa] .ios-pwa-column-option {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 6px 0;
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.5;
    white-space: normal;
    cursor: pointer;
}

html[data-ios-pwa] .ios-pwa-column-checkbox {
    width: 20px;
    height: 20px;
    margin: 0;
    flex-shrink: 0;
    accent-color: var(--primary-text);
}

html[data-ios-pwa] .ios-pwa-column-checkbox:focus-visible {
    outline: 2px solid var(--primary-text);
    outline-offset: 3px;
}

html[data-ios-pwa] .ios-pwa-column-caption {
    flex: 1 1 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

html[data-ios-pwa] .ios-pwa-column-required {
    color: var(--text-secondary);
    font-size: 12px;
}

html[data-ios-pwa] .ios-pwa-columns-status,
html[data-ios-pwa] .ios-pwa-columns-note {
    margin: 8px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

html[data-ios-pwa] .ios-pwa-help-toggle {
    min-height: 44px;
    padding: 10px 8px;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 24px;
    cursor: pointer;
    white-space: normal;
    overflow-wrap: anywhere;
}

html[data-ios-pwa] .ios-pwa-help-definitions {
    margin: 0;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: 14px;
    line-height: 1.6;
}

html[data-ios-pwa] .ios-pwa-help-label {
    color: var(--text-primary);
    font-weight: 600;
}

html[data-ios-pwa] .ios-pwa-help-text {
    margin: 2px 0 12px;
    color: var(--text-secondary);
}

html[data-ios-pwa] .ios-pwa-help-text:last-child {
    margin-bottom: 0;
}

html[data-ios-pwa] .ios-pwa-cell-label,
html[data-ios-pwa] .ios-pwa-sub-label {
    display: none;
}

html[data-ios-pwa] .ios-pwa-card-table {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

/* Keep the real headers in the accessibility tree and associated with their cells. */
html[data-ios-pwa] .ios-pwa-card-table > thead {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

html[data-ios-pwa] .ios-pwa-card-table > tbody {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
    width: 100%;
    box-sizing: border-box;
}

html[data-ios-pwa] .ios-pwa-card-table .ios-pwa-card-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    min-width: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    overflow: visible;
}

html[data-ios-pwa] .ios-pwa-card-table .ios-pwa-card-row > td {
    display: block;
    position: static;
    inset: auto;
    width: auto;
    min-width: 0;
    max-width: none;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid var(--border-color);
    box-shadow: none;
    background: transparent;
    text-align: start;
    white-space: normal;
    overflow: visible;
    overflow-wrap: anywhere;
}

html[data-ios-pwa] .ios-pwa-card-table .ios-pwa-card-row > td:last-child {
    border-bottom: 0;
}

html[data-ios-pwa] .ios-pwa-card-table .ios-pwa-card-row > td.amount {
    overflow-wrap: normal;
    word-break: normal;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

html[data-ios-pwa] .ios-pwa-card-table .ios-pwa-cell-label {
    display: block;
    margin-bottom: 4px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    white-space: normal;
}

html[data-ios-pwa] .ios-pwa-card-table .ios-pwa-sub-label {
    display: inline;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    white-space: normal;
}

html[data-ios-pwa] .ios-pwa-card-table .sale-what {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
}

html[data-ios-pwa] .ios-pwa-card-table .sale-plan,
html[data-ios-pwa] .ios-pwa-card-table .sale-who > small.mono,
html[data-ios-pwa] .ios-pwa-card-table td > code,
html[data-ios-pwa] .ios-pwa-card-table bdi,
html[data-ios-pwa] .ios-pwa-card-table .personal-description-text {
    max-width: 100%;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
}

html[data-ios-pwa] .ios-pwa-card-table .personal-description-text {
    display: block;
    -webkit-line-clamp: unset;
}

html[data-ios-pwa] .ios-pwa-card-table .amount small,
html[data-ios-pwa] .ios-pwa-card-table .uninet-two-line small,
html[data-ios-pwa] .ios-pwa-card-table #other-sales-tbody .amount small,
html[data-ios-pwa] .ios-pwa-card-table #uninet-tbody .amount small,
html[data-ios-pwa] .ios-pwa-card-table #uninet-tbody .uninet-two-line small {
    width: auto;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}

html[data-ios-pwa] .ios-pwa-card-table #uninet-tbody .ios-pwa-sub-label {
    display: inline;
}

html[data-ios-pwa] .ios-pwa-card-table .sale-actions .btn,
html[data-ios-pwa] .ios-pwa-card-table .col-actions .btn {
    margin: 0 6px 6px 0;
}

html[data-ios-pwa] .ios-pwa-row-help {
    display: block;
    width: 100%;
    min-width: 0;
    margin-top: 8px;
    text-align: start;
}

html[data-ios-pwa] .ios-pwa-details-table:not(.ios-pwa-card-table) .ios-pwa-row-help .ios-pwa-help-definitions {
    max-width: 280px;
}

/* The original totals are a table, never a second set of sale cards. */
html[data-ios-pwa] .ios-pwa-card-table > tfoot {
    display: table;
    width: 100%;
}

/* Cards keep every real header accessible; Table also restores the original body columns. */
html[data-ios-pwa] .customers-table > thead > tr > th:nth-child(2),
html[data-ios-pwa] .customers-table > thead > tr > th:nth-child(4),
html[data-ios-pwa] .customers-table:not(.ios-pwa-card-table) > tbody > tr > td:nth-child(2),
html[data-ios-pwa] .customers-table:not(.ios-pwa-card-table) > tbody > tr > td:nth-child(4) {
    display: table-cell;
}

/* More specific than both card-cell display and the Customers table restoration above. */
html[data-ios-pwa] .ios-pwa-columns-table.ios-pwa-details-table > thead > tr > th[data-ios-pwa-column-hidden="true"],
html[data-ios-pwa] .ios-pwa-columns-table.ios-pwa-details-table > tbody > tr > td[data-ios-pwa-column-hidden="true"] {
    display: none;
}
}

@media print {
html[data-ios-pwa] .ios-pwa-ux {
    display: none;
}

/* The shared width-only phone rule also matches narrow print; paper includes MAC and Email. */
html[data-ios-pwa] .customers-table > thead > tr > th:nth-child(2),
html[data-ios-pwa] .customers-table > thead > tr > th:nth-child(4),
html[data-ios-pwa] .customers-table > tbody > tr > td:nth-child(2),
html[data-ios-pwa] .customers-table > tbody > tr > td:nth-child(4) {
    display: table-cell;
}
}
