.tpc-calculator {
  max-width: 1100px;
  margin: 32px auto;
  padding: 24px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
}
.tpc-form h2 { margin-top: 0; }
.tpc-muted { color: #666; }
.tpc-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 20px 0;
}
.tpc-grid label span { display: block; font-weight: 600; margin-bottom: 6px; }
.tpc-grid input, .tpc-cod-amount {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  box-sizing: border-box;
}
.tpc-actions { display: flex; align-items: center; gap: 12px; }
.tpc-button {
  border: 0;
  padding: 11px 18px;
  border-radius: 999px;
  cursor: pointer;
  background: #111827;
  color: #fff;
  font-weight: 700;
}
.tpc-button:disabled { opacity: .6; cursor: wait; }
.tpc-summary {
  margin: 20px 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f3f4f6;
}
.tpc-result-section { margin-top: 24px; }
.tpc-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.tpc-card {
  padding: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(0,0,0,.04);
}
.tpc-card-title { font-weight: 800; font-size: 17px; margin-bottom: 8px; }
.tpc-card-price { font-size: 24px; font-weight: 900; margin-bottom: 10px; }
.tpc-card-meta { color: #666; font-size: 14px; margin-bottom: 4px; }
.tpc-badge {
  display: inline-block;
  margin: 8px 0;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff7ed;
  font-size: 12px;
  font-weight: 700;
}
.tpc-cod { display: block; margin: 12px 0 8px; }
.tpc-alert {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
}
.tpc-alert-error { background: #fef2f2; }
.tpc-alert-warning { background: #fffbeb; }
.tpc-alert-success { background: #ecfdf5; }
@media (max-width: 900px) {
  .tpc-grid, .tpc-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .tpc-grid, .tpc-cards { grid-template-columns: 1fr; }
  .tpc-calculator { padding: 16px; }
}
.tpc-manual-nonstandard {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px;
  margin: 8px 0 18px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fafafa;
}
.tpc-manual-nonstandard input { margin-top: 3px; }
.tpc-manual-nonstandard small { color: #666; }
.tpc-summary-note {
  margin-top: 8px;
  font-weight: 700;
}
.tpc-debug-dimensions { margin-top: 12px; overflow-x: auto; }
.tpc-debug-dimensions table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 13px;
}
.tpc-debug-dimensions th,
.tpc-debug-dimensions td {
  border: 1px solid #e5e7eb;
  padding: 6px 8px;
  text-align: left;
}
.tpc-card-carrier {
  color: #666;
  font-size: 13px;
  margin-bottom: 8px;
}


.tpc-card-price-label {
  margin-top: -8px;
  margin-bottom: 10px;
  color: #777;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.tpc-addons {
  margin: 14px 0;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
}
.tpc-addons-title {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 800;
}
.tpc-cod {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
}
.tpc-cod input[type="checkbox"] {
  width: auto;
}
.tpc-cod-panel {
  margin-top: 10px;
}
.tpc-cod-panel label {
  display: block;
  font-size: 13px;
  font-weight: 700;
}
.tpc-cod-panel small {
  display: block;
  margin-top: 6px;
  color: #666;
  line-height: 1.4;
}
.tpc-final-price-box {
  margin: 14px 0;
  padding: 12px;
  border-radius: 12px;
  background: #f3f4f6;
}
.tpc-final-price-box span {
  display: block;
  color: #555;
  font-size: 13px;
  font-weight: 700;
}
.tpc-final-price-box strong {
  display: block;
  margin-top: 3px;
  font-size: 22px;
  font-weight: 900;
}

/* v0.4 — koszyk / checkout brokera */
.tpc-locked-quantity {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f3f4f6;
  font-weight: 800;
}
.tpc-cart-extra-actions {
  margin: 16px 0;
  text-align: right;
}
.tpc-checkout-broker-fields {
  clear: both;
  margin: 24px 0;
  padding: 20px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
}
.tpc-checkout-broker-fields h3 {
  margin-top: 0;
}
.tpc-checkout-fieldset {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #f9fafb;
}
.tpc-checkout-fieldset h4 {
  margin-top: 0;
  margin-bottom: 6px;
}
.tpc-checkout-desc {
  margin-top: 0;
  color: #666;
  font-size: 13px;
}
.tpc-admin-order-data {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid #ddd;
}

/* v0.5 — custom shipment summary page */
.tpc-shipment-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 12px 48px;
}
.tpc-shipment-hero {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 26px;
  margin-bottom: 22px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .06);
}
.tpc-shipment-hero span,
.tpc-section-kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 6px;
}
.tpc-shipment-hero h2 {
  margin: 0 0 8px;
  font-size: 30px;
}
.tpc-shipment-hero p { margin: 0; color: #64748b; }
.tpc-shipment-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: start;
}
.tpc-shipment-card,
.tpc-form-panel,
.tpc-total-card,
.tpc-help-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
}
.tpc-shipment-card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  border-bottom: 1px solid #eef2f7;
  padding-bottom: 16px;
  margin-bottom: 16px;
}
.tpc-shipment-card h3,
.tpc-form-panel h3,
.tpc-help-card h4 {
  margin: 0 0 6px;
}
.tpc-shipment-card p,
.tpc-form-panel p,
.tpc-help-card p,
.tpc-total-card p {
  margin: 0;
  color: #64748b;
}
.tpc-small-link { font-size: 13px; }
.tpc-shipment-details-grid,
.tpc-shipment-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.tpc-shipment-details-grid div {
  background: #f8fafc;
  border-radius: 12px;
  padding: 11px 12px;
}
.tpc-shipment-details-grid strong,
.tpc-price-summary-inline span,
.tpc-total-card span {
  display: block;
  font-size: 12px;
  color: #64748b;
  margin-bottom: 3px;
}
.tpc-shipment-details-grid span { font-weight: 700; }
.tpc-price-summary-inline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.tpc-price-summary-inline > div {
  border-top: 1px solid #eef2f7;
  padding-top: 12px;
}
.tpc-price-summary-inline .tpc-price-total strong,
.tpc-total-card strong {
  font-size: 24px;
}
.tpc-form-panel label span {
  display: block;
  font-weight: 700;
  margin-bottom: 5px;
}
.tpc-form-panel input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 12px;
}
.tpc-shipment-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
}
.tpc-secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 11px 16px;
  text-decoration: none;
  font-weight: 700;
  background: #fff;
}
.tpc-shipment-sidebar { position: sticky; top: 24px; }
.tpc-help-card ol { margin-bottom: 0; padding-left: 20px; color: #475569; }
.tpc-checkout-broker-fields {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 18px;
  margin: 20px 0;
  background: #fff;
}
.tpc-checkout-fieldset { margin-top: 14px; }
.tpc-checkout-fieldset h4 { margin-bottom: 6px; }
@media (max-width: 900px) {
  .tpc-shipment-layout { grid-template-columns: 1fr; }
  .tpc-shipment-sidebar { position: static; }
  .tpc-price-summary-inline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .tpc-shipment-details-grid,
  .tpc-shipment-form-grid,
  .tpc-price-summary-inline { grid-template-columns: 1fr; }
  .tpc-shipment-actions { flex-direction: column; align-items: stretch; }
}

.tpc-insurance,
.tpc-cod {
    display: block;
    margin: 8px 0;
}

.tpc-insurance-panel,
.tpc-cod-panel {
    margin: 8px 0 10px;
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fafafa;
}

.tpc-insurance-panel input,
.tpc-cod-panel input {
    width: 100%;
    margin-top: 4px;
}

.tpc-insurance-required-note {
    margin: 6px 0;
    padding: 8px 10px;
    border-radius: 8px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 13px;
}

.tpc-addon-disabled {
    margin: 8px 0;
    padding: 8px 10px;
    border-radius: 8px;
    background: #fef2f2;
    color: #991b1b;
    font-size: 13px;
}


/* v0.6.1 — ikony kurierów */
.tpc-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.tpc-carrier-logo,
.tpc-shipment-carrier-logo {
  flex: 0 0 auto;
  width: 64px;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
}
.tpc-carrier-logo img,
.tpc-shipment-carrier-logo img {
  display: block;
  max-width: 100%;
  max-height: 32px;
  object-fit: contain;
}
.tpc-carrier-logo-fallback {
  color: #374151;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  line-height: 1.15;
}
.tpc-shipment-card-head {
  align-items: center;
  gap: 14px;
}
.tpc-shipment-carrier-logo {
  width: 86px;
  min-height: 54px;
}
.tpc-shipment-carrier-logo img {
  max-height: 40px;
}
@media (max-width: 600px) {
  .tpc-card-header { align-items: flex-start; }
  .tpc-carrier-logo { width: 56px; min-height: 38px; }
  .tpc-shipment-card-head { align-items: flex-start; }
}


/* v0.8 — brokerski widok zamówienia i FV */
.tpc-checkbox-row {
  display: flex !important;
  align-items: center;
  gap: 10px;
  grid-column: 1 / -1;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}
.tpc-checkbox-row input { width: auto !important; margin: 0; }
.tpc-broker-order-block {
  margin: 28px 0;
  padding: 0;
}
.tpc-broker-order-block > h2 {
  margin: 0 0 16px;
  font-size: 26px;
}
.tpc-broker-card {
  margin: 0 0 18px;
  padding: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15,23,42,.04);
}
.tpc-broker-card h3 {
  margin: 0 0 14px;
  font-size: 18px;
}
.tpc-broker-service-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.tpc-broker-service-head h3 { margin: 0 0 4px; }
.tpc-broker-service-head p { margin: 0; color: #64748b; }
.tpc-broker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.tpc-broker-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
}
.tpc-broker-row span {
  font-size: 12px;
  color: #64748b;
}
.tpc-broker-row strong {
  font-size: 14px;
  color: #0f172a;
  word-break: break-word;
}
.tpc-broker-two-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.tpc-broker-order-email .tpc-broker-card {
  box-shadow: none;
  border-radius: 8px;
}
.tpc-broker-order-email .tpc-broker-grid,
.tpc-broker-order-email .tpc-broker-two-cols {
  display: block;
}
.tpc-broker-order-email .tpc-broker-row {
  margin-bottom: 6px;
}
.tpc-broker-order-admin .tpc-broker-card {
  box-shadow: none;
  border-radius: 8px;
}
@media (max-width: 760px) {
  .tpc-broker-grid,
  .tpc-broker-two-cols { grid-template-columns: 1fr; }
  .tpc-broker-service-head { align-items: flex-start; }
}

