/* Customer project portal: project.php, account.php, my.php, and the bench
   cam panel on the showcase. Theme tokens only; every control is at least
   40px tall so it can be hit with a thumb. */

/* ── Shell ────────────────────────────────────────────────────── */
.pr-wrap {
  position: relative;
  z-index: 10;
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 16px 28px;
}
.pr-wrap-narrow { max-width: 520px; }
/* Buttons and flex rows set their own display, which would otherwise beat the attribute. */
.pr-wrap [hidden] { display: none !important; }

.pr-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.pr-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  text-decoration: none;
}
.pr-brand img { width: 30px; height: auto; filter: drop-shadow(0 0 10px var(--violet-dim)); }
.pr-brand span {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
}
.pr-top-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 4px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--violet-hot);
  text-decoration: none;
  white-space: nowrap;
}
.pr-top-link:hover { color: var(--ink); }

.pr-btn { min-height: 40px; }

.pr-head { margin-bottom: 18px; }
.pr-head h1 {
  font-size: clamp(1.35rem, 1.05rem + 1.6vw, 2rem);
  letter-spacing: 0.04em;
  line-height: 1.15;
  overflow-wrap: anywhere;
  margin-bottom: 8px;
}
.pr-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-size: 13px;
  color: var(--ink-dim);
}
.pr-lead { font-size: 14px; line-height: 1.7; color: var(--ink-dim); margin-bottom: 20px; }

.pr-section { margin-bottom: 26px; }
.pr-section > h2 {
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--violet-hot);
  margin-bottom: 12px;
}

.pr-empty {
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 5px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-faint);
  text-align: center;
}

/* ── Account nudge ────────────────────────────────────────────── */
.pr-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 12px 14px;
  margin-bottom: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: color-mix(in srgb, var(--violet) 7%, transparent);
}
.pr-banner p { font-size: 13px; line-height: 1.55; color: var(--ink); flex: 1 1 220px; }

/* ── Live cam ─────────────────────────────────────────────────── */
.pr-cam {
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow-plate);
}
.pr-cam[hidden] { display: none; }
.pr-cam-screen { position: relative; aspect-ratio: 16 / 9; background: var(--bg); }
.pr-cam-screen video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pr-cam-wait {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.pr-cam.is-live .pr-cam-wait { display: none; }
.pr-cam-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
}
.pr-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-faint);
}
.pr-cam.is-live .pr-dot { background: var(--danger); box-shadow: 0 0 8px var(--danger); animation: pr-pulse 1.6s ease-in-out infinite; }
@keyframes pr-pulse { 50% { opacity: 0.45; } }

/* The showcase's version of the panel, under the Our Work heading. */
.pr-cam.pr-live {
  max-width: 560px;
  margin: 0 0 2.25rem;
  border-color: var(--line-strong);
  box-shadow: var(--shadow-plate), var(--glow-violet);
}

/* ── Rows: invoices, projects, quotes ─────────────────────────── */
.pr-list { display: flex; flex-direction: column; gap: 10px; }
.pr-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: var(--bg-card);
}
.pr-row-main { min-width: 0; flex: 1 1 200px; }
.pr-row-title {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.pr-row-title a { color: inherit; text-decoration: none; }
.pr-row-title a:hover { color: var(--violet-hot); }
.pr-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-faint);
}
.pr-row-note { display: block; margin-top: 4px; font-size: 12.5px; line-height: 1.5; color: var(--ink-dim); overflow-wrap: anywhere; }
.pr-row-side { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.pr-money { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 13px; color: var(--ink); white-space: nowrap; }
.pr-unread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--violet);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

/* ── Thread ───────────────────────────────────────────────────── */
.pr-thread { display: flex; flex-direction: column; gap: 14px; padding-bottom: 8px; }
.pr-msg { display: flex; flex-direction: column; max-width: 86%; align-self: flex-start; }
.pr-msg.is-me { align-self: flex-end; align-items: flex-end; }
.pr-meta {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
  padding: 0 2px;
  font-size: 11px;
  color: var(--ink-faint);
}
.pr-meta b { font-weight: 600; color: var(--ink-dim); }
.pr-bubble {
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 12px 12px 12px 3px;
  background: var(--bg-raised);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.pr-msg.is-me .pr-bubble {
  border-color: var(--line-strong);
  border-radius: 12px 12px 3px 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--violet) 24%, transparent), color-mix(in srgb, var(--violet-deep) 24%, transparent)), var(--bg-card);
}
.pr-pic {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-subtle);
  max-width: 280px;
}
.pr-pic img { display: block; width: 100%; height: auto; max-height: 360px; object-fit: cover; }
.pr-pic + .pr-bubble { margin-top: 6px; }

