.pc-view{display:grid;gap:22px}.pc-head,.pc-listhead,.pc-actions{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap}.pc-head h1{margin:0;font-size:clamp(1.75rem,3vw,2.2rem);line-height:1.15;letter-spacing:-.04em}.pc-head p,.pc-empty p{margin:.45rem 0 0;color:var(--muted,#596677)}.pc-view h2{font-size:1.12rem;margin:0;color:inherit}.pc-panel{padding:0;overflow:hidden}.pc-listhead,.pc-tabs{padding:20px 22px} .pc-tabs {
  display:grid;grid-template-columns:repeat(auto-fit,minmax(min(8.3rem,100%),1fr));
  gap:7px;padding-top:0;padding-bottom:16px;
}
.pc-tabs button {
  display:flex;align-items:center;justify-content:space-between;gap:6px;min-width:0;
  min-height:44px;padding:6px 9px;background:white;border:1px solid var(--line);border-radius:8px;
  font:inherit;font-size:.875rem;font-weight:550;line-height:1.25;text-align:left;color:#44494c;
}
.pc-tabs button:hover{background:#f4f7f5}
.pc-tabs button.selected{background:var(--soft);border-color:#7eaf9d;color:#005f46}
.pc-filter-label{overflow-wrap:anywhere}
.pc-filter-count {
  flex:none;min-width:1.55rem;padding:3px 5px;border-radius:6px;
  color:#363d40;background:#eef0f1;text-align:center;font-size:.84rem;
  font-weight:700;line-height:1.25;font-variant-numeric:tabular-nums;
}
.pc-tabs button.selected .pc-filter-count{color:white;background:var(--green)}
.pc-table .pc-reference{overflow-wrap:anywhere;color:var(--ink)}
.pc-form .pc-field input[readonly]{background:#f4f6f5;color:#46564e}
/* Three compact columns when space permits, two when text grows or the screen narrows. */
@media(max-width:720px){
  .pc-tabs{grid-template-columns:repeat(auto-fit,minmax(min(100%,max(6.35rem,30%)),1fr));gap:6px}
  .pc-tabs button{min-height:max(44px,2.75rem);padding:5px 7px;gap:4px}
  .pc-filter-count{min-width:1.3rem;padding:2px 4px}
}
.pc-search{display:flex;gap:8px;align-items:center;border:1px solid #d7dce0;border-radius:8px;padding:8px 10px;background:white}.pc-search input{border:0!important;outline:0;min-width:8rem;background:transparent;color:var(--ink);font:inherit;font-size:.9rem}.pc-search:focus-within{outline:2px solid var(--green)}.pc-table{width:100%;border-collapse:collapse;text-align:left;font-size:.93rem}.pc-table th,.pc-table td{padding:13px 20px;border-top:1px solid #e5e9eb}.pc-table th{background:#f7f8f9;font-size:.83rem;color:#50565b;font-weight:600}.pc-table small,.pc-history small{display:block;font-size:.8rem;color:var(--muted);margin-top:4px}.pc-status{display:inline-flex;align-items:center;white-space:nowrap;padding:4px 9px;border-radius:7px;background:#eef0f2;color:#484e52;font-size:.8rem;font-weight:600}.pc-blue{background:#edf1f2;color:#45515b}.pc-amber{background:#f7eaf0;color:#83405b}.pc-red{background:#ffe6eb;color:#a91d37}.pc-green,.pc-teal{background:#dff5eb;color:#006246}.pc-empty{padding:36px 20px 42px;text-align:center}.pc-symbol{display:inline-flex;width:48px;height:48px;align-items:center;justify-content:center;border-radius:14px;background:#e9f5f0}.pc-empty h3{font-size:1.05rem}.pc-empty .btn{margin-top:16px}.pc-detail{display:grid;grid-template-columns:1.2fr 1fr;gap:20px;align-items:start}.pc-card{padding:20px}.pc-info{margin:15px 0}.pc-info>div{display:grid;grid-template-columns:135px 1fr;gap:12px;padding:10px 0;border-top:1px solid #e8ebed;font-size:.95rem}.pc-info dt{color:var(--muted)}.pc-info dd{margin:0;overflow-wrap:anywhere}.pc-actions{justify-content:flex-start}.pc-history{margin:16px 0 0;padding-left:20px}.pc-history li{padding:0 0 15px 5px}.pc-history p{font-size:.88rem;color:#50575b;margin:5px 0;overflow-wrap:anywhere}.pc-back{justify-self:start}.pc-form,.pc-fields,.pc-lines,.pc-destination{display:grid;gap:12px}.pc-field{display:grid;gap:5px;font-size:.9rem;font-weight:550}.pc-field input,.pc-field textarea,.pc-field select{font:inherit;width:100%;padding:9px 10px;border:1px solid #cfd6d9;border-radius:7px;background:white;color:inherit;min-width:0}.pc-field textarea{resize:vertical}.pc-columns{display:grid;grid-template-columns:1fr 1fr;gap:10px}.pc-line{border:1px solid #dce1e3;border-radius:10px;padding:12px;min-width:0}.pc-line legend{font-weight:650;font-size:.95rem;padding:0 5px}.pc-remove{margin-top:9px}.pc-form>.btn{justify-self:start}.pc-duplicate{font-size:.85rem;color:#93243a;background:#ffecef;border-radius:7px;padding:9px}.pc-view [hidden],.pc-form [hidden],.pc-destination [hidden]{display:none!important}@media(max-width:720px){.pc-detail{grid-template-columns:1fr}.pc-head{align-items:flex-start}.pc-search{width:100%}.pc-table th,.pc-table td{padding:10px}.pc-table th:nth-child(3),.pc-table td:nth-child(3){display:none}.pc-listhead,.pc-tabs{padding-left:14px;padding-right:14px}.pc-info>div{grid-template-columns:105px 1fr}.pc-search input{width:100%}}@media(max-width:430px){.pc-table th:last-child,.pc-table td:last-child{display:none}}

.pc-duplicate ul{margin:6px 0;padding-left:1.2rem;overflow-wrap:anywhere}
.pc-duplicate .pc-check{min-height:44px;cursor:pointer;font-weight:600}
.pc-check{display:flex;align-items:center;gap:8px;font-size:.9rem}.pc-check input{width:1rem;height:1rem;flex-shrink:0}

.pc-field-error{font-size:.9rem;color:#983d32;margin:8px 0}.pc-line [aria-invalid="true"]{border-color:#b04a3a}

/* Keep the purchase actions outside the scrolling list, including when the keyboard opens. */
#lm-dialog.purchase-dialog[open] {
  --pc-visible-height: var(--lm-purchase-vh, 100vh);
  --pc-gap: 12px;
  --pc-available: calc(var(--pc-visible-height) - var(--pc-gap) * 2);
  max-height: var(--pc-available);
  overflow: hidden;
  background: white;
}
@supports (height: 100dvh) {
  #lm-dialog.purchase-dialog[open] { --pc-visible-height: var(--lm-purchase-vh, 100dvh); }
}
#lm-dialog.purchase-dialog > form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin: 0;
  max-height: calc(var(--pc-available) - 2px);
}
#lm-dialog.purchase-dialog .dialog-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scroll-padding-block: 12px;
}
#lm-dialog.purchase-dialog .dialog-head,
#lm-dialog.purchase-dialog .dialog-foot,
#lm-dialog.purchase-dialog .dialog-error {
  flex: 0 0 auto;
}
#lm-dialog.purchase-dialog .dialog-foot {
  position: static;
  background: #fff;
  box-shadow: 0 -2px 9px #151b1d0c;
}
#lm-dialog.purchase-dialog .dialog-foot button {
  min-height: 46px;
  touch-action: manipulation;
}
@media(max-width:430px){
  #lm-dialog.purchase-dialog .pc-request-actions{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr)}
  #lm-dialog.purchase-dialog .pc-request-actions [data-close]{display:none}
  #lm-dialog.purchase-dialog .pc-request-actions [data-pc-intent]{white-space:normal}
}
#lm-dialog.purchase-dialog .dialog-error:empty { display: none; }
#lm-dialog.purchase-dialog .dialog-error:not(:empty) {
  padding: 7px 16px;
  color: #93243a;
  background: #ffecef;
  border-top: 1px solid #e9bdc6;
  line-height: 1.4;
  overflow-wrap: anywhere;
  max-height: max(34px, calc(var(--pc-visible-height) * .18));
  overflow-y: auto;
}
#lm-dialog.purchase-dialog .dialog-body :is(input:not([type="checkbox"]), select, textarea) {
  font-size: max(16px, 1rem);
}
@media (max-width: 680px), (max-height: 540px) {
  #lm-dialog.purchase-dialog[open] {
    --pc-gap: 6px;
    --pc-safe-top: max(var(--pc-gap), env(safe-area-inset-top, 0px));
    --pc-safe-bottom: max(var(--pc-gap), env(safe-area-inset-bottom, 0px));
    --pc-available: calc(var(--pc-visible-height) - var(--pc-safe-top) - var(--pc-safe-bottom));
    position: fixed;
    inset: auto max(6px, env(safe-area-inset-right, 0px)) auto max(6px, env(safe-area-inset-left, 0px));
    top: calc(var(--lm-purchase-top, 0px) + var(--pc-safe-top));
    width: auto;
    max-width: 560px;
    margin: 0 auto;
  }
  #lm-dialog.purchase-dialog .dialog-head,
  #lm-dialog.purchase-dialog .dialog-foot {
    padding: clamp(4px, calc(var(--pc-visible-height) * .015), 11px) 14px;
    gap: 8px;
  }
  #lm-dialog.purchase-dialog .dialog-head h2 { font-size: 1.12rem; }
  #lm-dialog.purchase-dialog .dialog-head .plain { min-width: 40px; min-height: 36px; }
  #lm-dialog.purchase-dialog .dialog-foot .primary { flex: 1 1 auto; }
  #lm-dialog.purchase-dialog .dialog-body { padding: 12px 14px; }
  #lm-dialog.purchase-dialog .dialog-error:not(:empty) { padding: 5px 14px; }
}

