.customer-records-login {
  width: 100%;
  padding: 4px 0;
}

.customer-login-lead {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.customer-login-lead p {
  margin: 0;
  color: var(--work-muted);
  line-height: 1.55;
}

.customer-login-form {
  display: grid;
  gap: 14px;
}

.customer-login-form label {
  display: grid;
  gap: 7px;
}

.customer-login-form label>span:first-child {
  font-size: 12px;
  font-weight: 600;
  color: var(--work-ink);
}

.customer-input-wrap {
  height: 46px;
  padding: 0 13px;
  border: 1px solid var(--work-rule);
  border-radius: var(--control-radius);
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--work-muted);
  background: #fff;
}

.customer-input-wrap:focus-within {
  outline: 2px solid var(--work-action);
  outline-offset: 1px;
}

.customer-input-wrap input {
  min-width: 0;
  width: 100%;
  height: 100%;
  padding: 0 !important;
  border: 0 !important;
  outline: 0;
  background: transparent !important;
  box-shadow: none !important;
}

.customer-input-wrap input:focus-visible {
  outline: none;
}

.customer-records-login .customer-submit {
  min-height: 46px;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: white;
  border-radius: var(--control-radius);
  background: var(--work-action);
}

.customer-auth-note {
  margin: 0;
  color: var(--work-muted);
  font-size: 13px;
  line-height: 1.5;
}

.customer-auth-switch,
.customer-auth-link {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--work-action);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.customer-auth-switch {
  width: 100%;
  margin-top: 10px;
}

.customer-auth-link {
  justify-self: start;
  padding: 0;
}

.customer-auth-link:disabled {
  color: var(--work-muted);
  cursor: default;
}

.customer-orders-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.customer-orders-title h2 {
  margin: 0;
}

/* This static heading receives focus after sign-in so screen readers announce it. */
.customer-orders-focus-target:focus {
  outline: none;
}

.customer-order-list {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr;
}

.customer-order {
  padding: 0;
  border-bottom: 1px solid var(--work-rule);
  background: #fff;
}

.customer-order-top {
  min-height: 68px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  align-items: center;
}

.customer-order-identity {
  display: flex !important;
  align-items: center;
  gap: 11px;
}

.customer-order-identity>div span,.customer-order-identity>div strong {
  display: block;
}

.customer-order dl {
  display: grid;
  margin: 0;
  padding: 16px 18px;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 22px;
}

.customer-order dl div {
  min-width: 0;
}

.customer-order dt {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--work-muted);
}

.customer-order dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  color: var(--work-ink);
}

.customer-order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 57px;
  padding: 10px 18px;
  align-items: center;
}

.customer-order-actions button {
  min-height: 44px;
}

.customer-order-actions .customer-view-order {
  margin-right: auto;
  padding: 8px 4px;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--work-action);
  border: 0;
  font-size: 13px;
  cursor: pointer;
  background: transparent;
}

.customer-order-actions .button-primary {
  border-color: var(--work-action);
  background: var(--work-action);
}

.customer-empty {
  padding: 14px 0;
  color: var(--work-muted);
}

.customer-empty p {
  margin: 0 0 8px;
}

.customer-empty a {
  color: var(--work-action);
  font-weight: 600;
}

.order-detail-content .detail-list {
  padding: 4px;
  border: 1px solid #e2e6ed;
  border-radius: var(--panel-radius);
  background: #f8f9fc;
  gap: 0;
}

.order-detail-content .detail {
  padding: 13px 14px;
  border-bottom: 1px solid #e6e9ef;
}

.order-detail-content .detail:nth-last-child(-n+2) {
  border-bottom: 0;
}

.order-detail-content .detail-link {
  grid-column: 1/-1;
}

.order-detail-link {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--work-action);
  text-decoration: none;
}

.order-detail-link svg {
  flex: 0 0 auto;
}

.order-detail-pay {
  min-height: 44px;
  padding: 0 15px;
  border-radius: var(--control-radius);
  justify-content: center;
  color: #fff;
  background: var(--work-action);
  text-decoration: none;
}