.pr-event {
  align-self: center;
  max-width: 92%;
  padding: 8px 12px;
  border-radius: 5px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-dim);
  text-align: center;
  overflow-wrap: anywhere;
}
.pr-event q { display: block; margin-top: 4px; color: var(--ink); quotes: none; white-space: pre-wrap; }
.pr-event time { display: block; margin-top: 2px; font-size: 11px; color: var(--ink-faint); }

/* ── Proof card ───────────────────────────────────────────────── */
.pr-proof {
  align-self: stretch;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow-plate);
}
.pr-proof.is-pending { box-shadow: var(--shadow-plate), var(--glow-violet); }
.pr-proof-img { display: block; background: var(--bg-subtle); }
.pr-proof-img img { display: block; width: 100%; height: auto; max-height: 70vh; object-fit: contain; }
.pr-proof-body { padding: 14px; }
.pr-proof-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.pr-proof-title { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--ink); overflow-wrap: anywhere; }
.pr-proof-ver {
  display: block;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.pr-proof-note { font-size: 13.5px; line-height: 1.6; color: var(--ink-dim); white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 6px; }
.pr-proof-decision {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 4px;
  background: var(--line-soft);
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-dim);
}
.pr-proof-decision strong { color: var(--ink); font-weight: 600; }
.pr-proof-decision q { display: block; margin-top: 4px; color: var(--ink); quotes: none; white-space: pre-wrap; overflow-wrap: anywhere; }
.pr-proof-ask { margin-top: 12px; font-size: 12.5px; color: var(--ink-dim); }
.pr-actions { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 10px; }
.pr-actions[hidden] { display: none; }
.pr-actions .btn { min-height: 44px; width: 100%; }
@media (min-width: 520px) {
  .pr-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.pr-decide { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.pr-decide[hidden] { display: none; }
.pr-decide p { font-size: 13px; color: var(--ink); }
.pr-decide textarea { min-height: 5rem; font-size: 16px; }
.pr-decide-row { display: flex; gap: 8px; }
.pr-decide-row .btn { flex: 1 1 0; min-height: 44px; }

.pr-err { font-size: 12.5px; line-height: 1.5; color: var(--danger); }
.pr-err:empty { display: none; }

/* ── Composer ─────────────────────────────────────────────────── */
.pr-composer {
  position: sticky;
  bottom: 0;
  z-index: 20;
  margin: 10px -16px 0;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.pr-composer[hidden] { display: none; }
.pr-compose-row { display: flex; align-items: flex-end; gap: 6px; }
.pr-compose-row textarea {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  max-height: 160px;
  padding: 10px 12px;
  font-size: 16px;
  line-height: 1.4;
  resize: none;
}
.pr-icon-btn {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: color-mix(in srgb, var(--violet) 6%, transparent);
  color: var(--violet-hot);
  cursor: pointer;
  letter-spacing: 0;
}
.pr-icon-btn:hover { background: color-mix(in srgb, var(--violet) 16%, transparent); color: var(--ink); }
.pr-icon-btn svg { width: 20px; height: 20px; }
.pr-send { flex: 0 0 auto; min-height: 44px; padding: 0 14px; }
.pr-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.pr-attach {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 12.5px;
  color: var(--ink-dim);
}
.pr-attach[hidden] { display: none; }
.pr-attach img { width: 44px; height: 44px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }
.pr-attach span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-compose-err { margin-top: 6px; }
.pr-closed {
  margin-top: 10px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-dim);
}
.pr-closed[hidden] { display: none; }

/* ── Account forms ────────────────────────────────────────────── */
.pr-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  overflow: hidden;
}
.pr-tabs a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
  text-decoration: none;
}
.pr-tabs a[aria-current="page"] { background: color-mix(in srgb, var(--violet) 18%, transparent); color: var(--ink); }
.pr-form { display: flex; flex-direction: column; gap: 14px; }
.pr-form input { min-height: 44px; font-size: 16px; }
.pr-form .btn { min-height: 46px; width: 100%; margin-top: 4px; }
.pr-note { font-size: 12.5px; line-height: 1.6; color: var(--ink-faint); }
.pr-stack { display: flex; flex-direction: column; gap: 12px; }
.pr-stack .btn { min-height: 46px; width: 100%; }

@media (min-width: 861px) {
  .pr-wrap { padding-top: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .pr-cam.is-live .pr-dot { animation: none; }
}
.pr-empty-steps p { margin: 0; }
.pr-empty-steps p + p { margin-top: 0.9rem; }
