.ps-page { max-width: 1320px; }

.ps-note {
  margin: 0 0 20px;
  padding: 13px 16px;
  border: 1px solid #cfe3d7;
  border-radius: 10px;
  color: #285640;
  background: #eff8f3;
  font-size: 13px;
  line-height: 1.5;
}

.ps-overview,
.ps-results {
  border: 1px solid var(--border, #dde3ea);
  border-radius: 14px;
  background: var(--surface, #fff);
  box-shadow: 0 8px 24px rgba(31, 45, 68, .05);
}
.ps-results { margin-top: 22px; overflow: hidden; }
.ps-section-head,
.ps-results__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 14px;
}
.ps-section-head h2,
.ps-results__head h2 { margin: 0; font-size: 20px; }
.ps-section-head p { margin: 5px 0 0; color: var(--muted, #6d7480); font-size: 13px; }

.ps-campaign-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0 22px 22px;
}
.ps-campaign-card {
  width: 100%;
  padding: 16px;
  border: 1px solid var(--border, #dde3ea);
  border-radius: 12px;
  background: var(--surface, #fff);
  color: var(--text, #1e293b);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.ps-campaign-card:hover { border-color: var(--accent, #ff5a00); }
.ps-campaign-card.is-selected {
  border-color: var(--accent, #ff5a00);
  background: var(--accent-soft, #fff5ef);
  box-shadow: inset 0 0 0 1px var(--accent, #ff5a00);
}
.ps-campaign-card:focus-visible { outline: 3px solid rgba(255, 90, 0, .22); outline-offset: 2px; }
.ps-campaign-card__top,
.ps-results__title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.ps-campaign-card__identity { min-width: 0; }
.ps-campaign-card__name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-campaign-card__meta,
.ps-campaign__meta { display: block; margin: 5px 0 0; color: var(--muted, #6d7480); font-size: 12px; }
.ps-campaign-card__metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.ps-campaign-card__metric { min-width: 0; }
.ps-campaign-card__metric small { display: block; color: var(--muted, #6d7480); font-size: 10px; line-height: 1.2; }
.ps-campaign-card__metric b { display: block; margin-top: 4px; font-size: 15px; }

.ps-results__title-row { justify-content: flex-start; align-items: center; }
.ps-status { margin-left: 0; flex: 0 0 auto; }
.ps-status.is-clicked { background: rgba(220, 38, 38, .12); color: #b91c1c; }
.ps-status.is-clicked::before { background: currentColor; }

.ps-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding: 0 22px 22px;
}
.ps-metric { padding: 14px 16px; border-radius: 10px; background: var(--surface2, #f5f7fa); }
.ps-metric--primary { background: rgba(220, 38, 38, .08); }
.ps-metric__label { display: block; color: var(--muted, #6d7480); font-size: 12px; }
.ps-metric__value { display: block; margin-top: 5px; color: var(--text, #1e293b); font-size: 22px; }
.ps-metric--primary .ps-metric__value { color: #b91c1c; }

.ps-controls {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 16px 22px;
  border-top: 1px solid var(--border, #e5e9ef);
  background: var(--surface2, #fafbfc);
}
.ps-control { display: grid; gap: 6px; min-width: 190px; color: var(--muted, #6d7480); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.ps-control--search { flex: 1 1 320px; }
.ps-control select,
.ps-control input {
  width: 100%;
  min-height: 40px;
  box-sizing: border-box;
  padding: 8px 11px;
  border: 1px solid var(--border, #d7dde5);
  border-radius: 9px;
  background: var(--surface, #fff);
  color: var(--text, #1e293b);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
}
.ps-control select:focus,
.ps-control input:focus { border-color: var(--accent, #ff5a00); outline: 3px solid rgba(255, 90, 0, .12); }
.ps-result-count { margin: 0 0 11px auto; color: var(--muted, #6d7480); font-size: 12px; white-space: nowrap; }

.ps-table-wrap { overflow-x: auto; border-top: 1px solid var(--border, #e5e9ef); }
.ps-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ps-table th,
.ps-table td { padding: 12px 14px; border-bottom: 1px solid #edf0f4; text-align: left; white-space: nowrap; }
.ps-table th { color: var(--muted, #5e6672); background: #fafbfc; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.ps-table tbody tr:last-child td { border-bottom: 0; }
.ps-table tbody tr.is-clicked { background: rgba(220, 38, 38, .025); }
.ps-table tbody tr:hover { background: #fafbfc; }
.ps-employee { min-width: 210px; font-weight: 700; }
.ps-date { color: #4b5563; }
.ps-sort { display: inline-flex; align-items: center; gap: 3px; padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.ps-sort:hover { color: var(--text, #1e293b); }
.ps-sort:focus-visible { outline: 2px solid var(--accent, #ff5a00); outline-offset: 3px; }
.ps-sort span { min-width: 10px; color: var(--accent, #ff5a00); }
.ps-empty { padding: 34px 22px; border-top: 1px solid var(--border, #e5e9ef); color: var(--muted, #7a828e); text-align: center; }

body.ps-create-modal-open { overflow: hidden; }
.ps-create-dialog {
  width: min(100%, 860px);
  max-height: min(88vh, 820px);
  overflow-y: auto;
}
.ps-create-dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}
.ps-create-dialog__subtitle {
  margin: 4px 0 0;
  color: var(--muted, #6d7480);
  font-size: 13px;
  line-height: 1.45;
}
.ps-create-dialog__close {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--border, #dde3ea);
  border-radius: 50%;
  background: var(--surface, #fff);
  color: var(--muted, #6d7480);
  font: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.ps-create-dialog__close:hover { border-color: var(--border-hover, #aab2bd); color: var(--text, #1e293b); }
.ps-create-dialog__close:focus-visible { outline: 3px solid rgba(255, 90, 0, .18); outline-offset: 2px; }
.ps-create-form-grid { grid-template-columns: 1fr; }
.ps-create-form-grid textarea { min-height: 190px; line-height: 1.5; }
.ps-field-help { margin: 0; color: var(--muted, #6d7480); font-size: 12px; line-height: 1.45; }
.ps-create-error { white-space: pre-line; }
.ps-create-error ul { margin: 7px 0 0; padding-left: 20px; font-weight: 600; }

.ps-create-success {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.ps-create-success__icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #eaf7ef;
  color: #197044;
  font-weight: 900;
}
.ps-create-success h3 { margin: 0; font-size: 18px; }
.ps-create-success p { margin: 3px 0 0; color: var(--muted, #6d7480); font-size: 13px; }
.ps-link-warning {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid #f0dca9;
  border-radius: 10px;
  background: #fffaf0;
  color: #6b4b13;
  font-size: 13px;
  line-height: 1.5;
}
.ps-generated-table-wrap {
  max-height: 390px;
  overflow: auto;
  border: 1px solid var(--border, #dde3ea);
  border-radius: 11px;
}
.ps-generated-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ps-generated-table th,
.ps-generated-table td { padding: 11px 12px; border-bottom: 1px solid #edf0f4; text-align: left; vertical-align: middle; }
.ps-generated-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fafbfc;
  color: var(--muted, #5e6672);
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.ps-generated-table tbody tr:last-child td { border-bottom: 0; }
.ps-generated-email { color: var(--text, #1e293b); font-weight: 700; }
.ps-generated-url {
  display: block;
  max-width: 430px;
  overflow: hidden;
  color: #4b5563;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ps-copy-button { min-width: 70px; }
.ps-generated-actions { margin-top: 16px; flex-wrap: wrap; }

@media (max-width: 1050px) {
  .ps-campaign-list { grid-template-columns: 1fr; }
  .ps-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .ps-section-head,
  .ps-results__head,
  .ps-campaign-list,
  .ps-metrics,
  .ps-controls { padding-left: 16px; padding-right: 16px; }
  .ps-campaign-card__metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ps-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ps-controls { align-items: stretch; flex-direction: column; }
  .ps-control,
  .ps-control--search { width: 100%; min-width: 0; flex: 0 0 auto; }
  .ps-result-count { margin: 0; }
  .ps-page .mp-page__head { align-items: stretch; flex-direction: column; }
  .ps-page .mp-page__actions { flex-wrap: wrap; }
  .ps-create-dialog { max-height: calc(100vh - 24px); padding: 16px; }
  .ps-generated-table th,
  .ps-generated-table td { padding: 10px; }
  .ps-generated-actions { justify-content: stretch; }
  .ps-generated-actions .mp-btn { flex: 1 1 auto; }
}
