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

.b2b-inpost-kicker {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #ffcb05;
  color: #1b1b1b;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .08em;
  line-height: 1;
}

.b2b-inpost-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  color: #155c43;
  font-size: 13px;
  font-weight: 780;
  line-height: 1.25;
  text-decoration: none;
}

.b2b-inpost-link:hover {
  color: #0f4935;
  text-decoration: none;
}

.b2b-inpost-link:focus-visible,
.b2b-inpost-toggle:focus-visible,
.b2b-inpost-retry:focus-visible {
  outline: 3px solid rgba(25, 112, 80, .28);
  outline-offset: 3px;
}

.b2b-inpost-link__number {
  min-width: 0;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-color: #a6c9bb;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.b2b-inpost-link:hover .b2b-inpost-link__number {
  text-decoration-color: currentColor;
}

.b2b-inpost-link__arrow {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: #edf6f2;
  font-size: 0;
  line-height: 1;
  text-decoration: none;
  transition: background-color .16s ease, transform .16s ease;
}

.b2b-inpost-link__arrow::before {
  position: absolute;
  inset: 3px;
  background: currentColor;
  content: '';
  forced-color-adjust: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 5h5v5M11 13l8-8M19 13v5a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 5h5v5M11 13l8-8M19 13v5a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h5'/%3E%3C/svg%3E") center / contain no-repeat;
}

.b2b-inpost-link:hover .b2b-inpost-link__arrow {
  background: #dfeee8;
  transform: translate(1px, -1px);
}

.b2b-inpost-summary {
  box-sizing: border-box;
  min-width: 0;
}

.b2b-inpost-summary--table {
  display: grid;
  gap: 7px;
  align-content: start;
  padding: 2px 0;
}

.b2b-inpost-summary--card {
  display: grid;
  grid-template-columns: minmax(220px, .9fr) minmax(220px, 1.1fr) auto;
  gap: 22px;
  align-items: center;
  padding: 18px 20px;
}

.b2b-inpost-identity,
.b2b-inpost-current {
  display: grid;
  gap: 6px;
  min-width: 0;
  align-content: start;
}

.b2b-inpost-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 25px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eef2f0;
  color: #485d55;
  font-size: 11px;
  font-weight: 780;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.b2b-inpost-status--loading {
  background: #eef2f0;
  color: #61716b;
}

.b2b-inpost-status--progress {
  background: #e8f1fb;
  color: #215680;
}

.b2b-inpost-status--action {
  background: #fff2bd;
  color: #735400;
}

.b2b-inpost-status--success {
  background: #e4f4ec;
  color: #116043;
}

.b2b-inpost-status--problem {
  background: #fff0ee;
  color: #a53b31;
}

.b2b-inpost-status--unknown {
  background: #f0f2f1;
  color: #5f6c68;
}

.b2b-inpost-current > .b2b-inpost-current__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 8px;
  min-height: 16px;
  margin: 0;
  color: #687b74;
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.b2b-inpost-toggle,
.b2b-inpost-retry {
  appearance: none;
  border: 1px solid #bfd4cc;
  border-radius: 9px;
  background: #f3f9f6;
  color: #145c42;
  font: inherit;
  font-size: 12px;
  font-weight: 740;
  cursor: pointer;
}

.b2b-inpost-toggle {
  display: inline-grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  justify-content: start;
  gap: 5px;
  width: fit-content;
  min-height: 34px;
  padding: 6px 9px;
}

.b2b-inpost-summary--card .b2b-inpost-toggle {
  justify-content: center;
  min-width: 160px;
}

.b2b-inpost-toggle:hover,
.b2b-inpost-retry:hover {
  border-color: #8fb9aa;
  background: #e6f2ed;
}

.b2b-inpost-toggle__count {
  color: #526a61;
  font-size: 10px;
  font-weight: 650;
}

.b2b-inpost-toggle__chevron {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(20, 92, 66, .09);
  font-size: 0;
  line-height: 1;
  transform: none;
  transition: background-color .16s ease;
}

.b2b-inpost-toggle__chevron::before {
  width: 10px;
  height: 10px;
  background: currentColor;
  content: '';
  forced-color-adjust: none;
  transition: transform .18s ease;
  -webkit-mask: 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.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 9 5 5 5-5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: 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.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 9 5 5 5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}

.b2b-inpost-toggle:hover .b2b-inpost-toggle__chevron {
  background: rgba(20, 92, 66, .15);
}