/* v1.0 — brokerowy cleanup WooCommerce */
.tpc-broker-checkout-hero,
.tpc-broker-checkout-summary,
.tpc-broker-order-hero,
.tpc-broker-order-block .tpc-broker-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 22px;
  margin: 18px 0;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
}
.tpc-broker-checkout-hero h2,
.tpc-broker-order-hero h2,
.tpc-broker-checkout-summary h3 {
  margin: 0 0 8px;
}
.tpc-broker-checkout-hero p {
  color: #64748b;
  margin: 8px 0 0;
}
.tpc-broker-order-overview,
.tpc-broker-grid,
.tpc-broker-two-cols {
  display: grid;
  gap: 12px;
}
.tpc-broker-order-overview,
.tpc-broker-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.tpc-broker-two-cols {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}
.tpc-broker-row {
  background: #f8fafc;
  border-radius: 12px;
  padding: 10px 12px;
}
.tpc-broker-row span {
  display: block;
  color: #64748b;
  font-size: 12px;
  margin-bottom: 4px;
}
.tpc-broker-row strong {
  display: block;
  color: #0f172a;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.tpc-broker-service-head {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}
.tpc-shipment-carrier-logo img {
  width: 82px;
  max-height: 48px;
  object-fit: contain;
}
.tpc-broker-card h3,
.tpc-broker-card h4 {
  margin-top: 0;
}
.tpc-broker-order-admin .tpc-broker-card {
  box-shadow: none;
}
@media (max-width: 900px) {
  .tpc-broker-order-overview,
  .tpc-broker-grid,
  .tpc-broker-two-cols {
    grid-template-columns: 1fr;
  }
}

/* Picker Paczkomatu / punktu odbioru — moduł brokerski MVP. */
.tpc-field-full { grid-column: 1 / -1; }
.tpc-locker-picker { border: 1px solid #e5e7eb; background: #f8fafc; border-radius: 14px; padding: 16px; margin-top: 8px; }
.tpc-locker-picker h4 { margin: 0 0 6px; font-size: 16px; }
.tpc-locker-picker p { margin: 0 0 12px; color: #64748b; }
.tpc-locker-selected { background: #fff; border: 1px solid #dbe3ef; border-radius: 12px; padding: 12px; margin-bottom: 12px; }
.tpc-locker-selected strong { display:block; font-size: 16px; margin-bottom: 4px; }
.tpc-locker-selected span { color:#475569; }
.tpc-locker-modal { display:none; position:fixed; inset:0; background:rgba(15,23,42,.55); z-index:99999; align-items:center; justify-content:center; padding:20px; }
.tpc-locker-modal.is-open { display:flex; }
.tpc-locker-modal-box { position:relative; background:#fff; width:min(760px, 96vw); max-height:90vh; overflow:auto; border-radius:18px; padding:24px; box-shadow:0 24px 80px rgba(15,23,42,.25); }
.tpc-locker-close { position:absolute; top:12px; right:14px; border:0; background:#f1f5f9; border-radius:999px; width:34px; height:34px; font-size:22px; line-height:1; cursor:pointer; }
.tpc-locker-search { width:100%; padding:12px 14px; border:1px solid #cbd5e1; border-radius:12px; margin:12px 0; }
.tpc-locker-list { display:grid; gap:10px; margin:12px 0 20px; }
.tpc-locker-item { text-align:left; border:1px solid #e2e8f0; background:#fff; border-radius:12px; padding:12px; cursor:pointer; }
.tpc-locker-item:hover { border-color:#0f172a; box-shadow:0 8px 28px rgba(15,23,42,.08); }
.tpc-locker-item strong { display:block; color:#0f172a; margin-bottom:3px; }
.tpc-locker-item span { color:#475569; }
.tpc-locker-manual { border-top:1px solid #e5e7eb; padding-top:16px; margin-top:12px; }
.tpc-locker-manual label { display:block; margin-bottom:10px; font-weight:600; }
.tpc-locker-manual input { display:block; width:100%; margin-top:5px; padding:10px 12px; border:1px solid #cbd5e1; border-radius:10px; }
@media (max-width: 640px) { .tpc-locker-modal-box { padding:18px; } }

/* Oficjalny InPost Geowidget w modalu wyboru Paczkomatu. */
.tpc-locker-modal-box-geowidget {
  width: min(1100px, 94vw);
  max-width: 1100px;
}
.tpc-geowidget-wrap {
  min-height: 620px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
.tpc-geowidget-wrap inpost-geowidget {
  display: block;
  width: 100%;
  min-height: 620px;
}
@media (max-width: 768px) {
  .tpc-geowidget-wrap,
  .tpc-geowidget-wrap inpost-geowidget {
    min-height: 520px;
  }
}

/* v1.1.2 — poprawka oficjalnego InPost Geowidgetu w modalu.
   Widget/Leaflet wymaga stałej wysokości kontenera; bez tego mapa renderuje się tylko częściowo. */
.tpc-locker-modal.is-open {
  display: flex;
}
.tpc-locker-modal-box-geowidget {
  width: min(1180px, 96vw) !important;
  height: min(820px, 92vh);
  max-height: 92vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.tpc-locker-modal-box-geowidget .tpc-geowidget-wrap {
  flex: 1 1 auto;
  min-height: 560px;
  height: 100%;
  overflow: hidden;
}
.tpc-locker-modal-box-geowidget .tpc-geowidget-wrap inpost-geowidget,
.tpc-locker-modal-box-geowidget .tpc-geowidget-wrap .tpc-inpost-geowidget {
  display: block;
  width: 100%;
  height: 100% !important;
  min-height: 560px;
}
@media (max-width: 768px) {
  .tpc-locker-modal {
    padding: 10px;
  }
  .tpc-locker-modal-box-geowidget {
    height: 94vh;
    width: 98vw !important;
  }
  .tpc-locker-modal-box-geowidget .tpc-geowidget-wrap,
  .tpc-locker-modal-box-geowidget .tpc-geowidget-wrap inpost-geowidget {
    min-height: 500px;
  }
}

/* v1.4 — wybór typu nadania: paczka albo koperta/list */
.tpc-shipment-mode {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  margin: 12px 0 10px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #f9fafb;
}
.tpc-shipment-mode label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  color: #374151;
}
.tpc-shipment-mode input { width: auto; margin: 0; }
.tpc-shipment-mode label.is-active {
  background: #111827;
  color: #fff;
}
@media (max-width: 600px) {
  .tpc-shipment-mode { display: flex; flex-direction: column; border-radius: 16px; }
  .tpc-shipment-mode label { justify-content: center; }
}

/* v1.4.1 — kafelki wyboru typu nadania i stałe parametry koperty */
.tpc-shipment-mode-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 0;
  margin: 18px 0 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.tpc-shipment-mode-cards .tpc-shipment-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .06);
  cursor: pointer;
  color: #111827;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease, background .15s ease;
}
.tpc-shipment-mode-cards .tpc-shipment-card:hover {
  border-color: #111827;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .10);
  transform: translateY(-1px);
}
.tpc-shipment-mode-cards .tpc-shipment-card.is-active {
  border-color: #111827;
  background: #f9fafb;
  color: #111827;
  box-shadow: 0 0 0 2px rgba(17, 24, 39, .08), 0 12px 28px rgba(15, 23, 42, .08);
}
.tpc-shipment-mode-cards input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.tpc-shipment-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: #f3f4f6;
  font-size: 25px;
}
.tpc-shipment-text strong {
  display: block;
  font-size: 16px;
  line-height: 1.2;
}
.tpc-shipment-text small {
  display: block;
  margin-top: 4px;
  color: #6b7280;
  font-weight: 500;
  line-height: 1.35;
}
.tpc-envelope-fixed-note {
  margin: 10px 0 4px;
  padding: 12px 14px;
  border: 1px solid #fde68a;
  border-radius: 14px;
  background: #fffbeb;
  color: #78350f;
}
.tpc-fixed-envelope-field {
  background: #f3f4f6 !important;
  color: #374151;
  cursor: not-allowed;
}
@media (max-width: 700px) {
  .tpc-shipment-mode-cards { grid-template-columns: 1fr; }
}

/* v1.4.2 — uproszczone kafelki Paczka/Koperta */
.tpc-shipment-mode-cards {
  max-width: 620px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.tpc-shipment-mode-cards .tpc-shipment-card {
  justify-content: center;
  min-height: 76px;
  padding: 18px 22px;
}
.tpc-shipment-mode-cards .tpc-shipment-card.is-active {
  background: #111827;
  color: #fff;
  border-color: #111827;
}
.tpc-shipment-mode-cards .tpc-shipment-card.is-active .tpc-shipment-icon {
  background: rgba(255,255,255,.14);
}
.tpc-shipment-text strong {
  font-size: 19px;
  letter-spacing: .01em;
}
.tpc-shipment-text small { display: none !important; }
.tpc-envelope-fixed-note {
  max-width: 620px;
  margin-top: 6px;
}

/* ==========================================================
   v1.5.0 — Tania Paczka: broker UI foundation
   Warstwa wizualna inspirowana brandingiem: granat + fiolet + pomarańcz.
   Nie zmienia logiki kalkulatora — tylko wygląd stron brokerskich.
   ========================================================== */
:root {
  --tpc-navy: #070b1a;
  --tpc-navy-2: #0d1326;
  --tpc-purple: #6f2dbd;
  --tpc-purple-soft: #f4ecff;
  --tpc-orange: #ff9700;
  --tpc-orange-2: #ff6b00;
  --tpc-border: #e7e9f0;
  --tpc-soft: #f7f8fb;
  --tpc-text: #111827;
  --tpc-muted: #667085;
  --tpc-shadow: 0 18px 55px rgba(7, 11, 26, .10);
}

/* Szerszy i czystszy układ dla stron, na których renderuje się warstwa Tania Paczka. */
.entry-content .tpc-brand-wrapper,
.entry-content .tpc-shipment-page,
.entry-content .tpc-broker-order-block,
.entry-content .tpc-broker-checkout-hero,
.entry-content .tpc-broker-checkout-summary {
  font-family: inherit;
}

.tpc-brand-wrapper {
  width: min(1180px, calc(100vw - 40px));
  margin: 0 auto 48px;
}

.tpc-brand-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  gap: 28px;
  align-items: stretch;
  margin: 18px 0 26px;
  padding: 34px;
  border-radius: 30px;
  background:
    radial-gradient(circle at 78% 18%, rgba(255,151,0,.22), transparent 28%),
    radial-gradient(circle at 18% 88%, rgba(111,45,189,.36), transparent 30%),
    linear-gradient(135deg, var(--tpc-navy), var(--tpc-navy-2));
  color: #fff;
  box-shadow: var(--tpc-shadow);
  overflow: hidden;
  position: relative;
}
.tpc-brand-hero:before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 0 52%, rgba(255,255,255,.06) 52% 53%, transparent 53% 100%);
  pointer-events: none;
}
.tpc-brand-hero-content,
.tpc-brand-hero-card { position: relative; z-index: 1; }
.tpc-brand-kicker,
.tpc-section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--tpc-orange);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.tpc-brand-hero h1 {
  margin: 0 0 14px;
  max-width: 760px;
  color: #fff;
  font-size: clamp(32px, 5vw, 62px);
  line-height: .98;
  font-weight: 950;
  letter-spacing: -.045em;
}
.tpc-brand-hero p {
  max-width: 650px;
  margin: 0;
  color: rgba(255,255,255,.82);
  font-size: 18px;
  line-height: 1.55;
}
.tpc-brand-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.tpc-brand-badges span {
  display: inline-flex;
  padding: 9px 13px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}
.tpc-brand-hero-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 260px;
  padding: 24px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 24px;
  background: rgba(255,255,255,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10);
  backdrop-filter: blur(7px);
}
.tpc-brand-logo-text strong,
.tpc-brand-logo-text span {
  display: block;
  color: #fff;
  font-size: 32px;
  line-height: .95;
  font-weight: 950;
  letter-spacing: .04em;
}
.tpc-brand-logo-text strong:first-letter { color: var(--tpc-purple); }
.tpc-brand-year {
  margin-top: 24px;
  color: rgba(255,255,255,.78);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.tpc-brand-year strong {
  display: block;
  margin-top: 4px;
  color: var(--tpc-orange);
  font-size: 42px;
  line-height: 1;
}
.tpc-brand-visual-boxes { display: flex; justify-content: flex-end; gap: 8px; }
.tpc-brand-visual-boxes i {
  width: 54px; height: 44px;
  border: 2px solid rgba(255,151,0,.80);
  border-radius: 8px;
  transform: skewY(-6deg);
  background: rgba(255,151,0,.10);
}
.tpc-brand-visual-boxes i:nth-child(2) { border-color: rgba(111,45,189,.95); transform: translateY(-10px) skewY(7deg); }
.tpc-brand-visual-boxes i:nth-child(3) { width: 38px; opacity: .7; }

/* Kalkulator jako główny panel narzędziowy, bardziej SaaS/broker niż zwykły formularz. */
.tpc-calculator {
  max-width: none;
  margin: 0 auto 28px;
  padding: 30px;
  border: 1px solid rgba(111,45,189,.14);
  border-radius: 28px;
  background: #fff;
  box-shadow: var(--tpc-shadow);
}
.tpc-form h2 {
  margin: 0 0 8px;
  color: var(--tpc-text);
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 900;
  letter-spacing: -.03em;
}
.tpc-muted { color: var(--tpc-muted); }
.tpc-grid label span { color: var(--tpc-text); font-weight: 850; }
.tpc-grid input,
.tpc-cod-amount,
.tpc-insurance-amount {
  min-height: 48px;
  border: 1px solid #d8dbe6;
  border-radius: 14px;
  background: #fff;
  font-weight: 750;
  transition: box-shadow .18s ease, border-color .18s ease;
}
.tpc-grid input:focus,
.tpc-cod-amount:focus,
.tpc-insurance-amount:focus {
  outline: none;
  border-color: var(--tpc-purple);
  box-shadow: 0 0 0 4px rgba(111,45,189,.12);
}
.tpc-button,
.button.tpc-button,
.tpc-calculator button.tpc-button,
.tpc-shipment-actions .tpc-button {
  border: 0 !important;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--tpc-orange), var(--tpc-orange-2)) !important;
  color: #111827 !important;
  box-shadow: 0 12px 28px rgba(255,151,0,.28);
  font-weight: 950;
  letter-spacing: -.01em;
}
.tpc-button:hover { transform: translateY(-1px); filter: brightness(.98); }

/* Kafelki Paczka/Koperta. */
.tpc-shipment-mode-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0 24px;
  padding: 6px;
  border-radius: 26px;
  background: var(--tpc-soft);
  border: 1px solid var(--tpc-border);
}
.tpc-shipment-mode-cards .tpc-shipment-card {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border-radius: 21px;
  border: 1px solid transparent;
  background: #fff;
  color: var(--tpc-text);
  cursor: pointer;
  box-shadow: none;
  transition: all .18s ease;
}
.tpc-shipment-mode-cards .tpc-shipment-card:hover {
  border-color: rgba(111,45,189,.25);
  box-shadow: 0 12px 26px rgba(17,24,39,.07);
}
.tpc-shipment-mode-cards .tpc-shipment-card.is-active {
  background: var(--tpc-navy);
  color: #fff;
  box-shadow: 0 16px 34px rgba(7,11,26,.22);
}
.tpc-shipment-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--tpc-purple-soft);
  font-size: 22px;
}
.tpc-shipment-card.is-active .tpc-shipment-icon { background: rgba(255,151,0,.16); }
.tpc-shipment-text strong { font-size: 18px; font-weight: 950; }
.tpc-envelope-fixed-note {
  margin: -8px 0 18px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--tpc-purple-soft);
  color: #3b1a66;
  font-weight: 800;
}
.tpc-manual-nonstandard {
  border-color: var(--tpc-border);
  border-radius: 18px;
  background: #fbfbfd;
}

/* Wyniki ofert — bardziej brokerskie karty. */
.tpc-result-section h3,
.tpc-result-section h2 {
  margin-bottom: 14px;
  color: var(--tpc-text);
  font-weight: 950;
  letter-spacing: -.025em;
}
.tpc-cards { gap: 18px; }
.tpc-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border: 1px solid var(--tpc-border);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(17,24,39,.07);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.tpc-card:hover {
  transform: translateY(-2px);
  border-color: rgba(111,45,189,.24);
  box-shadow: 0 20px 45px rgba(17,24,39,.11);
}
.tpc-card:before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--tpc-purple), var(--tpc-orange));
}
.tpc-card-title { color: var(--tpc-text); font-size: 18px; font-weight: 950; }
.tpc-card-carrier,
.tpc-card-meta { color: var(--tpc-muted); }
.tpc-card-price {
  color: var(--tpc-navy);
  font-size: 30px;
  letter-spacing: -.035em;
}
.tpc-addons,
.tpc-final-price-box {
  border-color: #eceef5;
  border-radius: 18px;
  background: #f8f9fc;
}
.tpc-badge {
  background: #fff3df;
  color: #9a4b00;
}
.tpc-carrier-logo,
.tpc-shipment-carrier-logo {
  background: #fff;
  border: 1px solid var(--tpc-border);
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(17,24,39,.06);
}