.order-detail-content .timeline {
  padding: 18px 16px;
  border: 1px solid #e2e6ed;
  border-radius: var(--panel-radius);
  background: #fff;
}

.order-detail-content>.action-row {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #e2e6ed;
}

.order-detail-content>.action-row .button-primary {
  background: var(--work-action);
  border-color: var(--work-action);
}

@media (min-width: 980px) {
  .customer-order {
    display: grid;
    grid-template-columns: minmax(185px,1fr) minmax(320px,1.8fr) auto;
    align-items: stretch;
  }
  .customer-order-top {
    flex-wrap: wrap;
    justify-content: flex-start;
    align-content: center;
    min-height: 80px;
    padding: 14px 18px;
  }
  .customer-order dl {
    align-content: center;
    border: 0;
    gap: 12px;
    grid-template-columns: .85fr 1fr 1.35fr;
  }
  .customer-order-actions { justify-content: flex-end; }
}

@media (max-width:600px) {
  .customer-order-top {
    min-height: 44px;
    padding: 6px 0;
  }
  .customer-order dl {
    padding: 0;
    display: block;
  }
  .customer-order dl div {
    padding: 4px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }
  .customer-order dd {
    margin: 0;
    text-align: right;
  }
  .customer-order-actions {
    min-height: 44px;
    padding: 0 0 4px;
  }
  .order-detail-content .detail-list {
    grid-template-columns: 1fr;
  }
  .order-detail-content .detail {
    border-bottom: 1px solid #e6e9ef !important;
  }
  .order-detail-content .detail:last-child {
    border-bottom: 0 !important;
  }
}

.order-detail-page {
  max-width: 52rem;
  margin-inline: auto;
  padding: clamp(16px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  background: var(--surface);
}
.order-detail-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px 14px;
  margin-bottom: 20px;
}
.order-detail-page-head h1 { margin: 0; font-size: clamp(19px, 2.5vw, 26px); overflow-wrap: anywhere; }
.order-detail-page-head .badge { margin-inline-start: auto; }
.order-detail-back svg, .task-page-back svg { transform: rotate(180deg); }
.order-detail-missing { text-align: center; }
.worker-task-page {
  margin-inline: auto;
  background: var(--surface);
  border: 1px solid var(--line);
}
.task-page-back + h1 { flex: 1; min-width: 0; }
@media (max-width: 640px) {
  .order-detail-page { border: 0; border-radius: 0; padding: 12px 0; }
  .app-shell .order-detail-page { padding: 14px; }
}
/* Only the detail body scrolls. The action stays anchored to the sheet. */
.worker-task-modal {
  --task-pad: 22px;
  --task-ink: var(--work-ink);
  --task-muted: var(--work-muted);
  --task-rule: var(--work-rule);
  display: flex;
  flex-direction: column;
  width: min(100%, 510px);
  min-height: 0;
  max-height: min(88dvh, 760px);
  overflow: hidden;
  border-radius: 18px;
}
.task-sheet-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px var(--task-pad);
  border-bottom: 1px solid var(--task-rule);
}
.task-sheet-header h1 {
  margin: 0;
  color: var(--task-ink);
  font-size: 21px;
  line-height: 1.3;
  font-weight: 650;
}
.task-sheet-header .badge { padding: 0; background: transparent; font-size: 12px; font-weight: 550; }
.task-sheet-header .icon-button {
  margin-inline-start: auto;
  width: 44px; height: 44px; flex: 0 0 auto;
  display: grid; place-items: center;
  color: var(--task-ink); border: 0;
}
.task-sheet-header .task-page-back { margin-inline-start: 0; }
.task-sheet-body {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 16px var(--task-pad);
}
.task-clock {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0 15px;
  border-bottom: 1px solid var(--task-rule);
  color: var(--task-ink);
}
.task-clock span {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  color: var(--task-muted);
}
.task-source-heading button, .task-metadata summary {
  display: flex;
  align-items: center;
  gap: 7px;
}
.task-source-heading button svg, .task-metadata summary svg { flex: 0 0 auto; }
.task-clock strong {
  display: block;
  color: #3f339f;
  font-size: 46px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.04em;
  line-height: 1.04;
}
.task-cutoff { text-align: end; }
.task-cutoff time { font-size: 18px; font-variant-numeric: tabular-nums; }
.task-source { margin-top: 9px; }
.task-source-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
}
.task-source-heading h2 { margin: 0; font-size: 15px; line-height: 1.4; }
.task-source-heading button {
  flex-shrink: 0;
  min-height: 44px;
  padding: 5px 4px 5px 10px;
  border: 0;
  background: transparent;
  color: var(--task-action);
  cursor: pointer;
  font-weight: 600;
}
@media (hover: hover) {
  .task-source-heading button:hover { text-decoration: underline; }
}
.task-source-url {
  display: block;
  max-height: 5.5em;
  overflow: auto;
  overflow-wrap: anywhere;
  padding: 10px 12px;
  line-height: 1.4;
  font-size: 14px;
  color: var(--task-ink);
  border-left: 2px solid #d6d0f1;
  background: #f8f9fc;
  user-select: all;
}
.task-source p { margin: 8px 0 0; color: var(--task-muted); font-size: 13px; line-height: 1.5; }
.task-metadata { border-top: 1px solid var(--line); margin-top: 15px; }
.task-metadata summary {
  min-height: 44px;
  padding: 6px 0;
  cursor: pointer;
  list-style: none;
  color: var(--task-ink);
  font-size: 15px;
  font-weight: 600;
}
.task-metadata summary::-webkit-details-marker { display: none; }
.task-metadata summary svg:last-child { margin-inline-start: auto; }
.task-metadata[open] summary svg:last-child { transform: rotate(180deg); }
.task-metadata .order-detail-content > .order-detail-link {
  width: fit-content;
  min-height: 44px;
  font-size: 13px;
  color: var(--task-action);
}
.task-sheet-footer {
  flex: 0 0 auto;
  background: white;
  border-top: 1px solid var(--task-rule);
  padding: 12px var(--task-pad);
}
.task-sheet-footer .button {
  width: 100%;
  min-height: 47px;
  color: white;
  background: var(--task-action);
  font-size: 15px;
  border-radius: var(--control-radius);
}

