.ippo-main {
  background: #f5f6f8;
  margin-left: 255px;
  padding: 30px;
  position: relative;
  z-index: 0;
  min-width: 0;
}

.ippo-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.ippo-page-header h1 {
  margin: 0 0 6px;
  font-size: 26px;
  color: #111827;
}

.ippo-page-header p {
  margin: 0;
  font-size: 14px;
  color: #64748b;
}

.ippo-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ippo-text-button {
  display: inline-flex;
  align-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #2563eb;
  appearance: none;
  -webkit-appearance: none;
  padding: 0;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

#ippoGuideButton {
  margin-left: 12px;
}

.ippo-previous-download-button {
  margin-left: 12px;
}

#ippoRunButton {
  margin-left: 12px;
}

.ippo-text-button:hover,
.ippo-text-button:focus,
.ippo-text-button:active {
  border: 0;
  background: transparent;
  color: #2563eb;
  box-shadow: none;
  outline: none;
  text-decoration: none;
}

.ippo-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.ippo-panel {
  margin-bottom: 22px;
}

.ippo-panel .upload-form {
  align-items: stretch;
  width: 100%;
}

.ippo-drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 118px;
  padding: 14px 18px;
  border: 1px dashed #94a3b8;
  border-radius: 8px;
  background: #f8fafc;
  box-sizing: border-box;
  color: #334155;
  cursor: pointer;
  gap: 5px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.ippo-drop-zone:hover,
.ippo-drop-zone:focus,
.ippo-drop-zone.is-dragging {
  border-color: #2563eb;
  background: #eff6ff;
  outline: none;
}

.ippo-drop-zone input {
  display: none;
}

.ippo-drop-zone strong {
  color: #111827;
  font-size: 15px;
}

.ippo-drop-zone span {
  color: #64748b;
  font-size: 13px;
}

.ippo-selected-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.ippo-selected-files li {
  max-width: 260px;
  padding: 5px 8px;
  border: 1px solid #d7dde5;
  border-radius: 6px;
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ippo-download-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.ippo-download-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.ippo-download-link:hover {
  background: #dbeafe;
}

.ippo-download-zip {
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
}

.ippo-download-zip:hover {
  background: #1d4ed8;
}

.ippo-unmatched-files {
  margin-top: 10px;
  color: #991b1b;
  font-size: 13px;
}

.ippo-unmatched-files strong {
  display: block;
  margin-bottom: 6px;
}

.ippo-unmatched-files ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ippo-unmatched-files li {
  max-width: 320px;
  padding: 5px 8px;
  border: 1px solid #fecaca;
  border-radius: 6px;
  background: #fff1f2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ippo-progress-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.35);
}

.ippo-progress-overlay.is-visible {
  display: flex;
}

.ippo-progress-modal {
  width: min(420px, 100%);
  padding: 22px;
  border: 1px solid #d7dde5;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.22);
  box-sizing: border-box;
}

.ippo-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.ippo-progress-header h2 {
  margin: 0;
  font-size: 18px;
  color: #111827;
}

.ippo-progress-header span {
  color: #2563eb;
  font-size: 14px;
  font-weight: 800;
}

.ippo-progress-track {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}

.ippo-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #2563eb;
  transition: width 0.2s ease;
}

.ippo-progress-bar.is-indeterminate {
  width: 45% !important;
  background: linear-gradient(90deg, #2563eb, #60a5fa, #2563eb);
  animation: ippo-progress-slide 1s ease-in-out infinite;
}

.ippo-progress-modal p {
  margin: 12px 0 0;
  color: #475569;
  font-size: 13px;
}

.ippo-progress-modal .ippo-progress-eta {
  margin-top: 6px;
  color: #64748b;
  font-size: 12px;
}

.ippo-cancel-button {
  margin-top: 16px;
}

@keyframes ippo-progress-slide {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(250%);
  }
}

.ippo-option-grid {
  display: grid;
  grid-template-columns: repeat(2, max-content) max-content;
  align-items: end;
  gap: 12px;
}