/* Sekcja zaufania pod kalkulatorem. */
.tpc-brand-trust {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 20px 0 0;
}
.tpc-brand-trust div {
  padding: 20px;
  border: 1px solid var(--tpc-border);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(17,24,39,.05);
}
.tpc-brand-trust strong {
  display: block;
  margin-bottom: 6px;
  color: var(--tpc-navy);
  font-size: 16px;
  font-weight: 950;
}
.tpc-brand-trust span {
  display: block;
  color: var(--tpc-muted);
  font-size: 14px;
  line-height: 1.45;
}

/* Delikatne odwordpressowienie stron Tania Paczka w Storefront. */
body.page .entry-title:has(+ .entry-content .tpc-brand-wrapper) {
  display: none;
}
body.page .entry-content:has(.tpc-brand-wrapper) {
  margin-top: 0;
}
body.page .entry-content:has(.tpc-brand-wrapper) .tpc-brand-wrapper a:not(.tpc-button) {
  color: var(--tpc-purple);
}

@media (max-width: 960px) {
  .tpc-brand-hero,
  .tpc-brand-trust { grid-template-columns: 1fr; }
  .tpc-brand-hero-card { min-height: 210px; }
  .tpc-calculator { padding: 22px; }
}
@media (max-width: 640px) {
  .tpc-brand-wrapper { width: min(100%, calc(100vw - 24px)); }
  .tpc-brand-hero { padding: 24px; border-radius: 24px; }
  .tpc-shipment-mode-cards { grid-template-columns: 1fr; }
  .tpc-card-price { font-size: 26px; }
}


