/* Segments. The live count while editing matters more than the form, so it
   sits directly under the rules rather than appearing after a save. */

.ps-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ps-card h3 { margin: 0; font-size: 15.5px; }
.ps-card p { margin: 4px 0 0; font-size: 13px; color: var(--sd-mut); line-height: 1.5; }
.ps-share { flex: none; font-size: 12.5px; font-weight: 700; color: var(--sd-blue-ink); }
.ps-summary {
  font-size: 12px; color: var(--sd-mut); line-height: 1.5;
  background: rgba(127,137,158,.07); border-radius: 8px; padding: 8px 10px; display: block; white-space: normal;
}
.ps-figures { display: flex; gap: 14px; font-size: 12.5px; color: var(--sd-mut); flex-wrap: wrap; }
.ps-figures b { color: inherit; font-size: 15px; font-weight: 650; margin-right: 3px; }
/* Same progress treatment as the rest of the product. */
.ps-bar { height: 6px; border-radius: 999px; background:var(--sd-sunk,#eef2f8); overflow: hidden; }
.ps-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #4a8bf7, #16a34a); transition: width .4s ease; }
.ps-card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ps-card-actions .ps-btn { padding: 6px 10px; font-size: 12.5px; }

/* Editor */
.ps-modal { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 20px; }
.ps-backdrop { position: absolute; inset: 0; border: 0; background: rgba(8,10,16,.55); backdrop-filter: blur(2px); cursor: pointer; }
.ps-dialog {
  /* The dialog itself must not scroll: a scrolling box clips what opens
     inside it, so a select near its bottom edge had nowhere to open into.
     The body scrolls instead. */
  position: relative; width: min(720px, 100%); max-height: 88vh;
  display: flex; flex-direction: column; overflow: visible;
  padding: 26px 28px;
  border: 1px solid var(--sd-line); box-shadow: 0 24px 60px rgba(8,10,16,.28);
}
.ps-dialog-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-bottom: 8px; }
.ps-dialog.wide { width: min(980px, 100%); }
.ps-dialog h4 { margin: 22px 0 10px; font-size: 13px; }
.ps-close { position: absolute; top: 14px; right: 14px; border: 0; background: transparent; font-size: 15px; cursor: pointer; color: var(--sd-mut); }
.ps-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ps-grid .full { grid-column: 1 / -1; }

.ps-rules { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 12px; }
.ps-rule { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ps-rule .ps-input { width: auto; min-width: 140px; flex: 1 1 140px; }
.ps-rule .ps-btn { padding: 6px 10px; font-size: 12.5px; }
.ps-about { margin: 4px 0 0; font-size: 11.5px; color: var(--sd-mut); }

.ps-live {
  margin-top: 16px; padding: 12px 14px; border-radius: 10px;
  border: 1px solid rgba(47,109,246,.25); background: rgba(47,109,246,.06); font-size: 13.5px;
}
.ps-live b { font-size: 15px; }
.ps-sample { color: var(--sd-mut); font-size: 12px; margin-top: 4px; }
.ps-problems {
  border: 1px solid rgba(180,83,9,.35); background: rgba(180,83,9,.08); color: #b45309;
  border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; font-size: 13px; line-height: 1.5;
}
.ps-problems ul { margin: 0; padding-left: 18px; }
/* Outside the scrolling body, so Save is reachable without scrolling to it. */
.ps-modal-actions {
  display: flex; align-items: center; gap: 9px;
  margin-top: 16px; padding-top: 16px; flex: none;
  border-top: 1px solid var(--sd-line);
}

@media (max-width: 760px) {
  .ps-grid { grid-template-columns: 1fr; }
}