@media (max-width: 640px), (pointer: coarse) and (orientation: landscape) and (max-height: 540px) {
  body:has(.worker-task-page) { overflow: hidden; }
  .page:has(> .worker-task-page) { padding: 0; }
  .app-shell:has(.worker-task-page) :is(.topbar, .sidebar) { display: none; }
  .app-shell:has(.worker-task-page) { grid-template-columns: minmax(0, 1fr); }
  .worker-task-page { border: 0; }
  .task-sheet-layer {
    display: block;
    padding: 0;
    background: var(--surface);
    backdrop-filter: none;
  }
  .worker-task-modal {
    --task-pad: 20px;
    width: 100%;
    height: 100%;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    box-shadow: none;
  }
  .task-sheet-header {
    padding-top: calc(12px + env(safe-area-inset-top));
    padding-bottom: 12px;
  }
  .task-sheet-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
  }
  .task-sheet-header, .task-sheet-body, .task-sheet-footer {
    padding-left: max(var(--task-pad), env(safe-area-inset-left));
    padding-right: max(var(--task-pad), env(safe-area-inset-right));
  }
  .task-tools { flex: none; }
  .task-facts {
    flex: 1 1 auto;
    min-height: 48px;
    overflow: auto;
    overscroll-behavior: contain;
    margin-top: 14px;
    border-top: 1px solid var(--task-rule);
  }
  .task-metadata { margin: 0; border: 0; }
  .task-metadata summary { position: sticky; top: 0; z-index: 1; background: var(--surface); }
  .task-metadata .detail-list {
    grid-template-columns: 1fr;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  .task-metadata .detail {
    display: grid;
    grid-template-columns: minmax(68px, 29%) minmax(0, 1fr);
    align-items: baseline;
    gap: 8px;
    padding: 11px 0;
  }
  .task-metadata .detail > span { font-size: 13px; color: var(--task-muted); }
  .task-metadata .detail > strong { margin: 0; color: var(--task-ink); font-size: 14px; font-weight: 500; }
  .task-metadata .order-number > strong { font-family: ui-monospace, monospace; font-size: 13px; }
  .task-sheet-footer {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
  body:has(.worker-task-modal) .toast-region {
    top: max(8px, env(safe-area-inset-top));
    bottom: auto;
    pointer-events: none;
  }
}
.daily-report { --daily-accent: var(--work-action); }
.daily-date { display: flex; align-items: flex-end; gap: .55rem; }
.daily-date .field { gap: .3rem; }
.daily-date .input { min-width: 10rem; }
.daily-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: 1px; margin: 0 0 1rem; overflow: hidden; border: 1px solid var(--line); border-radius: .65rem; background: var(--line); }
.daily-counts > div { display: flex; align-items: baseline; gap: .55rem; padding: .7rem 1rem; background: var(--surface, #fff); }
.daily-counts span { color: var(--muted, #687086); font-size: .78rem; }
.daily-counts strong { margin-left: auto; color: var(--ink); font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.daily-report > .panel { margin-bottom: 1rem; }
.daily-report .panel-head { min-height: 3.25rem; }
.daily-report table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.daily-report th, .daily-report td { padding: .68rem 1rem; text-align: start; vertical-align: middle; }
.daily-report thead th { background: var(--work-bg, #f5f6fa); color: var(--muted); font-size: .78rem; font-weight: 650; }
.daily-report tbody tr + tr { border-top: 1px solid var(--line); }
.daily-ledger td, .daily-ledger thead th:not(:first-child) { text-align: end; }
.daily-ledger tbody th { font-weight: 700; }
.daily-ledger td strong, .daily-ledger td small, .daily-details td small { display: block; }
.daily-ledger td small, .daily-details td small, .daily-amount-value small { margin-top: .18rem; color: var(--muted, #687086); font-size: .74rem; }
.daily-ledger .daily-net strong { color: var(--daily-accent); }
.daily-amount { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .72rem 1rem; border-top: 1px solid var(--line, #e1e4ee); }
.daily-amount small { display: block; margin-top: .2rem; color: var(--muted, #687086); }
.daily-amount-value { text-align: end; }
.daily-filter { display: flex; align-items: flex-end; gap: .5rem; }
.daily-filter label { display: grid; gap: .25rem; color: var(--muted, #687086); font-size: .75rem; }
.daily-filter .select { min-width: 9.5rem; }
.daily-details .daily-time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.daily-details td:last-child, .daily-details th:last-child { text-align: end; }
.daily-details a { color: var(--daily-accent); font-weight: 650; text-decoration: none; }
.daily-note { margin: 0; padding: 1rem; color: var(--muted, #687086); }
@media (max-width: 640px) {
  .daily-report .page-head { flex-direction: column; align-items: stretch; gap: .65rem; }
  .daily-report .page-actions, .daily-date { width: 100%; }
  .daily-date .field { flex: 1; }
  .daily-date .input { width: 100%; min-width: 0; }
  .daily-counts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .daily-counts > div { min-width: 0; }
  .daily-report .panel-head { align-items: stretch; flex-direction: column; gap: .6rem; }
  .daily-filter { width: 100%; }
  .daily-filter label { flex: 1; }
  .daily-filter .select { width: 100%; min-width: 0; }
  .daily-ledger th, .daily-ledger td { padding: .6rem .5rem; overflow-wrap: anywhere; }
  .daily-ledger thead th:first-child, .daily-ledger tbody th { display: none; }
  .daily-ledger table { table-layout: fixed; }
  .daily-ledger strong { font-size: .9rem; }
  .daily-details table, .daily-details tbody { display: block; }
  .daily-details thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .daily-details tbody tr {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "event event amount" "time country order";
    align-items: baseline;
    gap: .22rem .7rem;
    padding: .6rem .9rem;
  }
  .daily-details td { padding: 0; }
  .daily-details td:nth-child(1) { grid-area: time; }
  .daily-details td:nth-child(2) { grid-area: event; font-weight: 650; }
  .daily-details td:nth-child(3) { grid-area: country; }
  .daily-details td:nth-child(4) { grid-area: order; text-align: end; }
  .daily-details td:last-child { grid-area: amount; }
  .daily-details td:is(:nth-child(1), :nth-child(3), :nth-child(4)) { font-size: .81rem; color: var(--muted); }
}

/* Performance report (range view) and its charts. */
.perf-report { display: grid; gap: 1rem; margin-bottom: 1.5rem; }
.perf-range { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem 1.25rem; }
.perf-presets { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.perf-preset { padding: .4rem .85rem; border-radius: 999px; color: var(--muted); font-size: .85rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.perf-preset:hover { color: var(--ink); background: var(--surface-2); }
.perf-preset.is-active { color: #fff; background: var(--work-action); }
.perf-custom { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem; }
.perf-custom label { display: grid; gap: .25rem; color: var(--muted); font-size: .75rem; }
.perf-custom .input { min-width: 9.5rem; }
.perf-range-note { flex-basis: 100%; margin: 0; color: var(--muted); font-size: .8rem; }
.perf-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .75rem; }
.perf-tile { display: grid; align-content: start; gap: .2rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: var(--panel-radius); background: var(--surface); }
.perf-tile span { color: var(--muted); font-size: .8rem; }
.perf-tile strong { color: var(--ink); font-size: 1.35rem; font-weight: 650; line-height: 1.25; }
.perf-report > .panel { margin: 0; }
.perf-chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 1.25rem; padding: 0 1.25rem 1.25rem; }
.perf-chart-card { min-width: 0; }
.perf-chart-card h3 { margin: 0 0 .5rem; color: var(--ink); font-size: .9rem; font-weight: 650; }
.perf-breakdown-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 1.25rem; padding: 0 1.25rem 1.25rem; align-items: start; }
.perf-table table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.perf-table th, .perf-table td { padding: .55rem .7rem; border-top: 1px solid var(--line); text-align: left; white-space: nowrap; }
.perf-table thead th { border-top: 0; color: var(--muted); font-size: .72rem; font-weight: 600; }
.perf-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.perf-table tbody th { font-weight: 600; }
.perf-table tfoot th, .perf-table tfoot td { border-top: 2px solid var(--line); font-weight: 700; }
.perf-table tr.is-empty td, .perf-table tr.is-empty th a { color: var(--muted); }
.perf-daily .perf-table { max-height: 28rem; overflow: auto; }
.perf-daily thead th { position: sticky; top: 0; background: var(--surface); }
.daily-day { scroll-margin-top: 1rem; }
.daily-day-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem; margin: .5rem 0 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.daily-day-head h2 { margin: 0; font-size: 1.1rem; }
.daily-day > .panel { margin-bottom: 1rem; }

.viz-chart { position: relative; margin: 0; outline: none; }
.viz-chart:focus-visible { box-shadow: 0 0 0 3px var(--focus-ring); border-radius: 8px; }
.viz-plot { position: relative; width: 100%; }
.viz-plot svg { display: block; overflow: visible; touch-action: pan-y; }
.viz-grid { stroke: #eceef4; stroke-width: 1; }
.viz-tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz-line-path { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz-dot { stroke: #fff; stroke-width: 2; }
.viz-cross { stroke: #b9bdcc; stroke-width: 1; }
.viz-legend { display: flex; flex-wrap: wrap; gap: .35rem 1rem; margin: 0 0 .4rem; padding: 0; list-style: none; color: var(--muted); font-size: .8rem; }
.viz-legend li { display: inline-flex; align-items: center; gap: .4rem; }
.viz-key { width: 14px; height: 2px; border-radius: 1px; }
.viz-tip { position: absolute; top: 0; z-index: 2; min-width: 9rem; padding: .5rem .65rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 8px 24px rgba(20, 32, 60, .12); pointer-events: none; font-size: .8rem; }
.viz-tip-date { margin-bottom: .25rem; color: var(--muted); font-size: .72rem; }
.viz-tip-row { display: flex; align-items: center; gap: .45rem; white-space: nowrap; }
.viz-tip-row strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.viz-tip-row span:last-child { color: var(--muted); }
.viz-tip-key { width: 12px; height: 2px; border-radius: 1px; flex: none; }
.viz-bars { display: grid; gap: .6rem; margin: 0; padding: 0; list-style: none; }
.viz-bar-row { display: grid; grid-template-columns: minmax(4.5rem, 7rem) minmax(0, 1fr) auto; align-items: center; gap: .75rem; border-radius: 6px; outline: none; }
.viz-bar-row:focus-visible, .viz-bar-row:hover { background: var(--surface-2); }
.viz-bar-name { overflow: hidden; color: var(--ink); font-size: .85rem; text-overflow: ellipsis; white-space: nowrap; }
.viz-bar-track { display: block; height: 14px; }
.viz-bar-fill { display: block; height: 100%; border-radius: 0 4px 4px 0; background: #5146d5; }
.viz-bar-value { display: inline-flex; align-items: baseline; gap: .4rem; min-width: 5.5rem; justify-content: flex-end; font-variant-numeric: tabular-nums; }
.viz-bar-value strong { color: var(--ink); font-size: .9rem; }
.viz-bar-value small { color: var(--muted); font-size: .75rem; }

@media (max-width: 760px) {
  .perf-breakdown-body { grid-template-columns: 1fr; }
  .perf-chart-grid, .perf-breakdown-body { padding: 0 .9rem 1rem; }
  .perf-presets { width: 100%; }
  .perf-preset { flex: 1; text-align: center; }
  .perf-custom { width: 100%; }
  .perf-custom label { flex: 1 1 8rem; }
  .perf-custom .input { min-width: 0; width: 100%; }
  .perf-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .perf-tile strong { font-size: 1.15rem; }
}

/* Day-by-day table as stacked cards on phones: date and counts on top, then
   only the non-zero amounts as label/value lines. Desktop keeps the table. */
@media (max-width: 700px) {
  .perf-daily .perf-table { max-height: none; overflow: visible; }
  .perf-daily table, .perf-daily tbody, .perf-daily tfoot { display: block; }
  .perf-daily thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .perf-daily tr { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: baseline; gap: .3rem 1rem; padding: .8rem .9rem; border-top: 1px solid var(--line); }
  .perf-daily tbody tr + tr { border-top: 1px solid var(--line); }
  .perf-daily th, .perf-daily td { display: block; padding: 0; border: 0; white-space: normal; }
  .perf-daily tbody th, .perf-daily tfoot th { grid-column: 1; grid-row: 1; font-size: .95rem; }
  .perf-daily .perf-count { grid-row: 1; display: inline-flex; align-items: baseline; gap: .3rem; font-weight: 700; }
  .perf-daily .perf-count::before { content: attr(data-label); color: var(--muted); font-size: .72rem; font-weight: 400; }
  .perf-daily td.money { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 1rem; text-align: right; }
  .perf-daily td.money::before { content: attr(data-label); color: var(--muted); font-size: .78rem; text-align: left; }
  .perf-daily td.is-zero { display: none; }
  .perf-daily tr.is-empty { padding-block: .55rem; }
  .perf-daily tfoot tr { border-top: 2px solid var(--line); background: var(--surface-2); }
  .perf-daily tfoot th, .perf-daily tfoot td { border-top: 0; }
}

/* Administrator dispatch history on the order detail. */
.dispatch-history { margin: 1rem 0; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: var(--panel-radius); background: var(--surface); }
.dispatch-history h3 { margin: 0 0 .4rem; font-size: .95rem; }
.dispatch-first { margin: 0 0 .6rem; color: var(--muted); font-size: .85rem; }
.dispatch-first strong { color: var(--ink); }
.dispatch-history ol { display: grid; gap: .7rem; margin: 0; padding: 0; list-style: none; }
.dispatch-move { padding-top: .6rem; border-top: 1px solid var(--line); }
.dispatch-route { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem; }
.dispatch-route span { color: var(--muted); }
.dispatch-meta { margin-top: .15rem; color: var(--muted); font-size: .8rem; }
.dispatch-terms { display: flex; flex-wrap: wrap; gap: .25rem .9rem; margin-top: .35rem; font-size: .8rem; }
.detail.manual-result strong small { display: block; margin-top: .2rem; color: var(--muted); font-weight: 400; font-size: .8rem; white-space: pre-wrap; }