.ippo-option-grid .field-block {
  width: 180px;
}

.ippo-action-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ippo-data-section {
  min-width: 0;
}

.ippo-result-box {
  min-width: 0;
  box-sizing: border-box;
}

.ippo-table-box {
  overflow: hidden;
}

.ippo-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.ippo-box-header h2 {
  margin: 0;
  font-size: 20px;
}

.ippo-muted {
  color: #64748b;
  font-size: 13px;
}

.ippo-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
  font-size: 14px;
}

.ippo-table-wrap {
  width: 100%;
  max-height: 760px;
  overflow: auto;
  box-sizing: border-box;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
}

.ippo-config-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  font-size: 12px;
  color: #1f2937;
}

.ippo-config-table th,
.ippo-config-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: middle;
}

.ippo-config-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  white-space: nowrap;
}

.ippo-config-table td:nth-child(3),
.ippo-config-table td:nth-child(5),
.ippo-config-table td:nth-child(6) {
  line-height: 1.4;
}

.ippo-partner-name strong {
  color: #0f172a;
  font-size: 13px;
}

.ippo-match-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 260px;
}

.ippo-match-list span,
.ippo-match-list em {
  max-width: 120px;
  padding: 3px 6px;
  border: 1px solid #dbe3ed;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: 11px;
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ippo-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.ippo-type-badge.is-on {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

.ippo-fee-summary {
  display: grid;
  gap: 4px;
  min-width: 300px;
}

.ippo-fee-summary span {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  color: #64748b;
  font-size: 11px;
}

.ippo-fee-summary strong {
  display: block;
  min-width: 0;
  color: #1f2937;
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ippo-partner-row {
  cursor: pointer;
}

.ippo-partner-row:hover {
  background: #f8fafc;
}

.ippo-table-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 12px;
  color: #475569;
  font-size: 14px;
}

.ippo-popup {
  margin-left: 0;
  padding: 18px;
  min-width: 1040px;
  background: #f6f7f9;
}

.ippo-edit-panel {
  margin-top: 0;
  max-width: 1180px;
}

.ippo-edit-form {
  display: grid;
  gap: 12px;
}

.ippo-form-section {
  border: 1px solid #d8dee6;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.ippo-form-section-title {
  padding: 10px 14px;
  border-bottom: 1px solid #e5e7eb;
  background: #f8fafc;
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
}

.ippo-basic-table {
  display: grid;
  border: 0;
  background: #ffffff;
}

.ippo-basic-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  border-bottom: 1px solid #eef2f6;
}

.ippo-basic-row:last-child {
  border-bottom: 0;
}

.ippo-basic-label {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 12px;
  border-right: 1px solid #e5e7eb;
  border-bottom: 0;
  background: #f8fafc;
  color: #111827;
  font-size: 13px;
  font-weight: 800;
  box-sizing: border-box;
}

.ippo-basic-label::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: #64748b;
}

.ippo-basic-field {
  min-width: 0;
  padding: 7px;
  border: 0;
  box-sizing: border-box;
}

.ippo-basic-textarea {
  width: 100%;
  min-height: 46px;
  padding: 7px 10px;
  resize: vertical;
  line-height: 1.35;
  box-sizing: border-box;
}

.ippo-check-control {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  justify-self: stretch;
  width: 100%;
  gap: 0;
  margin: 0;
  padding: 12px 14px;
  color: #334155;
  font-size: 14px;
  font-weight: 700;
  line-height: 16px;
}

.ippo-check-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ippo-check-box {
  display: inline-block;
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  margin-right: 2px;
  border: 1px solid #94a3b8;
  border-radius: 2px;
  box-sizing: border-box;
  background: #ffffff;
}

.ippo-check-control input:checked + .ippo-check-box {
  background: #2563eb;
  border-color: #2563eb;
  box-shadow: inset 0 0 0 2px #ffffff;
}

.ippo-check-control span:not(.ippo-check-box) {
  display: inline-block;
  margin: 0;
}

