/* Message parts (packages/ui/parts.js) — the widgets a chat answer carries. The same pill colours as Rēķini. */
.pt { margin-top: 10px; }
.pt-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.pt-h b { font-size: 14.5px; font-weight: 650; color: var(--bc-ink); }
.pt-h small, .pt-note { font-size: 12.5px; color: var(--bc-ink-3); }
.pt-note { margin: 8px 0 0; }
.pt-empty { margin: 2px 0 0; font-size: 14px; color: var(--bc-ink-2); }
.pt-sum { display: inline-flex; gap: 14px; font-size: 13px; color: var(--bc-ink-3); }
.pt-sum b { font-size: 15px; font-weight: 700; color: var(--bc-ink); font-variant-numeric: tabular-nums; }
.pt-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(31, 16, 38, .06); }
.pt-foot small { font-size: 12.5px; color: var(--bc-ink-3); }
.pt-foot .pt-link { margin: 0; flex: none; padding: 6px 12px; font-size: 13px; }

.pt-h--stats { margin: 12px 0 -2px; }
.pt-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.pt-stat { flex: 1 1 120px; padding: 12px 14px; border-radius: 16px; background: #fff; box-shadow: 0 0 0 1px rgba(31, 16, 38, .06); }
.pt-stat b { display: block; font-size: 20px; font-weight: 700; letter-spacing: -.01em; color: var(--bc-ink); font-variant-numeric: tabular-nums; }
.pt-stat span { font-size: 12.5px; color: var(--bc-ink-3); }

.pt-list, .pt-record, .pt-needs, .pt-q { padding: 14px 16px; border-radius: 18px; background: rgba(255, 255, 255, .94); box-shadow: 0 0 0 1px rgba(31, 16, 38, .05), 0 12px 30px -24px rgba(74, 29, 87, .45); }
.pt-scroll { overflow-x: auto; max-height: 340px; overflow-y: auto; margin: 0 -4px; }
.pt-list table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.pt-list th { text-align: left; font-weight: 600; font-size: 12px; color: var(--bc-ink-3); padding: 4px 6px 6px; position: sticky; top: 0; background: #fff; }
.pt-list td { padding: 7px 6px; border-top: 1px solid rgba(31, 16, 38, .06); color: var(--bc-ink-2); vertical-align: top; }
.pt-list td.c-number, .pt-list td.c-title, .pt-list td.c-who, .pt-list td.c-label { color: var(--bc-ink); font-weight: 550; }
.pt-list td.c-number, .pt-list td.c-date, .pt-list td.c-due, .pt-list td.c-starts, .pt-list td.c-ends, .pt-list td.c-last { white-space: nowrap; }
.pt-list .pt-h { margin-bottom: 4px; }
.pt-list .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.pt-list td:last-child { text-align: right; }
.pt-list th:last-child { text-align: right; }
.pt-pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pt-pill--wait { background: #F4EDDD; color: #7A5A16; }
.pt-pill--paid { background: var(--bc-sage-tint); color: var(--bc-sage); }
.pt-pill--part { background: #EFEAF6; color: var(--bc-plum); }
.pt-pill--draft { background: #F1E9E1; color: #7d5537; }
.pt-pill--rev { background: #FBE7DC; color: #9A4B22; }
.pt-pill--off { background: #EEECF1; color: var(--bc-ink-3); }
.pt-pill--late { background: #FBE3E6; color: #a3223b; }

.pt-record dl, .pt-qf { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 16px; margin: 0; }
.pt-record dt, .pt-qf dt { font-size: 12px; color: var(--bc-ink-3); }
.pt-record dd, .pt-qf dd { margin: 1px 0 0; font-size: 14px; color: var(--bc-ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.pt-notice { padding: 10px 14px; border-radius: 14px; font-size: 13.5px; line-height: 1.45; }
.pt-notice--info { background: rgba(31, 16, 38, .04); color: var(--bc-ink-2); }
.pt-notice--limit { background: #F4EDDD; color: #6b4f12; }
.pt-notice--error { background: #FBE3E6; color: #8a1d33; }

.pt-link { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 0; border-radius: 999px; background: var(--bc-plum-tint); color: var(--bc-plum); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.pt-link:hover { background: #e6dcf0; }
.pt-link:focus-visible, .pt-needs button:focus-visible { outline: 2px solid var(--bc-focus); outline-offset: 2px; }

.pt-needs ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pt-needs button { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 12px; padding: 10px 12px; border: 0; border-radius: 14px; background: #fff; box-shadow: 0 0 0 1px rgba(31, 16, 38, .06); font: inherit; text-align: left; cursor: pointer; }
.pt-needs button:hover { box-shadow: 0 0 0 1px rgba(74, 29, 87, .25); }
.pt-needs b { font-size: 17px; font-weight: 700; color: var(--bc-ink); font-variant-numeric: tabular-nums; min-width: 2.5ch; }
.pt-needs span { font-size: 14px; color: var(--bc-ink); }
.pt-needs small { font-size: 12.5px; color: var(--bc-plum); white-space: nowrap; }

.pt-q .pt-h b { font-size: 15px; line-height: 1.4; }
.pt-q .pt-qf { margin: 4px 0 10px; }
.pt-qb { display: flex; flex-wrap: wrap; gap: 8px; }
.pt-qf-form { display: flex; gap: 8px; }
.pt-qf-form input { flex: 1; min-width: 0; padding: 9px 12px; border-radius: 12px; border: 1px solid rgba(31, 16, 38, .14); font: inherit; font-size: 15px; background: #fff; }
.pt-qf-form input:focus-visible { outline: 2px solid var(--bc-focus); outline-offset: 1px; }
.pt-err { margin: 8px 0 0; font-size: 13px; color: #8a1d33; }
.pt-q.is-done { background: rgba(255, 255, 255, .7); }
.pt-qa { margin: 4px 0 0; font-size: 14px; color: var(--bc-sage); }
.pt-qa b { color: var(--bc-ink); }

@media (max-width: 520px) {
  .pt-list, .pt-record, .pt-needs, .pt-q { padding: 12px; border-radius: 16px; }
  .pt-qf-form { flex-direction: column; }
  .pt-stat b { font-size: 18px; }
}

/* a list switches to stacked rows when its card is narrow (a phone, the app rail) */
.pt-list { container-type: inline-size; }
.pt-rows { display: none; }
.pt-row { padding: 9px 0; border-top: 1px solid rgba(31, 16, 38, .06); }
.pt-r1, .pt-r2 { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.pt-r1 b { font-size: 14px; font-weight: 650; color: var(--bc-ink); }
.pt-r1 .num { font-size: 14px; font-weight: 650; color: var(--bc-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pt-r2 { margin-top: 3px; align-items: center; }
.pt-r2 span:first-child { font-size: 12.5px; color: var(--bc-ink-2); min-width: 0; }
@container (max-width: 520px) {
  .pt-rows { display: block; }
  .pt-list .pt-scroll { display: none; }
  .pt-list .pt-h { flex-direction: column; align-items: flex-start; gap: 4px; }
  .pt-foot { flex-wrap: wrap; }
}
.pt-list--empty { padding-block: 10px; }
.pt-list--empty .pt-h { align-items: center; margin: 0; }
.pt-list--empty .pt-h > span { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.pt-list--empty .pt-empty { margin: 0; font-size: 13.5px; color: var(--bc-ink-3); }
.pt-list--empty .pt-link { margin: 0; flex: none; padding: 6px 12px; font-size: 13px; }
.pt-statcard .pt-stats { margin-top: 2px; }
.pt-statcard .pt-stat { box-shadow: none; background: var(--bc-plum-tint); }
.pt-statcard .pt-foot small { line-height: 1.5; }
