/* Customer projects, uploads, trade dashboard (My account) and the "save to project" tools on
   product pages / saved pieces. Uses the --pm-* tokens from precast.css. */

/* ---- project lists ---- */
.pm-projects { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--pm-line); }
.pm-projects li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 12px 0; border-bottom: 1px solid var(--pm-line); }
.pm-projects__row { justify-content: space-between; }
.pm-projects__row form { margin-left: auto; }
.pm-projects__name { color: var(--pm-ink); font-weight: 600; font-size: 15px; line-height: 22px; overflow-wrap: anywhere; }
.pm-projects li > .pm-projects__meta { flex-basis: 100%; }
.pm-projects__row > .pm-projects__meta { flex-basis: auto; }
.pm-projects__meta { font-size: 13px; line-height: 20px; color: var(--pm-muted); }
.pm-projects__line { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 10px 0; border-bottom: 1px solid var(--pm-line); }

.pm-inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-top: 18px; }
.pm-inline-form .pm-field { flex: 1 1 240px; margin: 0; }
.pm-project-upload { margin-top: 24px; padding-top: 20px; border-top: 1px dashed var(--pm-line-strong); }
.pm-project-delete { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--pm-line); }

/* ---- uploads ---- */
.pm-upload .pm-acc-save .ms { font-size: 20px; }
.pm-files-list .pm-upload-actions { grid-column: 2 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.pm-upload-actions form { display: flex; align-items: center; gap: 8px; margin: 0; }
.pm-upload-actions select { font-size: 13px; padding: 4px 8px; border: 1px solid var(--pm-line-strong); border-radius: 6px; background: var(--pm-white); color: var(--pm-ink); }

/* ---- product page / saved pieces: save to project ---- */
.pm-product-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 16px; }
.pm-save-project { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.pm-saved .pm-save-project { margin-top: 8px; }
.pm-save-project select,
.pm-save-project input[type="text"] {
    min-width: 0; max-width: 220px; font-size: 13px; padding: 6px 10px;
    border: 1px solid var(--pm-line-strong); border-radius: 6px; background: var(--pm-white); color: var(--pm-ink);
}
.pm-save-project select:focus-visible,
.pm-save-project input[type="text"]:focus-visible { outline: 2px solid var(--pm-red); outline-offset: 1px; }
.pm-save-project .ms,
.pm-product-tools > a .ms { font-size: 18px; vertical-align: -4px; margin-right: 4px; }

/* ---- trade dashboard ---- */
.pm-trade-dash { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 20px; }
.pm-trade-dash__eyebrow { font-size: 11px; letter-spacing: 0.1em; font-weight: 600; text-transform: uppercase; color: var(--pm-red); margin: 0 0 4px; }
.pm-meter { height: 8px; border-radius: 999px; background: var(--pm-well); overflow: hidden; margin: 14px 0 8px; }
.pm-meter__bar { display: block; height: 100%; border-radius: inherit; background: var(--pm-red); transform-origin: left center; animation: pm-meter-in 600ms var(--pm-ease) both; }
@keyframes pm-meter-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .pm-meter__bar { animation: none; } }

@media (max-width: 640px) {
    .pm-projects__row form { margin-left: 0; }
    .pm-save-project select, .pm-save-project input[type="text"] { max-width: 100%; flex: 1 1 160px; }
}