.b2b-inpost-toggle[aria-expanded="true"] .b2b-inpost-toggle__chevron {
  transform: none;
}

.b2b-inpost-toggle[aria-expanded="true"] .b2b-inpost-toggle__chevron::before {
  transform: rotate(180deg);
}

.b2b-inpost-retry {
  min-height: 36px;
  padding: 7px 12px;
  white-space: nowrap;
}

.b2b-inpost-retry--compact {
  min-height: 25px;
  padding: 3px 7px;
  font-size: 10px;
}

.b2b-inpost-table-details {
  grid-column: 1 / -1;
  min-width: 0;
}

.b2b-inpost-history {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  margin-top: 13px;
  padding: 20px;
  border: 1px solid #d9e7e2;
  border-radius: 12px;
  background: #f8fbfa;
}

.b2b-inpost-history[hidden],
.b2b-inpost-table-details[hidden] {
  display: none !important;
}

.b2b-inpost-history > .b2b-inpost-history__head {
  display: flex;
  flex: 0 0 auto;
  width: 100%;
  align-items: flex-start;
  justify-content: space-between;
  height: auto;
  min-height: 0;
  gap: 20px;
  margin: 0;
  padding: 0 0 16px;
  border: 0;
  border-bottom: 1px solid #dfe9e5;
  background: transparent;
}

.b2b-inpost-history__title {
  display: grid;
  flex: 1 1 auto;
  gap: 7px;
  min-width: 0;
}

.b2b-inpost-history__title h3 {
  margin: 0;
  color: #173f32;
  font-size: 17px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.b2b-inpost-history__actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
}

.b2b-inpost-link--history {
  font-size: 12px;
}

.b2b-inpost-message {
  margin: 16px 0 0;
  padding: 13px 14px;
  border-radius: 9px;
  background: #eef3f1;
  color: #53675f;
  font-size: 13px;
  line-height: 1.45;
}

.b2b-inpost-message--loading {
  background: #eef5fa;
  color: #375c73;
}

.b2b-inpost-message--stale {
  background: #fff7dc;
  color: #715715;
}

.b2b-inpost-message--error {
  background: #fff0ee;
  color: #943c33;
}

.b2b-inpost-timeline {
  display: grid;
  gap: 0;
  margin: 17px 0 0;
  padding: 0;
  list-style: none;
}

.b2b-inpost-event {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(145px, .33fr) minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  padding: 0 0 20px;
}

.b2b-inpost-event:last-child {
  padding-bottom: 2px;
}

.b2b-inpost-event:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 18px;
  bottom: 0;
  width: 2px;
  background: #d5e4de;
}

.b2b-inpost-event__marker {
  position: relative;
  z-index: 1;
  width: 10px;
  height: 10px;
  margin: 4px auto 0;
  border: 3px solid #f8fbfa;
  border-radius: 50%;
  background: #88ad9f;
  box-shadow: 0 0 0 1px #88ad9f;
}

.b2b-inpost-event--latest .b2b-inpost-event__marker {
  background: #18704f;
  box-shadow: 0 0 0 2px #18704f;
}

.b2b-inpost-event__time {
  color: #62736d;
  font-size: 12px;
  line-height: 1.4;
}

.b2b-inpost-event__content {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: #344a42;
}

.b2b-inpost-event__content strong {
  font-size: 13px;
  line-height: 1.35;
}

.b2b-inpost-event__content span,
.b2b-inpost-event__content p {
  margin: 0;
  color: #687b74;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.b2b-inpost-event__location::before {
  content: 'Oddział: ';
  font-weight: 720;
}

.b2b-inpost-card-list {
  display: grid;
  gap: 12px;
}

.b2b-inpost-card-list__head {
  display: grid;
  gap: 4px;
}

.b2b-inpost-card-list__head h2,
.b2b-inpost-card-list__head p {
  margin: 0;
}

.b2b-inpost-card-list__head h2 {
  font-size: 17px;
}

.b2b-inpost-card-list__head p {
  color: #687b74;
  font-size: 13px;
}

.b2b-inpost-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dfe7e4;
  border-radius: 12px;
  background: #fff;
}

.b2b-inpost-card__details .b2b-inpost-history {
  margin: 0;
  border-width: 1px 0 0;
  border-radius: 0;
}

.b2b-inpost-empty {
  color: #84908c;
}

