.pc-panel { min-width: 0; margin-bottom: 14px; }
.pc-header { padding: 13px 16px; border-left: 3px solid var(--brand-orange); }
.pc-header p, .pc-empty, .pc-context { color: var(--muted); font-size: 13px; }
.pc-header p { margin-top: 3px; }
.pc-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.pc-feedback:not(:empty) { padding: 9px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
.pc-records > .pc-empty, .pc-records > .button { margin: 14px 16px; }
.pc-group { padding: 12px 16px; }
.pc-group + .pc-group { border-top: 1px solid var(--line); }
.pc-group h3, .pc-review-copy h3 { margin: 0 0 5px; color: var(--ink); font-size: 14px; }
.pc-list { margin: 0; padding: 0; list-style: none; }
.pc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px 12px;
  padding: 8px 0;
}
.pc-row + .pc-row { border-top: 1px solid var(--line); }
.pc-row-info { min-width: 0; overflow-wrap: anywhere; }
.pc-row-info strong { font-size: 14px; }
.pc-row-info p { margin-top: 3px; color: var(--muted); font-size: 13px; }
.pc-status {
  padding: 2px 6px;
  border: 1px solid #cddbec;
  background: #f0f5fb;
  color: #274969;
  font-size: 12px;
  font-weight: 700;
}
.pc-status[data-state="signed"] { border-color: #c8e0d1; background: #edf7f0; color: #244f40; }
.pc-status[data-state="revoked"] { border-color: #dfd6e6; background: #f5f1f8; color: #4e445e; }
.pc-row .button { min-height: 38px; padding: 5px 9px; font-size: 13px; }

.pc-dialog { width: min(760px, calc(100% - 24px)); overflow: auto; }
.pc-dialog .dialog-head { position: sticky; z-index: 1; top: 0; background: var(--paper); }
.pc-dialog .dialog-head h2 { overflow-wrap: anywhere; }
.pc-dialog .dialog-footer { position: sticky; z-index: 1; bottom: 0; }
.pc-dialog[aria-busy] .pc-dialog-body { opacity: .68; }
.pc-dialog-error { margin: 0 19px 14px; }
.pc-mode-choices { display: grid; gap: 9px; }
.pc-mode-choices .pc-mode {
  display: grid;
  gap: 3px;
  min-height: 63px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand-orange);
  background: #f8fbfe;
  color: var(--ink);
  font-weight: 720;
  text-align: left;
}
.pc-mode-choices .pc-mode span { color: var(--muted); font-size: 13px; font-weight: 500; }
.pc-mode-choices .pc-mode:hover { background: #edf5fc; border-top-color: #9bb7d0; border-right-color: #9bb7d0; border-bottom-color: #9bb7d0; }

.pc-draft-form, .pc-field { display: grid; gap: 10px; min-width: 0; }
.pc-field { gap: 4px; }
.pc-field span { font-size: 13px; font-weight: 700; }
.pc-field input, .pc-field textarea, .pc-field select, .pc-signature input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 7px 9px;
  border: 1px solid #bac9da;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}
.pc-field input[readonly] { background: #f3f6fa; }
.pc-field textarea { min-height: 102px; resize: vertical; }
.pc-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pc-templates { display: grid; gap: 8px; }
.pc-templates .pc-context:empty { display: none; }
.pc-template-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.pc-items { display: grid; justify-items: start; gap: 7px; margin: 0; padding: 10px; border: 1px solid var(--line); }
.pc-items legend { padding-inline: 4px; color: var(--ink); font-size: 13px; font-weight: 700; }
.pc-items-entries { display: grid; width: 100%; gap: 8px; }
.pc-items-entries:empty { display: none; }
.pc-item { display: grid; grid-template-columns: minmax(128px, 2fr) repeat(3, minmax(65px, 1fr)) auto; align-items: end; gap: 7px; }
.pc-item + .pc-item { padding-top: 8px; border-top: 1px solid var(--line); }
.pc-item-remove { min-height: 42px; font-size: 12px; }
.pc-items-total:empty, .pc-copy-status:empty { display: none; }
.pc-items-total { color: var(--muted); font-size: 13px; }

.pc-review-status { color: var(--steel); font-size: 13px; font-weight: 700; }
.pc-review-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 14px;
  margin: 0;
  padding: 11px 13px;
  border: 1px solid var(--line);
  background: #f8fbfe;
}
.pc-review-meta dt { color: var(--muted); font-size: 12px; font-weight: 700; }
.pc-review-meta dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.pc-review-copy p { white-space: pre-wrap; }
.pc-review-items { margin: 0; padding-inline-start: 18px; overflow-wrap: anywhere; }
.pc-delivery, .pc-preview { display: grid; gap: 8px; padding: 11px 13px; border: 1px solid var(--line); background: #f8fbfe; }
.pc-copy-status { color: var(--muted); font-size: 13px; }
.pc-preview { justify-items: start; }
.pc-preview-frame { width: 100%; min-height: 55vh; border: 1px solid var(--line); background: var(--paper); }
.pc-danger { min-height: 42px; border: 1px solid #d2aeb5; background: #fff5f5; color: #922a39; }
.pc-danger:hover:not(:disabled) { background: #fee9e9; }
.pc-consent { display: flex; align-items: start; gap: 8px; font-size: 14px; }
.pc-consent input { min-width: 18px; min-height: 18px; margin: 2px 0 0; accent-color: var(--steel); }

.pc-signature .cs-signature { min-width: 0; margin: 0; padding: 10px; border: 1px solid var(--line); }
.pc-signature .cs-signature legend, .pc-signature .cs-signature label { font-size: 13px; font-weight: 700; }
.pc-signature .cs-signature-tabs { display: flex; flex-wrap: wrap; gap: 7px; padding-bottom: 8px; }
.pc-signature .cs-signature-tabs button, .pc-signature .cs-clear {
  min-height: 40px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
}
.pc-signature .cs-signature-tabs button.active { border-color: #9bb7d0; background: #edf5fc; }
.pc-signature .cs-help, .pc-signature .cs-signature-state { margin-block: 5px; color: var(--muted); font-size: 13px; }
.pc-signature .cs-canvas-wrap { position: relative; min-height: 180px; border: 1px solid #bac9da; background: #fff; }
.pc-signature .cs-canvas-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.pc-signature .cs-canvas-wrap span { position: absolute; bottom: 7px; left: 10px; color: var(--muted); font-size: 13px; pointer-events: none; }
.pc-signature .cs-canvas-wrap.has-signature span { visibility: hidden; }
.pc-signature .cs-clear { margin-top: 7px; }
.pc-signature .cs-typed-preview { margin-top: 3px; font-family: cursive; font-size: 24px; overflow-wrap: anywhere; }

@media (max-width: 640px) {
  .pc-header, .pc-group { padding-inline: 12px; }
  .pc-dialog .dialog-head, .pc-dialog-body, .pc-dialog .dialog-footer { padding-inline: 12px; }
  .pc-dialog-error { margin-inline: 12px; }
  .pc-item { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pc-item .pc-field:first-child { grid-column: 1 / -1; }
  .pc-item .pc-item-remove { justify-self: start; grid-column: 1 / -1; }
}
@media (max-width: 420px) {
  .pc-form-grid, .pc-review-meta, .pc-template-row { grid-template-columns: 1fr; }
  .pc-row { grid-template-columns: minmax(0, 1fr) auto; }
  .pc-row-info { grid-column: 1 / -1; }
  .pc-row .button { justify-self: end; }
}
