[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(255, 184, 0, 0.5);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.brand-logo {
  color: inherit;
  text-decoration: none;
  flex: 0 0 auto;
}

.notice-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.notice-tag {
  flex: 0 0 auto;
  white-space: nowrap;
}

.top-links {
  flex: 0 0 auto;
  min-width: 0;
}

.top-btn {
  white-space: nowrap;
}

.top-btn.login-btn {
  width: auto;
  margin-top: 0;
  padding: 3px 10px;
  font-size: 13px;
}

.logo-text-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.site-title {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-menu {
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-menu::-webkit-scrollbar {
  display: none;
}

.nav-item {
  flex: 0 0 auto;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-greeting {
  display: inline-block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.logo-image-wrap,
.logo-image-wrap img {
  display: block;
  width: 44px;
  height: 44px;
}

.logo-image-wrap img {
  border-radius: 8px;
  object-fit: contain;
}

.mobile-nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: var(--dp-blue);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.tab-pane {
  min-height: 48px;
}

#tracking-form.search-box-wrap {
  display: grid;
  grid-template-columns: minmax(210px, 240px) minmax(0, 1fr) auto;
  gap: 12px;
}

.tracking-carrier-select {
  min-width: 0;
  color: #334155;
  font-weight: 600;
  cursor: pointer;
}

.form-card {
  min-width: 0;
}

.form-card-title {
  width: 100%;
}

.form-group {
  display: block;
}

label.form-group {
  color: #334155;
  font-size: 13px;
  font-weight: 600;
}

.form-group .dp-input {
  font-weight: 400;
}

label.form-group > .dp-input {
  margin-top: 6px;
}

.cargo-weight-group {
  max-width: 130px;
}

.cargo-cod-group {
  max-width: 180px;
}

textarea.dp-input {
  min-height: 88px;
  resize: vertical;
}

.calc-result-panel .service-option {
  margin: 0;
}

.branch-card h3 {
  overflow-wrap: anywhere;
}

.branch-info {
  margin-bottom: 4px;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 32px 16px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: #64748b;
  text-align: center;
}

.inline-alert {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: 6px;
  background: #fef2f2;
  color: #991b1b;
}

.inline-alert.success {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.inline-alert.info {
  border-color: #bae6fd;
  background: #f0f9ff;
  color: #075985;
}

.orders-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.orders-toolbar p {
  margin: 0;
  color: #64748b;
}

.orders-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
  color: #64748b;
}

.orders-pager .dp-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.order-table {
  width: 100%;
  min-width: 1100px;
  border-collapse: collapse;
  font-size: 13px;
}

.order-table th,
.order-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  vertical-align: middle;
}

.order-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
}

.table-responsive {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 4px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.status-badge.done {
  background: #dcfce7;
  color: #15803d;
}

.status-badge.pending {
  background: #fef3c7;
  color: #92400e;
}

.status-badge.cancelled {
  background: #fee2e2;
  color: #b91c1c;
}

.payment-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.payment-badge.unpaid {
  background: #f1f5f9;
  color: #475569;
}

.payment-badge.pending {
  background: #fef3c7;
  color: #92400e;
}

.payment-badge.paid {
  background: #dcfce7;
  color: #166534;
}

.payment-badge.failed,
.payment-badge.refunded {
  background: #fee2e2;
  color: #991b1b;
}

.order-payment-cell .order-fee {
  margin-bottom: 6px;
  font-weight: 700;
}

.order-fee-label {
  display: block;
  margin-bottom: 2px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.order-tracking-number {
  max-width: 190px;
  overflow-wrap: anywhere;
  color: var(--dp-blue);
  font-weight: 700;
}

.order-status-cell {
  min-width: 230px;
}

.latest-tracking-summary {
  display: grid;
  min-width: 0;
  gap: 2px;
  margin-top: 9px;
}

.latest-tracking-label {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.latest-tracking-info {
  display: -webkit-box;
  max-width: 360px;
  overflow: hidden;
  color: #334155;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.latest-tracking-time {
  color: #64748b;
  font-size: 11px;
}

.order-created-alert {
  display: block;
}

.order-created-title {
  display: block;
  margin-bottom: 4px;
  font-size: 16px;
}

.order-created-copy {
  margin: 0 0 10px;
  overflow-wrap: anywhere;
}

.order-created-tracking {
  padding-top: 2px;
}

.order-actions,
.payment-actions,
.payment-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.payment-actions {
  margin-top: 12px;
}

.payment-summary p {
  margin-bottom: 8px;
}

.payment-amount strong {
  color: #b91c1c;
  font-size: 22px;
}

.payment-modal-actions {
  margin-top: 20px;
}

.payment-modal-actions .link-button {
  margin-left: auto;
}

.tracking-result-box {
  overflow: hidden;
}

.tracking-provider-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 14px 0 20px;
  padding: 14px 0;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
}

.tracking-provider-item {
  min-width: 0;
  padding: 0 14px;
  border-left: 1px solid #e2e8f0;
}

.tracking-provider-item:first-child {
  padding-left: 0;
  border-left: 0;
}

.tracking-provider-item:last-child {
  padding-right: 0;
}

.tracking-provider-item dt {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.tracking-provider-item dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  color: #1e293b;
  font-size: 13px;
  font-weight: 650;
}

.tracking-refresh-notice {
  margin-bottom: 0;
}

.tracking-number {
  overflow-wrap: anywhere;
}

.route-side {
  min-width: 135px;
}

.route-side:last-child {
  text-align: right;
}

.modal-backdrop {
  padding: 20px;
  overflow-y: auto;
}

.modal-box {
  width: 480px;
  max-width: 100%;
  max-height: calc(100vh - 40px);
  padding: 28px;
  border-radius: 10px;
  overflow-y: auto;
}

.modal-header h3 {
  margin: 0;
}

.link-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--dp-blue);
  font-weight: 700;
  cursor: pointer;
}

.form-message {
  min-height: 24px;
  margin-bottom: 6px;
  color: #b91c1c;
  font-size: 13px;
}

body.modal-open {
  overflow: hidden;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1200;
  width: min(360px, calc(100vw - 44px));
  padding: 12px 16px;
  border-radius: 6px;
  background: #002247;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  color: #fff;
  font-size: 14px;
}

.loading-state {
  padding: 18px 0;
  color: #64748b;
  text-align: center;
}

.login-prompt-actions {
  margin-top: 16px;
}

.login-prompt-actions .order-register-button {
  margin-left: 12px;
}

.form-message:empty {
  min-height: 0;
  margin-bottom: 0;
}

@media (min-width: 821px) {
  .tab-pane {
    min-height: 0;
  }

  .search-box-wrap .search-input {
    padding: 12px 18px;
    font-size: 15px;
    line-height: normal;
  }

  .search-box-wrap .search-btn {
    padding: 0 28px;
    font-size: 15px;
    line-height: normal;
  }

  .simple-form .submit-ship-btn {
    padding: 14px;
    font-size: 16px;
    line-height: normal;
  }

  .main-footer .footer-inner {
    padding-bottom: 30px;
  }
}

@media (max-width: 1050px) {
  .nav-menu {
    gap: 16px;
  }

  .nav-item {
    font-size: 14px;
  }

  .cargo-bar {
    flex-wrap: wrap;
  }

  .cargo-bar .inline-group {
    flex: 1 1 calc(33.333% - 16px);
  }
}

@media (max-width: 820px) {
  button,
  input,
  select,
  textarea {
    font: inherit;
  }

  .top-bar-content {
    align-items: flex-start;
    gap: 10px;
  }

  .notice-wrap {
    min-width: 0;
  }

  .notice-text {
    overflow-wrap: anywhere;
  }

  .hotline-text {
    display: none;
  }

  .header-inner {
    position: relative;
  }

  .mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav-menu {
    position: absolute;
    top: 70px;
    right: 24px;
    left: 24px;
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 30px rgba(0, 34, 71, 0.16);
  }

  .nav-menu.open {
    display: grid;
  }

  .nav-item {
    padding: 10px 12px;
  }

  .simple-form .form-grid,
  .calc-form .trio {
    grid-template-columns: 1fr;
  }

  .calc-form .trio {
    display: grid;
    gap: 0;
  }

  .services-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .branch-filter {
    grid-template-columns: 1fr 1fr;
  }

  .branch-filter .dp-btn {
    grid-column: 1 / -1;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }

  .footer-inner .footer-col:first-child {
    grid-column: 1 / -1;
  }

  #tracking-form.search-box-wrap {
    grid-template-columns: minmax(190px, 220px) minmax(0, 1fr);
  }

  #tracking-form .search-btn {
    grid-column: 1 / -1;
    min-height: 44px;
  }
}

