/* Mile I Shipping V86.45 — live data synchronization and launch repair */

#pt-rate-result,
.form-result,
.v8645-package-dialog .form-result {
  white-space: normal !important;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.v8645-success { color:#087a43 !important; background:#e8f8ef; border:1px solid #b5e5ca; padding:12px 14px; border-radius:12px; }
.v8645-error { color:#b4232d !important; background:#fff0f1; border:1px solid #ffc7cc; padding:12px 14px; border-radius:12px; }

.v8645-package-dialog,
.v8645-invoice-dialog { border:0; padding:0; background:transparent; max-width:min(960px,calc(100vw - 28px)); width:100%; }
.v8645-package-dialog::backdrop,
.v8645-invoice-dialog::backdrop { background:rgba(4,23,55,.72); backdrop-filter:blur(5px); }
.v8645-dialog-shell,
.v8645-invoice-sheet { background:#fff; border-radius:26px; overflow:hidden; box-shadow:0 30px 90px rgba(4,27,67,.32); }
.v8645-dialog-shell > header { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:25px 30px; color:#fff; background:linear-gradient(135deg,#08265a,#115ca9); border-bottom:5px solid #ef2838; }
.v8645-dialog-shell > header small { display:block; letter-spacing:.16em; font-weight:900; margin-bottom:6px; opacity:.82; }
.v8645-dialog-shell > header h2 { margin:0; font-size:clamp(1.45rem,3vw,2.1rem); }
.v8645-dialog-shell > header button,
.v8645-invoice-sheet > header button { width:48px; height:48px; border-radius:14px; border:1px solid rgba(255,255,255,.35); background:rgba(255,255,255,.12); color:#fff; font-size:28px; cursor:pointer; }
.v8645-dialog-body { max-height:68vh; overflow:auto; overscroll-behavior:contain; padding:28px 30px; }
.v8645-dialog-body > label { display:grid; gap:8px; color:#15375d; font-weight:900; margin-top:18px; }
.v8645-dialog-body select,.v8645-dialog-body textarea { width:100%; border:1px solid #c7d9ec; border-radius:14px; padding:14px; font:inherit; background:#fff; }
.v8645-dialog-shell > footer { display:flex; justify-content:flex-end; gap:12px; padding:18px 30px 24px; border-top:1px solid #d7e3f0; }
.v8645-summary-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.v8645-summary-grid > div { padding:16px; border:1px solid #d5e2f0; border-radius:16px; background:#f5f9fd; min-width:0; }
.v8645-summary-grid span { display:block; color:#637d9b; font-size:.78rem; font-weight:900; text-transform:uppercase; letter-spacing:.08em; }
.v8645-summary-grid strong { display:block; color:#08295d; margin-top:6px; overflow-wrap:anywhere; }
.v8645-summary-grid small { display:block; color:#637d9b; margin-top:4px; }
.v8645-package-notes { margin-top:20px; padding:18px; border-radius:16px; background:#eef6ff; color:#214b76; }
.v8645-package-notes p { margin:.55rem 0 0; }
.v8645-timeline { margin-top:22px; }
.v8645-timeline > strong { color:#092b5c; font-size:1.1rem; }
.v8645-timeline article { display:grid; grid-template-columns:16px 1fr; gap:12px; margin-top:16px; }
.v8645-timeline article i { width:12px; height:12px; border-radius:50%; background:#1675d1; margin-top:5px; box-shadow:0 0 0 5px #e1f0ff; }
.v8645-timeline article div { display:grid; gap:3px; }
.v8645-timeline article b { color:#08295d; }
.v8645-timeline article span,.v8645-timeline article small { color:#647e9c; }

.v8645-shipment-card { padding:22px; }
.v8645-shipment-card header { display:flex; justify-content:space-between; gap:18px; align-items:flex-start; }
.v8645-shipment-card h3 { margin:4px 0 0; }
.v8645-shipment-meta { display:flex; justify-content:space-between; gap:15px; margin-top:18px; color:#607997; }
.v8645-shipment-packages { display:grid; gap:8px; border-top:1px solid #d9e5f1; margin-top:16px; padding-top:14px; }

/* Audit Log must scroll with a normal mouse wheel and trackpad. */
[data-portal-view="audit"] .table-wrap {
  max-height:64vh;
  overflow:auto !important;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
  touch-action:pan-x pan-y;
}
[data-portal-view="audit"] .admin-data-table { min-width:1100px; }

/* Explain reconciliation instead of presenting an unexplained status. */
.v8645-ledger-help { font-size:.85rem; color:#627d9c; }

/* Improved invoice view and print output. */
.v8645-invoice-sheet > header { display:flex; align-items:center; justify-content:space-between; min-height:150px; padding:24px 30px; background:#08265a; border-bottom:5px solid #ef2838; }
.v8645-invoice-sheet > header img { width:min(330px,75%); height:auto; max-height:105px; object-fit:contain; object-position:left center; }
#v8645-invoice-content { max-height:68vh; overflow:auto; padding:30px; color:#17395f; }
.v8645-invoice-heading { display:flex; justify-content:space-between; gap:20px; align-items:flex-start; }
.v8645-invoice-heading small { color:#ef2838; font-weight:900; letter-spacing:.13em; }
.v8645-invoice-heading h1 { color:#08295d; margin:6px 0; font-size:clamp(1.55rem,3.8vw,2.4rem); overflow-wrap:anywhere; }
.v8645-invoice-heading p { margin:0; color:#6a829e; }
.v8645-invoice-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin:25px 0; }
.v8645-invoice-summary > div { border:1px solid #d3e1ef; background:#f5f9fd; border-radius:14px; padding:15px; }
.v8645-invoice-summary span { display:block; color:#6c839d; font-size:.78rem; font-weight:900; text-transform:uppercase; }
.v8645-invoice-summary strong { display:block; margin-top:5px; color:#08295d; overflow-wrap:anywhere; }
#v8645-invoice-content table { width:100%; border-collapse:separate; border-spacing:0; border:1px solid #d2e0ed; border-radius:16px; overflow:hidden; }
#v8645-invoice-content th,#v8645-invoice-content td { padding:14px 16px; border-bottom:1px solid #dce7f1; text-align:left; }
#v8645-invoice-content th { background:#eaf2f9; color:#31567e; }
#v8645-invoice-content th:last-child,#v8645-invoice-content td:last-child { text-align:right; }
.v8645-invoice-totals { width:min(440px,100%); margin:24px 0 0 auto; }
.v8645-invoice-totals > div { display:flex; justify-content:space-between; gap:20px; padding:9px 0; }
.v8645-invoice-totals .total { font-size:1.1rem; font-weight:900; }
.v8645-invoice-totals .balance { border-top:3px solid #0b376d; font-size:1.15rem; font-weight:900; }
#v8645-invoice-content aside { margin-top:24px; padding:17px 19px; border-left:5px solid #e8ad1a; background:#fff8e5; border-radius:12px; }
#v8645-invoice-content aside p { margin:.4rem 0 0; }
.v8645-invoice-sheet > footer { display:flex; justify-content:flex-end; gap:12px; padding:18px 30px 24px; border-top:1px solid #d6e2ef; }

/* Private Pricing Studio: make the delivery editor a first-class action. */
#pt-edit-delivery-rate { border:1px solid #b9cee5; background:#fff; color:#082d63; font-weight:900; }
.pt-actions,#pt-app .pt-top-actions { flex-wrap:wrap; }
#pt-rate-result.v8631-visible,#pt-rate-result:not(:empty) { display:block !important; position:relative !important; inset:auto !important; max-height:none !important; padding:14px 18px !important; margin:12px 18px !important; border-radius:12px; z-index:2; }

@media (max-width:760px){
  .v8645-summary-grid,.v8645-invoice-summary { grid-template-columns:1fr 1fr; }
  .v8645-dialog-body,#v8645-invoice-content { padding:20px 18px; }
  .v8645-dialog-shell > footer,.v8645-invoice-sheet > footer { padding:14px 18px 20px; }
  .account-overview-card .account-metrics { display:grid !important; grid-template-columns:1fr 1fr; gap:0; }
  .account-overview-card .account-metrics > div { min-height:105px; padding:18px 12px; display:grid; place-content:center; text-align:center; }
  .v8645-invoice-heading { display:grid; }
  .v8645-invoice-sheet > header { min-height:110px; }
}
@media (max-width:480px){
  .v8645-summary-grid,.v8645-invoice-summary { grid-template-columns:1fr; }
  .v8645-dialog-shell > footer,.v8645-invoice-sheet > footer { display:grid; grid-template-columns:1fr 1.4fr; }
}

@media print {
  body > *:not(#v8645-invoice-dialog) { display:none !important; }
  #v8645-invoice-dialog { position:static !important; display:block !important; max-width:none !important; width:100% !important; margin:0 !important; background:#fff !important; }
  #v8645-invoice-dialog::backdrop { display:none !important; }
  .v8645-invoice-sheet { box-shadow:none !important; border-radius:0 !important; }
  .v8645-invoice-sheet > header { min-height:115px; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
  .v8645-invoice-sheet > header button,.v8645-invoice-sheet > footer { display:none !important; }
  #v8645-invoice-content { max-height:none !important; overflow:visible !important; padding:24px !important; }
}