.pc-shelf-list{margin-top:8px;min-height:44px;max-width:100%}
.pc-place-prompt{margin:12px 0;padding:12px 14px;border:1px solid #c4e3d5;border-radius:9px;background:#edf8f2;color:#104e37}
.pc-storage-list{margin:8px 0;padding-left:1.2rem}
.pc-storage-list li{margin:6px 0;overflow-wrap:anywhere}.pc-place-prompt{overflow-wrap:anywhere}.pc-place-prompt p{margin:5px 0 9px;line-height:1.5}.pc-place-prompt p:last-child{margin-bottom:0}
.pc-location-help{margin:0;color:var(--muted);font-size:.9rem;line-height:1.45}

.pc-receipt { gap:18px; }
.pc-receipt header p { margin:4px 0 0; color:var(--muted); }
.pc-receipt-plan { display:grid; gap:4px; padding:12px 14px; border:1px solid #b9dfcc; border-radius:10px; background:#edf7f1; color:#184c35; overflow-wrap:anywhere; }
.pc-receipt-plan small { font-weight:600; }
.pc-receipt-plan span,.pc-receipt-known { font-size:.9rem; }
.pc-receipt-known { margin:0; color:var(--muted); overflow-wrap:anywhere; }
.pc-receipt-fields,.pc-receipt-group { margin:0; padding:0; border:0; min-width:0; }
.pc-receipt-group legend { font-weight:600; padding:0; margin-bottom:7px; }
.pc-receipt [hidden] { display:none !important; }
.pc-receipt-choices { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.pc-receipt-choice { display:flex; align-items:center; gap:8px; border:1px solid #cdd6d0; border-radius:8px; padding:10px; min-height:44px; cursor:pointer; line-height:1.35; }
.pc-receipt-choice input { flex:none; margin:0; accent-color:var(--green); }
.pc-receipt-choice:has(:checked) { border-color:var(--green); background:#edf7f1; }
.pc-receipt-choice:has(:disabled) { color:var(--muted); opacity:.62; cursor:default; }
.pc-receipt-choice small { display:block; }
.pc-receipt [data-partial-amount] { margin-top:8px; }
.pc-receipt-extra { padding:8px 0; }
.pc-receipt-extra summary { cursor:pointer; font-weight:600; }
.pc-receipt-extra[open] summary { margin-bottom:10px; }
@media(max-width:400px){ .pc-receipt-choices { grid-template-columns:1fr; } }

.pc-table .pc-amounts{color:var(--ink);font-weight:600}
.pc-issue-form [hidden]{display:none!important}
.pc-issue-form>p,.pc-issues p{margin:0;overflow-wrap:anywhere}
.pc-return-codes{display:grid;gap:6px;max-height:14rem;overflow:auto}
.pc-return-codes label,.pc-return-check{display:flex;gap:9px;align-items:center;min-height:44px;padding:7px 10px;border:1px solid var(--line);border-radius:8px;overflow-wrap:anywhere}
.pc-return-codes input,.pc-return-check input{flex:none;accent-color:var(--green)}
.pc-issues{list-style:none;margin:12px 0 0;padding:0}
.pc-issues li{display:grid;gap:6px;justify-items:start;border-top:1px solid var(--line);padding:12px 0;overflow-wrap:anywhere}
.pc-issues small{color:var(--muted)}
.pc-return-review h3{margin:0;font-size:1rem}.pc-return-review ul{list-style:none;margin:7px 0;padding:0;max-height:13rem;overflow:auto}.pc-return-review li{display:grid;gap:2px;padding:6px 0;border-top:1px solid var(--line);overflow-wrap:anywhere}.pc-return-review small{color:var(--muted)}.pc-return-review p{color:#70471c;margin:0}
.pc-return-history summary{cursor:pointer;font-weight:600}.pc-return-history>div{display:grid;gap:3px;padding:6px 0}

.pc-last-receipt{flex:0 1 auto;min-height:0;max-height:32vh;overflow:auto;margin:0;padding:8px 16px;border-top:1px solid var(--line);background:#f4f8f6;line-height:1.4;overflow-wrap:anywhere}
.pc-last-receipt [data-last-receipt]{display:grid;gap:1px;font-size:.94rem}
.pc-last-receipt small{display:block;color:#45554e;font-size:.86rem}
.pc-last-receipt [hidden],.pc-last-receipt[hidden]{display:none!important}
.pc-repeat-confirm{display:flex;align-items:center;gap:9px;min-height:44px;margin-top:4px;padding:4px 0;font-weight:650;cursor:pointer}
.pc-repeat-confirm small{font-weight:400}.pc-repeat-confirm input{width:18px;height:18px;flex:none;accent-color:var(--green)}
.pc-last-receipt p{margin:6px 0 0}
.pc-revision-note{padding:12px 14px;border-left:3px solid #b97716;background:#fff6e4;border-radius:8px;color:#543914}
.pc-revision-note p{margin:4px 0 0;white-space:pre-wrap;overflow-wrap:anywhere}
