.dispatch-tabs, .dispatch-actions, [data-dispatch-pager] {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.dispatch-tabs button, .dispatch-actions > *, .dispatch-card button { min-height: 44px; }
.dispatch-tabs button[aria-pressed="true"] { background: #ad0614; color: #fff; }
.dispatch-tabs button[aria-pressed="false"] { background: #fff1f2; color: #8c101c; }
.dispatch-page { max-width: 850px; padding-top: 16px; padding-bottom: 24px; }
.dispatch-page h1 { margin-block: 14px; }
.dispatch-card { padding: clamp(16px, 3vw, 24px); overflow-wrap: anywhere; }
.dispatch-card h2, .dispatch-card p { margin: 0 0 12px; }
.dispatch-card button { max-width: 100%; }
.dispatch-card button:disabled { opacity: .55; }
.dispatch-card .dispatch-primary { min-width: min(100%, 220px); margin-bottom: 12px; }
.dispatch-open { margin-bottom: 6px; }
.dispatch-state { font-weight: 700; }
.dispatch-card dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: 12px 18px;
  margin: 0 0 14px;
}
.dispatch-card dt { font-size: .9rem; opacity: .85; }
.dispatch-card dd { margin: 4px 0 0; font-weight: 650; }
.dispatch-actions > a {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--membership-border);
  border-radius: 9px;
  color: var(--membership-accent);
}
.dispatch-history { list-style: none; padding: 0; }
.dispatch-history li { padding-block: 12px; border-bottom: 1px solid var(--membership-border); }
.dispatch-history strong { display: block; margin-bottom: 6px; }
[data-dispatch-feedback]:empty { display: none; }
.dispatch-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 12px;
}
.dispatch-admin-grid article { min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: 10px; overflow-wrap: anywhere; }
.dispatch-admin-grid h3 { margin: 0 0 8px; font-size: 1rem; }
.dispatch-admin-grid p { margin: 0 0 8px; }
.dispatch-admin-grid + [data-dispatch-pager] { margin-top: 12px; }
[data-dispatch-kitchen] label { max-width: 560px; }