/* Checkout: pełne dane nadawcy/odbiorcy pod przyciskiem płatności */
.tpc-checkout-accordions {
  margin-top: 18px;
  clear: both;
}
.tpc-checkout-details {
  margin-top: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}
.tpc-checkout-details summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 800;
  color: #0b1020;
  background: #f8fafc;
}
.tpc-checkout-details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 16px 16px;
}
.tpc-checkout-details-row {
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
}
.tpc-checkout-details-row span {
  display: block;
  margin-bottom: 3px;
  color: #64748b;
  font-size: 12px;
}
.tpc-checkout-details-row strong {
  display: block;
  color: #111827;
  font-size: 13px;
}
@media (max-width: 700px) {
  .tpc-checkout-details-grid {
    grid-template-columns: 1fr;
  }
}


/* Checkout: widoczny blok pełnych danych zlecenia */
.tpc-checkout-full-data {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 14px 45px rgba(15, 23, 42, .06);
}
.tpc-checkout-full-data h3 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 900;
  color: #0b1020;
}
.tpc-checkout-full-data-desc {
  margin: 0 0 12px;
  color: #64748b;
  font-size: 13px;
}
.tpc-checkout-full-data .tpc-checkout-details {
  margin-top: 12px;
}
.tpc-checkout-full-data .tpc-checkout-details[open] summary {
  border-bottom: 1px solid #e5e7eb;
}