.danger-button {
  border: 1px solid #fecaca;
  border-radius: 6px;
  background: #fff1f2;
  color: #b91c1c;
  cursor: pointer;
  font-weight: 700;
  padding: 8px 14px;
}

.danger-button:hover {
  background: #ffe4e6;
}

.ippo-textarea {
  min-height: 82px;
  resize: vertical;
  line-height: 1.5;
}

.ippo-rate-textarea {
  font-family: Menlo, Consolas, monospace;
}

.ippo-rate-form {
  display: grid;
  border: 0;
  background: #ffffff;
}

.ippo-rate-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  border-bottom: 1px solid #eef2f6;
}

.ippo-rate-row-contract {
  background: #ffffff;
}

.ippo-rate-row-postoffice {
  background: #fbfcfe;
}

.ippo-rate-row:last-child {
  border-bottom: 0;
}

.ippo-rate-label {
  display: flex;
  align-items: flex-start;
  min-height: 160px;
  padding: 12px;
  border-right: 1px solid #e5e7eb;
  border-bottom: 0;
  background: #f8fafc;
  color: #111827;
  font-size: 13px;
  font-weight: 800;
  box-sizing: border-box;
}

.ippo-rate-row-contract .ippo-rate-label {
  background: #f8fafc;
}

.ippo-rate-row-postoffice .ippo-rate-label {
  background: #eef4fb;
  color: #0f3a63;
}

.ippo-rate-row-postoffice .ippo-rate-label::before {
  background: #2563eb;
}

.ippo-rate-label::before {
  content: "";
  width: 7px;
  height: 7px;
  margin: 4px 6px 0 0;
  border-radius: 50%;
  background: #64748b;
}

.ippo-rate-field {
  min-width: 0;
  padding: 10px;
  border: 0;
  box-sizing: border-box;
}

.ippo-rate-groups {
  display: grid;
  gap: 12px;
}

.ippo-rate-group {
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
}

.ippo-rate-group-delivery {
  border-left: 4px solid #475569;
}

.ippo-rate-group-return {
  border-left: 4px solid #0ea5e9;
}

.ippo-rate-group-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #111827;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.ippo-rate-group-title::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #475569;
}

.ippo-rate-group-return .ippo-rate-group-title::before {
  background: #0ea5e9;
}

.ippo-rate-row-postoffice .ippo-rate-group {
  border-color: #bfd0e2;
}

.ippo-rate-row-postoffice .ippo-rate-group-title {
  background: #f1f6fb;
  border-bottom-color: #d7e2ee;
  color: #0f3a63;
}

.ippo-rate-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: #ffffff;
  font-size: 13px;
}

.ippo-rate-table th,
.ippo-rate-table td {
  height: 34px;
  padding: 0;
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  text-align: center;
  vertical-align: middle;
}

.ippo-rate-table th:last-child,
.ippo-rate-table td:last-child {
  border-right: 0;
}

.ippo-rate-table tr:last-child td {
  border-bottom: 0;
}

.ippo-rate-table th {
  background: #f1f5f9;
  color: #334155;
  font-weight: 700;
}

.ippo-rate-input {
  width: 100%;
  height: 34px;
  padding: 0 8px;
  border: 0;
  box-sizing: border-box;
  background: transparent;
  color: #111827;
  font: inherit;
  text-align: right;
}

.ippo-rate-input:focus {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
}

.ippo-edit-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 0;
  padding: 12px 0 0;
  background: #f6f7f9;
}

@media (max-width: 960px) {
  .ippo-option-grid {
    grid-template-columns: 1fr;
  }

  .ippo-basic-row {
    grid-template-columns: 104px minmax(0, 1fr);
  }

  .ippo-rate-row {
    grid-template-columns: 104px minmax(0, 1fr);
  }

  .ippo-option-grid .field-block {
    width: 100%;
  }

  .ippo-action-group {
    justify-content: flex-start;
  }
}

@media (max-width: 768px) {
  .main-container.ippo-main {
    margin-left: 255px;
  }

  .ippo-page-header {
    align-items: flex-start;
    flex-direction: column;
  }
}
