.trial-toolbar,
.trial-filter-grid,
.trial-summary-grid,
.trial-wizard-actions,
.trial-inline-actions,
.trial-upload-row,
.trial-detail-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.trial-toolbar,
.trial-detail-head {
  justify-content: space-between;
}

.trial-toolbar {
  margin-bottom: 12px;
}

.trial-filter-grid {
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 12px;
}

.trial-filter-grid .field {
  min-width: 150px;
  margin: 0;
}

.trial-filter-grid .trial-keyword {
  flex: 1 1 260px;
}

.trial-filter-grid input,
.trial-filter-grid select,
.trial-wizard input,
.trial-wizard select,
.trial-wizard textarea,
.trial-import-dialog input,
.trial-import-dialog textarea,
.trial-import-dialog select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.trial-wizard textarea,
.trial-import-dialog textarea {
  min-height: 92px;
  padding: 9px 10px;
  resize: vertical;
}

.trial-filter-grid input,
.trial-filter-grid select,
.trial-wizard input,
.trial-wizard select,
.trial-import-dialog input,
.trial-import-dialog select {
  padding: 0 10px;
}

.trial-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}

.trial-summary-item {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.trial-summary-item span {
  display: block;
  color: var(--sub);
  font-size: 12px;
}

.trial-summary-item strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 19px;
}

.trial-table-meta,
.trial-muted {
  margin-top: 4px;
  color: var(--weak);
  font-size: 12px;
}

#merchant-trial .table-wrap table,
#admin-trial .table-wrap table,
.trial-dialog .table-wrap table {
  min-width: 900px;
}

#merchant-trial .table-wrap th,
#merchant-trial .table-wrap td,
#admin-trial .table-wrap th,
#admin-trial .table-wrap td,
.trial-dialog .table-wrap th,
.trial-dialog .table-wrap td {
  word-break: keep-all;
}

.trial-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.trial-metric {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.trial-metric span,
.trial-metric em {
  display: block;
  color: var(--sub);
  font-size: 12px;
  font-style: normal;
}

.trial-metric strong {
  display: block;
  margin: 8px 0;
  font-size: 24px;
}

.trial-fee-editor {
  display: grid;
  gap: 10px;
}

.trial-fee-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) minmax(120px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.trial-empty,
.trial-loading {
  padding: 34px 18px;
  color: var(--sub);
  text-align: center;
}

.trial-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  color: var(--sub);
  font-size: 13px;
}

.trial-inline-actions {
  flex-wrap: wrap;
}

.trial-inline-actions .link-btn {
  white-space: nowrap;
}

.trial-product-thumb {
  width: 52px;
  height: 52px;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f5f7fa;
  cursor: zoom-in;
  object-fit: cover;
}

.trial-product-placeholder {
  display: grid;
  place-items: center;
  color: var(--weak);
  font-size: 11px;
  cursor: default;
}

.trial-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, .48);
}

.trial-overlay[hidden] {
  display: none;
}

.trial-dialog,
.trial-wizard,
.trial-import-dialog {
  width: min(1120px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .24);
}

.trial-import-dialog {
  width: min(720px, 100%);
}

.trial-dialog-head,
.trial-dialog-body,
.trial-wizard-body,
.trial-wizard-actions {
  padding: 16px 18px;
}

.trial-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.trial-dialog-head h2,
.trial-dialog-head p {
  margin: 0;
}

.trial-dialog-head p {
  margin-top: 5px;
  color: var(--sub);
  font-size: 13px;
}

.trial-stepper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.trial-step {
  position: relative;
  min-width: 0;
  padding: 14px 10px;
  color: var(--weak);
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}

.trial-step.active {
  color: var(--blue);
}

.trial-step.active::after {
  position: absolute;
  right: 12px;
  bottom: -1px;
  left: 12px;
  height: 2px;
  background: var(--blue);
  content: '';
}

.trial-wizard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.trial-wizard-grid .trial-span-2 {
  grid-column: 1 / -1;
}

.trial-help {
  margin: 6px 0 0;
  color: var(--weak);
  font-size: 12px;
  line-height: 1.6;
}

.trial-product-editor {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.trial-product-editor table {
  min-width: 1080px;
  margin: 0;
}

.trial-product-editor input {
  min-width: 116px;
}

.trial-product-editor .trial-product-title {
  min-width: 180px;
}

.trial-product-editor .trial-product-url {
  min-width: 230px;
}

.trial-upload-row {
  align-items: stretch;
}

.trial-upload-row input[type="text"] {
  min-width: 180px;
}

.trial-upload-row label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  margin: 0;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--blue);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.trial-upload-row input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.trial-wizard-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

.trial-review-preview {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.trial-detail-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 18px;
  margin: 0 0 16px;
}

.trial-detail-list div {
  min-width: 0;
}

.trial-detail-list dt {
  color: var(--weak);
  font-size: 12px;
}

.trial-detail-list dd {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 14px;
}

.trial-image-dialog {
  width: min(900px, 100%);
  padding: 14px;
  background: #111827;
}

.trial-image-dialog img {
  width: 100%;
  max-height: calc(100vh - 100px);
  display: block;
  object-fit: contain;
}

.trial-image-dialog .icon-btn {
  position: sticky;
  top: 0;
  float: right;
  margin-bottom: 8px;
  border-color: #4b5563;
  background: #1f2937;
  color: #fff;
}

.trial-message {
  min-height: 22px;
  margin-top: 10px;
  color: var(--sub);
  font-size: 13px;
}

.trial-message.bad {
  color: var(--red);
}

.trial-message.ok {
  color: var(--green);
}

@media (max-width: 900px) {
  .trial-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

@media (max-width: 640px) {
  .trial-overlay {
    padding: 0;
    align-items: end;
  }

  .trial-dialog,
  .trial-wizard,
  .trial-import-dialog {
    width: 100%;
    max-height: 94vh;
    border-radius: 8px 8px 0 0;
  }

  .trial-toolbar,
  .trial-detail-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .trial-toolbar .primary-btn,
  .trial-filter-grid .ghost-btn,
  .trial-filter-grid .primary-btn {
    width: 100%;
  }

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

  .trial-filter-grid .trial-keyword {
    grid-column: 1 / -1;
  }

  .trial-wizard-grid,
  .trial-detail-list {
    grid-template-columns: 1fr;
  }

  .trial-fee-row {
    grid-template-columns: 1fr 1fr;
  }

  .trial-wizard-grid .trial-span-2 {
    grid-column: auto;
  }

  .trial-step {
    padding: 12px 4px;
    font-size: 11px;
  }

  .trial-step span {
    display: none;
  }
}