.receipt-delivery-panel {
  margin: 12px auto 16px;
  max-width: 640px;
  padding: 14px;
  border: 1px solid #c97880;
  border-radius: 12px;
  color: #381217;
  background: #fffafa;
}
html[data-theme="dark"] .receipt-delivery-panel { color: #fff0f1; background: #211b1f; }
.receipt-delivery-panel h3 { margin: 0 0 10px; font-size: 1rem; }
.receipt-delivery-panel button { margin: 0 8px 8px 0; min-height: 44px; max-width: 100%; }
.receipt-delivery-panel label { display: block; font-weight: 600; }
.receipt-delivery-panel textarea {
  display: block;
  width: 100%;
  margin: 6px 0 10px;
  min-height: 72px;
  padding: 8px;
  font: inherit;
  background: inherit;
  color: inherit;
  border: 1px solid #c97880;
  border-radius: 8px;
}
.receipt-delivery-panel [role="status"]:empty { display: none; }

.dispatch-portal { margin: 0; font: 16px/1.45 system-ui, sans-serif; background: #fbf6f6; color: #281b1d; }
.dispatch-portal *, .dispatch-portal *::before, .dispatch-portal *::after { box-sizing: border-box; }
.dispatch-portal [hidden] { display: none !important; }
.portal-header { display: flex; align-items: center; gap: 12px; background: #a20714; color: white; padding: 10px max(16px, calc((100vw - 1120px) / 2)); }
.portal-header img { object-fit: contain; }
.portal-header strong { flex: 1; }
.dispatch-portal button, .portal-signin {
  min-height: 44px; padding: 8px 13px; border: 0; border-radius: 8px;
  background: #fae9eb; color: #7d101a; font: 650 1rem system-ui, sans-serif; cursor: pointer;
}
.dispatch-portal button.primary, .dispatch-portal button[aria-pressed="true"], .portal-signin { background: #ad0614; color: white; }
.portal-signin { display: inline-flex; align-items: center; text-decoration: none; }
.portal-main { max-width: 1160px; margin: 0 auto; padding: clamp(14px, 3vw, 32px) 14px; }
.portal-main .rider-page, .portal-main .dispatch-page { max-width: none; padding-top: 0; }
.portal-main h1 { margin-top: 0; font-size: clamp(1.65rem, 4vw, 2.25rem); }
.portal-main [data-portal-application] { float: right; margin-left: 8px; }
.portal-application-layout { display: grid; gap: 16px; align-items: start; }
.portal-application-layout .rider-verification, .portal-application-layout .rider-verification > h2 { margin-top: 0; }
.portal-application-layout .rider-submitted dl { grid-template-columns: 1fr; }
.portal-available-order { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-block: 10px; border-bottom: 1px solid #ead2d5; }
.portal-available-order .dispatch-primary { margin: 0; }
.dispatch-directory-layout { display: grid; gap: 12px; align-items: start; }
[data-dispatch-reviews] summary { cursor: pointer; font-weight: 700; }
[data-dispatch-reviews] form { margin-top: 12px; }
@media (min-width: 880px) {
  .portal-application-layout { grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr); }
  .dispatch-directory-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .dispatch-directory-layout .dispatch-admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .portal-main [data-portal-application] { float: none; margin: 0 0 10px; }
}

.portal-main .portal-application-layout {
  width: min(100%, 700px);
  grid-template-columns: minmax(0, 1fr);
}
.portal-main .portal-application-layout .rider-submitted dl,
.rider-application-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 245px), 1fr));
  gap: 14px;
}
.dispatch-portal .rider-form {
  width: min(100%, 760px);
  grid-template-columns: minmax(0, 1fr);
}
.dispatch-portal .rider-form fieldset {
  min-width: 0;
  margin: 0;
  padding: 0 0 20px;
  border: 0;
  border-bottom: 1px solid #ead2d5;
}
.dispatch-portal .rider-form legend { margin-bottom: 10px; padding: 0; font-weight: 700; }
.dispatch-portal .rider-form p { margin: 0 0 10px; }
.dispatch-portal .rider-form [data-rider-submit-status]:empty { display: none; }
.dispatch-portal .rider-form .rider-step-consent {
  grid-column: 1 / -1;
  grid-template-columns: auto 1fr;
  align-items: start;
  font-weight: 500;
}
.dispatch-portal .rider-step-consent input { width: 1rem; margin: .2em 0 0; accent-color: #ad0614; }

.dispatch-portal .rider-bank-form h2 { margin: 0; }
.dispatch-portal .rider-bank-form [data-rider-bank-status]:empty { display: none; }
.dispatch-portal [data-rider-message] { overflow-wrap: anywhere; }
[popovertarget="notifications"][data-rider-review-unread] { position: relative; }
[popovertarget="notifications"][data-rider-review-unread]::after {
  content: '';
  position: absolute;
  inset: 6px 6px auto auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffd867;
  box-shadow: 0 0 0 2px #a20714;
}
[data-rider-approval-notification] { overflow-wrap: anywhere; }


/* Rider dashboard */
.dispatch-dashboard-open {
  --dispatch-red: #b80720;
  --dispatch-red-strong: #950515;
  --dispatch-ink: #1a1723;
  --dispatch-muted: #5f555e;
  --dispatch-surface: #fff;
  --dispatch-tint: #fff0f2;
  --dispatch-line: #f1e3e7;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(155deg, #fff 24%, #fcf2f5 100%);
  color: var(--dispatch-ink);
}
.dispatch-dashboard-open .portal-header {
  min-height: 64px;
  background: linear-gradient(115deg, #960416, #c40729 65%, #a3051a);
}
.dispatch-dashboard-open .portal-header > button {
  background: #fff1f4;
  color: var(--dispatch-red-strong);
}
.dispatch-dashboard-open .portal-main { width: 100%; flex: 1; }
.dispatch-dashboard-open .dispatch-page { color: var(--dispatch-ink); }
.dispatch-dashboard-heading {
  display: flex;
  align-items: center;
  gap: clamp(12px, 4vw, 20px);
  margin: 0 0 22px;
}
.dispatch-dashboard-heading h1 { margin: 0 0 4px; font-weight: 800; letter-spacing: -.04em; }
.dispatch-dashboard-heading h1:focus { outline: none; }
.dispatch-dashboard-heading p { margin: 0; color: var(--dispatch-muted); }
.dispatch-heading-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  color: var(--dispatch-red-strong);
  background: var(--dispatch-tint);
  border-radius: 18px;
}
.dispatch-page .dispatch-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  margin: 0 0 18px;
  background: var(--dispatch-surface);
  border: 1px solid var(--dispatch-line);
  border-radius: 19px;
  box-shadow: 0 6px 18px #75132610;
}
.dispatch-page .dispatch-tabs button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding-inline: 6px;
  border-radius: 13px;
  background: var(--dispatch-tint);
  color: var(--dispatch-red-strong);
}
.dispatch-page .dispatch-tabs button[aria-pressed="true"],
.dispatch-page .dispatch-customer-switch {
  background: linear-gradient(135deg, #c80829, #990817);
  color: #fff;
}
.dispatch-page [data-dispatch-feedback]:not(:empty) {
  margin: 10px 0;
  color: var(--dispatch-muted);
  font-size: .92rem;
}
.dispatch-page [data-dispatch-content] { display: grid; gap: 13px; }
.dispatch-page .dispatch-card {
  margin: 0;
  border: 1px solid var(--dispatch-line);
  border-radius: 20px;
  background: var(--dispatch-surface);
  box-shadow: 0 7px 18px #7513260d;
  color: var(--dispatch-ink);
}
.dispatch-page .rider-application-status { margin-top: 16px; }
.dispatch-page .dispatch-device-settings { margin-bottom: 13px; }
.dispatch-profile-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dispatch-device-settings [data-push-status] { margin: 10px 0 0; color: var(--dispatch-muted, #5f555e); }
.dispatch-device-settings [data-push-status]:empty { display: none; }
.dispatch-card-heading { display: flex; gap: 13px; align-items: center; margin-bottom: 6px; }
.dispatch-card-heading h2 { margin: 0 0 3px; font-weight: 780; letter-spacing: -.025em; }
.dispatch-card-heading p { margin: 0; color: var(--dispatch-muted); }
.dispatch-card-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--dispatch-tint);
  color: var(--dispatch-red-strong);
}
.rider-notification-inbox .dispatch-card-icon {
  background: linear-gradient(135deg, #d40a2e, #a0061a);
  box-shadow: 0 3px 8px #a8062140;
  color: #fff;
}
.dispatch-icon, .dispatch-card-icon::before, .dispatch-heading-icon::before {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  background: currentColor;
  mask: var(--dispatch-icon-shape) center / contain no-repeat;
}
.dispatch-card-icon::before { content: ''; width: 24px; height: 24px; }
.dispatch-heading-icon::before { content: ''; width: 30px; height: 30px; }
.dispatch-icon-rider {
  --dispatch-icon-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='5' cy='17' r='3'/%3E%3Ccircle cx='19' cy='17' r='3'/%3E%3Cpath d='M7 17h7l3-9h3m-4 3h-5l-3 6m-5-5h5l2-2M17 5h2'/%3E%3C/svg%3E");
}
.dispatch-icon-package {
  --dispatch-icon-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='m12 2 9 5v10l-9 5-9-5V7zm-9 5 9 5 9-5m-9 5v10'/%3E%3C/svg%3E");
}
.dispatch-icon-history {
  --dispatch-icon-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4v6h6m-5 0a8 8 0 1 1 1 8m7-10v5l3 2'/%3E%3C/svg%3E");
}
.dispatch-icon-profile {
  --dispatch-icon-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3Cpath d='M3 22v-2a9 7 0 0 1 18 0v2Z'/%3E%3C/svg%3E");
}
.dispatch-icon-bell {
  --dispatch-icon-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 8a6 6 0 0 0-12 0c0 7-3 7-3 9h18c0-2-3-2-3-9m-8 12a2 2 0 0 0 4 0'/%3E%3C/svg%3E");
}
.dispatch-availability-card .dispatch-state {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--dispatch-tint);
  color: var(--dispatch-red-strong);
}
.dispatch-availability-card .dispatch-state::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
}
.dispatch-availability-card .dispatch-state[data-state="online"] { background: #e6f7e7; color: #166339; }
.dispatch-availability-card .dispatch-state[data-state="busy"] { background: #fff4df; color: #875a16; }
.dispatch-availability-card button { margin: 10px 0 0; }
.dispatch-today {
  display: grid;
  grid-template-columns: .8fr 1.2fr 1fr;
  align-items: center;
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid var(--dispatch-line);
  font-size: .86rem;
}
.dispatch-today > strong { color: var(--dispatch-red-strong); }
.dispatch-today > span { display: grid; padding-inline: 10px 4px; border-inline-start: 1px solid var(--dispatch-line); }
.dispatch-today > span > strong { font-size: 1rem; }
.dispatch-today > span > span { color: var(--dispatch-muted); line-height: 1.2; }
.rider-notification-entry { margin: 9px 0; padding-block: 8px; border-top: 1px solid var(--dispatch-line); }
.rider-notification-entry p { margin: 4px 0; }
.rider-notification-entry time { color: var(--dispatch-muted); font-size: .85rem; }

html[data-theme="dark"] .dispatch-dashboard-open {
  --dispatch-red-strong: #ffacb7;
  --dispatch-ink: #fff3f6;
  --dispatch-muted: #dfc9d0;
  --dispatch-surface: #2b2229;
  --dispatch-tint: #432933;
  --dispatch-line: #4f3842;
  background: #211920;
}
html[data-theme="dark"] .dispatch-dashboard-open .portal-header > button { color: #950515; }
@media (max-width: 620px) {
  .dispatch-dashboard-open .portal-header {
    min-height: 74px;
    border-radius: 0 0 48% 8%;
    box-shadow: 0 8px 0 #eea7b6;
  }
  .dispatch-dashboard-open .portal-main { padding-top: 24px; }
  .dispatch-dashboard-heading { margin-bottom: 15px; }
  .dispatch-dashboard-heading p { font-size: .92rem; }
  .dispatch-heading-icon { width: 48px; height: 48px; border-radius: 14px; }
  .dispatch-page .dispatch-tabs button { font-size: clamp(.79rem, 3.6vw, 1rem); }
  .dispatch-dashboard-open::after {
    content: '';
    display: block;
    min-height: 32px;
    border-radius: 64% 12% 0 0;
    background: linear-gradient(100deg, #ac061a, #c9092b);
    box-shadow: 0 -6px 0 #f0aebc;
  }
}

/* Customer-side, private delivery confirmation code */
.receipt-delivery-panel .delivery-otp-confirmation {
  display: grid;
  gap: .75rem;
  margin-block: 1rem;
  padding: 1rem;
  border: 1px solid var(--border, #dedede);
  border-radius: 1rem;
}
.receipt-delivery-panel .delivery-otp-confirmation label {
  display: grid;
  gap: .4rem;
  font-weight: 600;
}
.receipt-delivery-panel .delivery-otp-confirmation input {
  width: 100%;
  min-height: 3rem;
  padding: .7rem;
  border: 1px solid var(--border, #dedede);
  border-radius: .65rem;
  font: inherit;
  letter-spacing: .2em;
}
.receipt-delivery-panel .delivery-otp-code {
  display: inline-block;
  width: fit-content;
  padding: .6rem 1rem;
  border-radius: .65rem;
  background: #f3f3f3;
  color: var(--customer-on-light, #8b1320);
  font-size: 1.5rem;
  letter-spacing: .25em;
}

/* Header delivery notifications, independent of the active dashboard tab. */
.dispatch-header-inbox { position: relative; flex: 0 0 auto; }
.dispatch-header-inbox[hidden], .dispatch-notification-panel[hidden], .dispatch-unread-badge[hidden] { display: none !important; }
.portal-header .dispatch-bell {
  position: relative; display: grid; place-items: center; width: 44px; height: 44px;
  padding: 0; border: 1px solid #ffffff55; border-radius: 13px; background: #ffffff20; color: #fff;
}
.dispatch-bell .dispatch-icon { width: 23px; height: 23px; }
.dispatch-unread-badge {
  position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 4px;
  display: grid; place-items: center; background: #fff; color: #a20714; border: 1px solid #a20714;
  border-radius: 999px; font-size: .72rem; font-weight: 800;
}
.dispatch-notification-panel {
  position: absolute; z-index: 100; right: 0; top: calc(100% + 10px);
  width: min(360px, calc(100vw - 32px)); max-height: min(65dvh, 520px); overflow-y: auto;
  box-sizing: border-box; padding: 16px; border: 1px solid var(--dispatch-line); border-radius: 16px;
  background: var(--dispatch-surface); color: var(--dispatch-ink); box-shadow: 0 12px 36px #0003;
  overflow-wrap: anywhere;
}
.dispatch-notification-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dispatch-notification-heading h2 { font-size: 1.1rem; margin: 0; }
.dispatch-notification-heading button { min-width: 44px; min-height: 44px; padding: 0; background: var(--dispatch-tint); color: var(--dispatch-ink); border-radius: 10px; font-size: 1.4rem; }
.dispatch-notification-panel .rider-notification-entry h3 { font-size: .95rem; margin: 0; }
.dispatch-notification-panel .rider-notification-entry[data-unread="true"] { border-inline-start: 3px solid var(--dispatch-red-strong); padding-inline-start: 10px; }
.dispatch-notification-panel .rider-notification-entry p { font-size: .9rem; }
.dispatch-notification-panel [data-dispatch-notification-status]:empty { display: none; }
.dispatch-notification-panel .dispatch-primary { width: 100%; min-height: 44px; }
.dispatch-dashboard-open .portal-header > strong { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .dispatch-dashboard-open .portal-header { gap: 8px; }
  .dispatch-dashboard-open .portal-header > strong { font-size: .9rem; }
  .dispatch-dashboard-open .portal-header > button { flex-shrink: 0; padding-inline: 10px; }
}

.dispatch-delivery-verification { display:grid; gap:12px; margin-top:16px; padding:16px; border:1px solid var(--dispatch-line); border-radius:14px; }
.dispatch-delivery-verification label { display:grid; gap:6px; font-weight:650; }
.dispatch-delivery-verification input { box-sizing:border-box; width:100%; min-height:48px; padding:10px; font:inherit; font-size:1.3rem; letter-spacing:.25em; border:1px solid var(--dispatch-line); border-radius:10px; background:var(--dispatch-surface); color:var(--dispatch-ink); }
.dispatch-delivery-verification .dispatch-primary { width:100%; margin:0; }