/* Checkout fallback: po wstrzyknięciu JS blok ma mieć odstęp pod przyciskiem płatności */
.tpc-checkout-full-data.tpc-injected {
  margin-top: 18px !important;
}
#place_order + .tpc-checkout-full-data,
.wc-block-components-checkout-place-order-button + .tpc-checkout-full-data {
  margin-top: 18px;
}


/* v1.5.7 — bardziej kompaktowy kalkulator pod landing / mobile-first */
.tpc-calculator {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

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

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

.tpc-calculator .tpc-shipment-mode-cards {
  max-width: 560px;
}

@media (max-width: 760px) {
  .tpc-calculator {
    max-width: 100%;
    margin: 18px 0;
    padding: 18px;
    border-radius: 18px;
  }

  .tpc-calculator .tpc-grid,
  .tpc-calculator .tpc-cards {
    grid-template-columns: 1fr;
  }

  .tpc-calculator .tpc-shipment-mode-cards {
    grid-template-columns: 1fr;
    max-width: 100%;
  }

  .tpc-calculator .tpc-actions {
    align-items: stretch;
  }

  .tpc-calculator .tpc-actions .tpc-button {
    width: 100%;
  }
}



/* v1.5.8 — kalkulator jako szeroki komponent do osadzenia w Elementorze / landing page */
.tpc-calculator {
  max-width: 1040px !important;
  width: 100%;
  margin: 32px auto !important;
  padding: clamp(22px, 3vw, 34px) !important;
}

.tpc-calculator .tpc-form h2 {
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.08;
}

.tpc-calculator .tpc-muted {
  max-width: 760px;
  font-size: 15px;
}

.tpc-calculator .tpc-shipment-mode-cards {
  max-width: 620px !important;
}

.tpc-calculator .tpc-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 16px !important;
}

.tpc-calculator .tpc-cards {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.tpc-calculator .tpc-button {
  min-height: 48px;
  padding-left: 24px;
  padding-right: 24px;
}

@media (max-width: 1024px) {
  .tpc-calculator .tpc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .tpc-calculator .tpc-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  .tpc-calculator {
    max-width: 100% !important;
    margin: 18px 0 !important;
    padding: 18px !important;
    border-radius: 18px !important;
  }

  .tpc-calculator .tpc-grid,
  .tpc-calculator .tpc-cards,
  .tpc-calculator .tpc-shipment-mode-cards {
    grid-template-columns: 1fr !important;
  }

  .tpc-calculator .tpc-actions {
    align-items: stretch;
  }

  .tpc-calculator .tpc-actions .tpc-button {
    width: 100%;
  }
}

