/* Parties: pictures on the list and party pages, the party card and the printable card sheet.
   Colours come from the viz tone classes (--vc), so light, dark and print follow app.css. */

.ptn-kpis { margin-bottom: 18px; }
.ptn-kpis .kpi { min-height: 118px; }
.ptn-visuals { display: flex; flex-direction: column; gap: 22px; }
.ptn-charts { align-items: start; }

/* Kind mix: the stacked bar and the three groups as tappable cards */
.ptn-mix { display: flex; flex-direction: column; gap: 14px; }
.ptn-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.ptn-group { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 14px; background: var(--sunk); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.ptn-group-n { font-size: 26px; font-weight: 700; line-height: 1.1; }
.ptn-group-label { font-weight: 600; color: var(--ink-2); }
.ptn-group-kinds { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.ptn-kind-dot { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; color: var(--ink-2); text-decoration: none; }
.ptn-kind-dot:hover { color: var(--accent); text-decoration: underline; }
.ptn-kind-dot::before { content: ''; width: 10px; height: 10px; border-radius: 3px; background: var(--vc, var(--accent)); flex: none; }

/* Weekly trend in the table */
.ptn-spark { min-width: 100px; }
.ptn-spark svg { display: block; }

/* Party page: pictures beside the card */
.ptn-top { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; margin-bottom: 20px; }
.ptn-card-preview h2 { margin-top: 0; }
.ptn-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 14px 14px 12px; border-radius: 14px; background: #FFFFFF; color: #111; box-shadow: inset 0 0 0 1px var(--line-strong); overflow: hidden; }
.ptn-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 8px; background: var(--vc, var(--accent)); }
.ptn-card-code { font-family: var(--mono); font-weight: 700; font-size: 24px; letter-spacing: .03em; padding-left: 6px; }
.ptn-card-name { font-weight: 600; font-size: 16px; padding-left: 6px; }
.ptn-card-codes { display: flex; align-items: center; gap: 10px; padding-left: 6px; }
.ptn-qr { width: 92px; height: 92px; flex: none; image-rendering: pixelated; }
.ptn-barcode { min-width: 0; flex: 1; }
.ptn-barcode svg { display: block; max-width: 100%; height: auto; }

@media (max-width: 900px) {
  .ptn-top { grid-template-columns: minmax(0, 1fr); }
  .ptn-card-preview { max-width: 420px; }
}
@media (max-width: 520px) {
  .ptn-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ptn-kpis .kpi { min-height: 0; padding: 14px; }
  .ptn-kpis .kpi-value { font-size: 26px; }
  .ptn-group-n { font-size: 22px; }
  .ptn-card-code { font-size: 20px; }
}

/* Card sheet: A4, 2 × 5 cards of 85.6 × 54 mm */
.ptn-sheets { display: flex; flex-direction: column; gap: 24px; overflow-x: auto; }
.ptn-a4 { width: 210mm; min-height: 297mm; padding: 13mm 15mm; box-sizing: border-box; display: grid; grid-template-columns: repeat(2, 85.6mm); grid-auto-rows: 54mm; gap: 0 8mm; align-content: start; background: #FFFFFF; color: #111; box-shadow: 0 2px 12px rgba(0, 0, 0, .12); }
.ptn-label { position: relative; box-sizing: border-box; height: 54mm; padding: 3mm 3.5mm 2mm 5.5mm; display: flex; flex-direction: column; gap: 1mm; border: 0.2mm dashed #9AA39C; overflow: hidden; font-size: 9pt; color: #111; background: #FFFFFF; }
.ptn-label::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2.5mm; background: var(--vc, #2E7A4C); print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.ptn-label.is-off { opacity: .6; }
.ptn-label-head { display: flex; justify-content: space-between; gap: 2mm; font-size: 7pt; color: #444; }
.ptn-label-mill { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ptn-label-kind { font-weight: 700; white-space: nowrap; }
.ptn-label-body { display: flex; justify-content: space-between; gap: 2mm; flex: 1; min-height: 0; }
.ptn-label-text { display: flex; flex-direction: column; gap: .5mm; min-width: 0; }
.ptn-label-name { font-size: 11pt; font-weight: 700; line-height: 1.15; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ptn-label-area { font-size: 8pt; color: #444; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ptn-label-code { font-family: var(--mono); font-size: 15pt; font-weight: 700; letter-spacing: .03em; margin-top: auto; }
.ptn-label-qr { width: 23mm; height: 23mm; flex: none; image-rendering: pixelated; }
.ptn-label-bar { height: 9mm; }
.ptn-label-bar svg { display: block; width: 62mm; max-width: 100%; height: 9mm; }
.ptn-label-foot { font-size: 6.5pt; color: #555; }

@page ptnsheet { size: A4 portrait; margin: 0; }
@media print {
  .ptn-a4 { page: ptnsheet; }
  .ptn-sheets { gap: 0; overflow: visible; }
  .ptn-a4 { box-shadow: none; break-after: page; }
  .ptn-a4:last-child { break-after: auto; }
  .ptn-card-preview, .ptn-visuals { break-inside: avoid; }
}

/* Party form: the two names, one of which is needed (a mark in place of the core's "Optional") */
.ptn-one-of { white-space: normal; }
/* Party page: long dates with the person's name wrap at phone width */
.facts strong.ptn-wrap { white-space: normal; text-align: right; overflow-wrap: anywhere; }
