/* App-specific additions to Pico.css */
.inline-form { display: inline-block; margin: 0; }
.inline-form button, .inline-form select { margin: 0; padding: 0.25rem 0.75rem; width: auto; }
.narrow { max-width: 28rem; margin-inline: auto; }
.error { color: var(--pico-del-color); }
.warning { border-left: 4px solid #d9a400; padding-left: 0.75rem; }
.message.warning, article.warning { background: rgba(217, 164, 0, 0.08); }
.message.error { border-left: 4px solid var(--pico-del-color); padding-left: 0.75rem; }
.message.success { border-left: 4px solid var(--pico-ins-color); padding-left: 0.75rem; }
.heading-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; justify-content: space-between; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.actions > *, .actions button { margin-bottom: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.filters > * { flex: 1 1 10rem; margin-bottom: 0.5rem; }
.filters button { flex: 0 0 auto; }
button.danger, a.danger[role=button] { background: #b3261e; border-color: #b3261e; }
a.danger.outline[role=button] { background: transparent; color: #b3261e; }
a.danger:not([role]) { color: #b3261e; }
table.formset input, table.formset select { margin-bottom: 0; min-width: 7rem; }
.badge { display: inline-block; padding: 0 0.4rem; margin: 0 0.15rem 0.15rem 0; border-radius: 0.25rem; font-size: 0.8em; background: #e3e7eb; color: #222; white-space: nowrap; }
.badge.status-label_printed { background: #cfe2ff; }
.badge.status-result_submitted { background: #fff3cd; }
.badge.status-result_approved { background: #d1e7dd; }
.counters article { text-align: center; margin-bottom: 0.5rem; padding: 0.5rem; }
.counters strong { font-size: 1.4em; }
.badge.import-new { background: #d1e7dd; }
.badge.import-changed { background: #cfe2ff; }
.badge.import-uncertain { background: #fff3cd; }
.badge.import-error { background: #f8d7da; }
.badge.import-skipped { background: #e9ecef; color: #555; }
table.raw td, table.raw th { font-size: 0.8em; padding: 0.2rem 0.4rem; white-space: nowrap; }
table.raw tr.header-row td { font-weight: bold; background: rgba(13, 110, 253, 0.08); }
.steps ul { flex-wrap: wrap; }
img.label-large { width: 100%; max-width: 48rem; image-rendering: pixelated; border: 1px solid #ccc; border-radius: 0.5rem; }
img.label-original { width: 54mm; height: 17mm; image-rendering: pixelated; border: 1px dashed #aaa; border-radius: 1mm; vertical-align: middle; }
.agent-status.online { color: var(--pico-ins-color); font-weight: bold; }
.agent-status.offline { color: #b3261e; font-weight: bold; }
.badge.job-waiting { background: #fff3cd; }
.badge.job-in_progress { background: #cfe2ff; }
.badge.job-printed { background: #d1e7dd; }
.badge.job-error { background: #f8d7da; }
label.checkbox { display: flex; align-items: center; gap: 0.4rem; }
.scan-form input { margin: 0; padding: 0.2rem 0.6rem; height: auto; min-width: 11rem; font-size: 0.9em; }
.public-main { max-width: 36rem; padding-top: 1rem; }
.entry-info dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.2rem 0.8rem; margin: 0; }
.entry-info dd { margin: 0; }
.series-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: 0 0.5rem; }
.result-total { font-size: 1.6em; font-weight: bold; margin: 0; }
.result-summary { display: grid; grid-template-columns: max-content 1fr; gap: 0.2rem 0.8rem; }
.result-summary dd { margin: 0; }
img.sheet-photo { max-width: 100%; max-height: 70vh; border: 1px solid #ccc; border-radius: 0.4rem; }
img.sheet-thumb { max-width: 5rem; max-height: 5rem; }
.receipt-number { font-family: monospace; font-size: 1.3em; letter-spacing: 0.1em; }
.review-grid { display: grid; grid-template-columns: minmax(16rem, 1fr) minmax(16rem, 1fr); gap: 1rem; }
@media (max-width: 768px) { .review-grid { grid-template-columns: 1fr; } }
.review-item:focus { outline: 3px solid var(--pico-primary); }
article.flagged, .review-item.flagged { border-left: 6px solid #d9a400; }
tr.current-version { font-weight: bold; }
.reject-form input, .reject-form textarea { margin-bottom: 0; }
th.num, td.num { text-align: right; white-space: nowrap; }
tr.note-row td { color: #666; }
table.ranking td, table.ranking th { padding: 0.3rem 0.5rem; }
.team-member { display: flex; justify-content: space-between; gap: 1rem; max-width: 22rem; }
.team-member .num { font-variant-numeric: tabular-nums; }
.round-nav ul { flex-wrap: wrap; }
.competition-list li { margin-bottom: 0.4rem; }

/* Performance chart on "Meine Anmeldungen" (D-80) */
figure.chart { margin: 0 0 1rem; }
.performance-chart { width: 100%; height: auto; max-width: 48rem; display: block; }
.performance-chart text { font-size: 12px; fill: currentColor; }
.performance-chart .grid { stroke: currentColor; stroke-opacity: 0.15; }
.performance-chart polyline { stroke-width: 2; stroke-opacity: 0.7; }
.performance-chart circle { stroke: var(--pico-background-color, #fff); stroke-width: 1.5; }
.chart-legend { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; font-size: 0.85rem; }
.chart-legend li { list-style: none; margin: 0; }
.chart-legend .swatch { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 50%; margin-right: 0.35rem; vertical-align: -0.05rem; }
.performance-chart .trend { stroke: currentColor; stroke-opacity: 0.55; stroke-width: 2; stroke-dasharray: 6 5; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.6rem; margin: 0.5rem 0 1rem; }
.stat-card { border: 1px solid var(--pico-muted-border-color, #ddd); border-radius: 0.5rem; padding: 0.5rem 0.75rem; }
.stat-card .value { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-card .label { font-size: 0.8rem; opacity: 0.8; }
.trend-up { color: #1a7f37; } .trend-down { color: #c62828; } .trend-flat { opacity: 0.8; }

/* Annual championship (D-87) */
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; align-items: end; margin: 1rem 0 1.5rem; }
.podium-place { text-align: center; margin: 0; padding: 0.75rem 0.5rem; border-radius: 0.75rem; }
.podium-place .medal { font-size: 2rem; line-height: 1; }
.podium-place .podium-name { font-weight: 700; margin-top: 0.3rem; }
.podium-place .podium-total { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.podium .place-1 { order: 2; padding-top: 1.5rem; background: color-mix(in srgb, #d4a017 22%, transparent); }
.podium .place-2 { order: 1; background: color-mix(in srgb, #9e9e9e 22%, transparent); }
.podium .place-3 { order: 3; background: color-mix(in srgb, #b0703c 22%, transparent); }
table.annual .trend-col { white-space: nowrap; width: 3.5rem; font-weight: 600; }
table.annual .bar-col { width: 18%; min-width: 4rem; }
table.annual .bar { display: block; height: 0.55rem; border-radius: 0.3rem; background: #0072B2; opacity: 0.75; }
.badge-new { font-size: 0.75rem; padding: 0.05rem 0.35rem; border-radius: 0.3rem; background: color-mix(in srgb, #0072B2 18%, transparent); }
@media (max-width: 576px) { .podium { gap: 0.4rem; } .podium-place .podium-total { font-size: 1.15rem; } table.annual .bar-col { display: none; } }

/* Page views (D-90) */
.daily-bars { display: flex; align-items: flex-end; gap: 2px; height: 7rem; margin: 0.5rem 0 0.2rem; }
.daily-bar { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.daily-bar span { display: block; width: 100%; min-height: 1px; background: #0072B2; border-radius: 2px 2px 0 0; opacity: 0.8; }
.daily-axis { display: flex; justify-content: space-between; font-size: 0.8rem; opacity: 0.75; margin-bottom: 1rem; }

/* Team ranking with shooters (D-91) */
table.team-table tbody.team-block { border-top: 2px solid var(--pico-muted-border-color, #ccc); }
table.team-table tr.team-row td { background: color-mix(in srgb, #0072B2 9%, transparent); }
table.team-table tr.shooter-row td { font-size: 0.9em; padding-top: 0.15rem; padding-bottom: 0.15rem; }
table.team-table tr.shooter-row td:nth-child(2) { padding-left: 1.2rem; }

/* Züriliga matches (D-94) */
.match-team header { font-size: 1.05rem; }
h3.match-title { font-size: 1rem; margin: 1rem 0 0.4rem; }
.match-outcome { font-size: 0.85rem; font-weight: 600; margin-left: 0.5rem; padding: 0.05rem 0.4rem; border-radius: 0.3rem; }
.outcome-gewonnen { color: #1a7f37; background: color-mix(in srgb, #1a7f37 12%, transparent); }
.outcome-verloren { color: #c62828; background: color-mix(in srgb, #c62828 12%, transparent); }
.outcome-offen { opacity: 0.75; }
td.duel-won { font-weight: 700; }

/* Date polls (D-95) */
table.poll-grid { border-collapse: collapse; width: auto; }
table.poll-grid th, table.poll-grid td { text-align: center; padding: 0.3rem 0.55rem; border: 1px solid var(--pico-muted-border-color, #ddd); }
table.poll-grid td:first-child, table.poll-grid th:first-child { text-align: left; white-space: nowrap; }
.poll-yes { background: color-mix(in srgb, #1a7f37 22%, transparent); }
.poll-maybe { background: color-mix(in srgb, #E69F00 25%, transparent); }
.poll-no { background: color-mix(in srgb, #c62828 14%, transparent); }
th.poll-best { background: color-mix(in srgb, #1a7f37 14%, transparent); }
th.poll-chosen { outline: 3px solid #0072B2; }
tr.poll-own td { font-weight: 700; }
.poll-option { margin-bottom: 0.6rem; }
.poll-choice { display: inline-block; margin-right: 1rem; }
.poll-decision { border-left: 4px solid #0072B2; }

/* Invoices (D-101) */
.invoice-status { font-size: 0.85rem; font-weight: 600; padding: 0.05rem 0.45rem; border-radius: 0.3rem; white-space: nowrap; }
.status-recorded { background: color-mix(in srgb, #E69F00 22%, transparent); }
.status-sent { background: color-mix(in srgb, #0072B2 18%, transparent); }
.status-paid { background: color-mix(in srgb, #1a7f37 20%, transparent); color: #1a7f37; }
/* D-106: automatic check of the score-sheet photo */
.sheet-check ul { margin: 0.4rem 0; }
.sheet-check-passed { border-left: 4px solid #1a7f37; background: color-mix(in srgb, #1a7f37 8%, transparent); }
/* D-108: hit picture on "Meine Anmeldungen" */
.hit-picture { width: 100%; max-width: 22rem; height: auto; display: block; margin: 0.4rem 0; }
.hit-picture .hit circle { fill: #E69F00; fill-opacity: 0.7; stroke: #fff; stroke-width: 0.25; }
.hit-picture .hit text { fill: #111; font-size: 1.6px; font-weight: 700; text-anchor: middle; font-family: sans-serif; }
.hit-picture .hit-mean { stroke: #56B4E9; stroke-width: 0.7; fill: none; }
/* D-112: previews of several photos */
.photo-previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: 0.5rem; margin: 0.4rem 0; }
.photo-preview { position: relative; margin: 0; }
.photo-preview img { display: block; width: 100%; max-height: 14rem; object-fit: contain; border: 1px solid #ccc; border-radius: 0.4rem; }
.photo-preview .photo-remove { position: absolute; top: 0.25rem; right: 0.25rem; width: auto; margin: 0; padding: 0.1rem 0.45rem; font-size: 0.9rem; line-height: 1.2; }
.photo-count { display: block; margin-bottom: 0.5rem; }
/* D-114: correct the values of the score sheet */
.sheet-edit { display: grid; grid-template-columns: minmax(18rem, 26rem) 1fr; gap: 1.5rem; align-items: start; }
.sheet-photo-side { position: sticky; top: 1rem; }
.sheet-photo-side img.sheet-photo { max-height: 90vh; }
.sheet-series table { margin-bottom: 0.4rem; }
.sheet-series td, .sheet-series th { padding: 0.15rem 0.3rem; }
.sheet-series input, .sheet-series select { margin: 0; padding: 0.2rem 0.4rem; height: auto; }
.sheet-values input.sheet-value { width: 5.5rem; }
.sheet-missing td:first-child { color: #c62828; font-weight: 700; }
@media (max-width: 48rem) { .sheet-edit { grid-template-columns: 1fr; } .sheet-photo-side { position: static; } }
/* D-115: progress while the photos are checked */
.check-progress { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(0, 0, 0, 0.45); }
.check-progress > div { max-width: 26rem; width: 100%; padding: 1.25rem; border-radius: 0.6rem; background: var(--pico-background-color, #fff); box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); }
.check-progress progress { width: 100%; margin: 0.8rem 0; }
.check-progress small { display: block; }