@media (max-width: 620px) {
  .dp-container {
    padding-right: 16px;
    padding-left: 16px;
  }

  .top-bar {
    padding: 7px 0;
  }

  .top-bar-content {
    display: block;
  }

  .notice-wrap {
    align-items: flex-start;
  }

  .top-links {
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-top: 7px;
    gap: 8px;
  }

  .top-btn {
    padding: 4px 8px;
  }

  .header-inner {
    height: 68px;
  }

  .site-title {
    max-width: 165px;
    overflow: hidden;
    font-size: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .site-subtitle {
    max-width: 165px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .logo-icon,
  .logo-image-wrap,
  .logo-image-wrap img {
    width: 40px;
    height: 40px;
  }

  .nav-menu {
    top: 64px;
    right: 16px;
    left: 16px;
  }

  .hero-section {
    padding: 22px 0 34px;
  }

  .quick-card {
    padding: 18px;
  }

  .card-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tab-btn {
    min-height: 44px;
    padding: 8px 10px;
    white-space: normal;
  }

  #tracking-form.search-box-wrap {
    display: grid;
    grid-template-columns: 1fr;
  }

  #tracking-form .search-btn {
    grid-column: auto;
  }

  .search-btn {
    min-height: 44px;
  }

  .form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
  }

  .cargo-bar {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .cargo-weight-group,
  .cargo-cod-group {
    max-width: none;
  }

  .price-summary {
    padding-bottom: 0;
    white-space: normal;
  }

  .branch-filter,
  .branches-grid,
  .services-grid,
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .footer-inner .footer-col:first-child,
  .branch-filter .dp-btn {
    grid-column: auto;
  }

  .section-container {
    padding: 42px 0;
  }

  .section-title {
    font-size: 24px;
  }

  .section-subtitle {
    margin-bottom: 26px;
  }

  .enterprise-box {
    padding: 26px 22px;
  }

  .address-flow {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .route-side,
  .route-side:last-child {
    text-align: left;
  }

  .waypoints-bar {
    padding: 0;
    text-align: left;
  }

  .waypoints-nodes {
    justify-content: flex-start;
  }

  .tracking-provider-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 0;
  }

  .tracking-provider-item,
  .tracking-provider-item:first-child,
  .tracking-provider-item:last-child {
    padding: 0 12px;
    border-left: 1px solid #e2e8f0;
  }

  .tracking-provider-item:nth-child(odd) {
    padding-left: 0;
    border-left: 0;
  }

  .result-header,
  .orders-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .orders-pager {
    justify-content: space-between;
  }

  .modal-backdrop {
    align-items: flex-start;
    padding: 12px;
  }

  .modal-box {
    width: 100%;
    max-height: calc(100vh - 24px);
    padding: 20px;
  }

  .payment-actions,
  .payment-modal-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .payment-actions .dp-btn,
  .payment-modal-actions .dp-btn,
  .payment-modal-actions .link-button {
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 380px) {
  .card-tabs {
    grid-template-columns: 1fr;
  }

  .site-title,
  .site-subtitle {
    max-width: 135px;
  }
}