/* Patch integration: an eighth column is added to the current invoice table. */
.finance-table--tracking .finance-table-head,
.finance-table--tracking > .finance-document-row {
  grid-template-columns:
    minmax(175px, 1.25fr)
    90px
    90px
    135px
    105px
    105px
    minmax(190px, .95fr)
    86px;
}

.finance-table--tracking > .finance-document-row > [data-inpost-details] {
  grid-column: 1 / -1;
}

@media (max-width: 1180px) and (min-width: 721px) {
  .finance-table--tracking .finance-table-head,
  .finance-table--tracking > .finance-document-row {
    min-width: 1180px;
  }
}

@media (max-width: 760px) {
  .b2b-inpost-summary--card {
    grid-template-columns: 1fr auto;
    gap: 14px;
    padding: 16px;
  }

  .b2b-inpost-summary--card .b2b-inpost-current {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .b2b-inpost-summary--card .b2b-inpost-toggle {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }

  .b2b-inpost-history {
    padding: 16px;
  }

  .b2b-inpost-history > .b2b-inpost-history__head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    justify-content: stretch;
    gap: 13px;
  }

  .b2b-inpost-history__actions {
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .b2b-inpost-event {
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 4px 11px;
    padding-bottom: 18px;
  }

  .b2b-inpost-event:not(:last-child)::before {
    left: 9px;
  }

  .b2b-inpost-event__marker {
    grid-row: 1 / span 2;
  }

  .b2b-inpost-event__time,
  .b2b-inpost-event__content {
    grid-column: 2;
  }

  .b2b-inpost-event__content strong {
    font-size: 13px;
  }

  /* Responsive card layout for the existing finance table. */
  .finance-table--tracking {
    display: grid;
    gap: 12px;
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .finance-table--tracking .finance-table-head {
    display: none;
  }

  .finance-table--tracking > .finance-document-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px 12px;
    min-width: 0;
    padding: 17px;
    border: 1px solid #dfe7e4;
    border-radius: 13px;
    background: #fff;
  }

  .finance-table--tracking > .finance-document-row > * {
    min-width: 0;
  }

  .finance-table--tracking > .finance-document-row > [data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: #71807a;
    font-size: 10px;
    font-weight: 780;
    letter-spacing: .04em;
    text-transform: uppercase;
  }

  .finance-table--tracking .finance-document-cell,
  .finance-table--tracking .b2b-inpost-table-summary,
  .finance-table--tracking > .finance-document-row > [data-inpost-details] {
    grid-column: 1 / -1;
  }

  .finance-table--tracking .finance-document-cell {
    padding-bottom: 12px;
    border-bottom: 1px solid #edf1ef;
  }

  .finance-table--tracking .b2b-inpost-table-summary {
    padding-top: 13px;
    border-top: 1px solid #edf1ef;
  }

  .finance-table--tracking .invoice-pdf-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .finance-table--tracking > .finance-document-row > [data-inpost-details] {
    margin: 0 -4px -4px;
  }

  .b2b-inpost-summary--table {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .b2b-inpost-summary--table .b2b-inpost-current {
    grid-column: 1;
  }

  .b2b-inpost-summary--table .b2b-inpost-toggle {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
  }
}

@media (max-width: 430px) {
  .b2b-inpost-summary--card,
  .b2b-inpost-summary--table {
    display: grid;
    grid-template-columns: 1fr;
  }

  .b2b-inpost-summary--card .b2b-inpost-current,
  .b2b-inpost-summary--card .b2b-inpost-toggle,
  .b2b-inpost-summary--table .b2b-inpost-current,
  .b2b-inpost-summary--table .b2b-inpost-toggle {
    grid-column: 1;
    grid-row: auto;
  }

  .b2b-inpost-summary--card .b2b-inpost-toggle,
  .b2b-inpost-summary--table .b2b-inpost-toggle {
    width: 100%;
  }

  .b2b-inpost-history__actions {
    display: grid;
  }

  .b2b-inpost-history__actions .b2b-inpost-retry {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .b2b-inpost-link__arrow,
  .b2b-inpost-toggle__chevron,
  .b2b-inpost-toggle__chevron::before {
    transition: none;
  }
}

@media (forced-colors: active) {
  .b2b-inpost-kicker,
  .b2b-inpost-status,
  .b2b-inpost-event__marker {
    border: 1px solid currentColor;
  }
}
