.delivery-page {
    display: grid;
    gap: 14px;
    min-width: 0;
}
.delivery-page > * { min-width: 0; }
.delivery-panel { overflow: hidden; }
.delivery-panel-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 12px;
    padding: 13px 15px;
}
.delivery-panel-header h2,
.delivery-balance h2 { font-size: 16px; font-weight: 670; }
.delivery-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.delivery-panel > .delivery-controls {
    padding: 0 15px 12px;
}
.delivery-controls .button[aria-pressed="true"] {
    color: #694f00;
    border-color: #d5b54c;
    background: var(--ops-yellow-soft);
    font-weight: 650;
}
.delivery-panel .table-scroll { border-top: 1px solid var(--ops-line); }
.delivery-panel .button { min-height: 32px; }
.delivery-muted {
    display: block;
    margin-top: 2px;
    color: var(--ops-muted);
}
.delivery-panel .delivery-wrap-cell {
    min-width: 130px;
    max-width: 220px;
    white-space: normal;
    overflow-wrap: anywhere;
}
.delivery-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    color: #344b69;
    background: #eaf0f7;
    font-size: 12px;
    font-weight: 620;
}
.delivery-status:is([data-status="awaiting_fee"], [data-status="available"], [data-status="pending"], [data-status="delivered"]) {
    color: #6f5300;
    background: var(--ops-yellow-soft);
}
.delivery-status:is([data-status="completed"], [data-status="paid"]) {
    color: #176044;
    background: #e5f3ea;
}
.delivery-status:is([data-status="cancelled"], [data-status="rejected"]) {
    color: #763938;
    background: #faeded;
}
.delivery-note,
.delivery-error {
    padding: 10px 13px;
    border-radius: var(--ops-radius);
    line-height: 1.6;
    overflow-wrap: anywhere;
}
.delivery-note {
    color: var(--ops-muted);
    background: #f6f7fa;
}
.delivery-note a {
    color: #255896;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.delivery-error {
    margin-bottom: 12px;
    color: var(--ops-danger);
    background: #faeded;
}
.delivery-policy { display: grid; gap: 13px; padding: 0 15px 15px; }
.delivery-policy-intro {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 10px 14px;
}
.delivery-policy-intro > .field { align-content: center; }
.delivery-tiers {
    flex: 1 1 270px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 1px solid var(--ops-line);
    border-radius: var(--ops-radius);
    background: #fafbfc;
}
.delivery-tiers div { padding: 8px 12px; }
.delivery-tiers div + div { border-left: 1px solid var(--ops-line); }
.delivery-tiers strong,
.delivery-balance-overview strong {
    display: block;
    color: var(--ops-ink);
    font-size: 21px;
    font-variant-numeric: tabular-nums;
}
.delivery-tiers span,
.delivery-balance small { color: var(--ops-muted); font-size: 12px; }
.delivery-policy .table-scroll { border: 1px solid var(--ops-line); border-radius: var(--ops-radius); }
.delivery-policy .data-table tbody th { background: transparent; }
.delivery-policy .data-table tbody tr:last-child > * { border-bottom: 0; }
.delivery-rate,
.delivery-check {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.delivery-rate .control { width: 98px; }
.delivery-check input { accent-color: #886800; }
.delivery-policy-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}
.delivery-balance { overflow: hidden; }
.delivery-balance-overview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 16px;
    background: var(--ops-yellow-soft);
    border-bottom: 1px solid #f0e3ba;
}
.delivery-balance-overview p { margin-bottom: 5px; color: #624b13; }
.delivery-balance-overview strong {
    font-size: clamp(24px, 5vw, 30px);
    overflow-wrap: anywhere;
}
.delivery-balance-overview small { display: block; margin-top: 5px; text-align: center; }
.delivery-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
    padding: 13px 16px;
}
.delivery-metrics dt,
.delivery-detail dt { color: var(--ops-muted); font-size: 13px; }
.delivery-metrics dd,
.delivery-detail dd {
    margin: 1px 0 0;
    font-weight: 610;
    overflow-wrap: anywhere;
}
.delivery-balance > .delivery-note { border-radius: 0; }
.delivery-dialog-body {
    display: grid;
    gap: 10px;
    padding: 14px 15px;
}
.delivery-detail {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}
.delivery-myt-panel .delivery-myt-body {
    padding: 0 15px 15px;
}
.delivery-myt-body > .delivery-note {
    margin-bottom: 13px;
}
.delivery-myt-note {
    border-inline-start: 3px solid #1d7c70;
}
.delivery-myt-note a {
    display: inline-block;
    margin-inline-start: 4px;
}
.delivery-myt-form {
    display: grid;
    gap: 13px;
}
.delivery-myt-form > :is(.field, .delivery-myt-fields) {
    max-width: 740px;
}
.delivery-myt-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
}
.delivery-myt-fields .field,
.delivery-myt-provinces {
    min-width: 0;
}
.delivery-myt-form textarea {
    min-height: 108px;
    resize: vertical;
}
.delivery-myt-radios,
.delivery-myt-provinces {
    margin: 0;
    padding: 8px 12px 11px;
    border: 1px solid var(--ops-line);
    border-radius: var(--ops-radius);
}
.delivery-myt-radios {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    justify-self: start;
}
.delivery-myt-radios legend,
.delivery-myt-provinces legend {
    padding-inline: 5px;
    color: var(--ops-ink);
    font-weight: 600;
}
.delivery-myt-provinces > div {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 135px), 1fr));
    gap: 7px 12px;
    margin-top: 7px;
}
.delivery-myt-actions,
.delivery-myt-toolbar,
.delivery-myt-image {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
}
.delivery-myt-toolbar {
    justify-content: space-between;
}
.delivery-myt-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}
.delivery-myt-filter .control { width: auto; }
.delivery-myt-balance {
    display: grid;
    gap: 7px;
}
.delivery-myt-balance strong {
    display: block;
    font-size: 20px;
    font-variant-numeric: tabular-nums;
}
.delivery-myt-image img {
    object-fit: contain;
    border: 1px solid var(--ops-line);
    border-radius: 4px;
    background: #f7f8fa;
}
.delivery-status:is([data-status="awaiting_registration"], [data-status="delivering"]) {
    color: #6f5300;
    background: var(--ops-yellow-soft);
}
@media (max-width: 560px) {
    .delivery-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .delivery-policy-intro > .field { flex: 1 1 100%; }
    .delivery-panel-header,
    .delivery-policy,
    .delivery-panel > .delivery-controls { padding-inline: 10px; }
    .delivery-agent-panel .data-table { table-layout: fixed; }
    .delivery-agent-panel .data-table :is(th, td) {
        min-width: 0;
        padding: 8px 6px;
        white-space: normal;
        overflow-wrap: anywhere;
    }
    .delivery-agent-panel th:nth-child(1) { width: 35%; }
    .delivery-agent-panel th:nth-child(2) { width: 23%; }
    .delivery-agent-panel th:nth-child(3) { width: 24%; }
    .delivery-agent-panel th:nth-child(4) { width: 18%; }
    .delivery-agent-panel .button { padding-inline: 6px; white-space: nowrap; }
    .delivery-agent-panel .delivery-status { padding-inline: 4px; }
    .delivery-myt-panel .delivery-myt-body { padding-inline: 10px; }
    .delivery-myt-fields { grid-template-columns: minmax(0, 1fr); }
}
.delivery-intake-settings {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr);
    gap: 24px;
    align-items: start;
    padding: 0 15px 15px;
}
.delivery-intake-qr {
    display: grid;
    justify-items: start;
    gap: 12px;
}
.delivery-intake-qr img,
.delivery-intake-qr-empty {
    margin: 0;
    border: 1px solid var(--line, #e5e7eb);
    border-radius: 8px;
    background: #fff;
}
.delivery-intake-qr img { object-fit: contain; }
.delivery-intake-qr-empty { padding: 24px 16px; }
.delivery-intake-qr .field { width: 100%; min-width: 0; }
@media (max-width: 680px) {
    .delivery-intake-settings { grid-template-columns: minmax(0, 1fr); }
}
