.pacemaker-name-link { color: inherit; text-decoration: none; }
.pacemaker-name-link:hover, .pacemaker-name-link:focus-visible { color: var(--accent); text-decoration: underline; }
.profile-breadcrumb { margin: 1.4rem 0; font-size: .88rem; }
.profile-breadcrumb a { color: var(--muted); text-decoration: none; }
.profile-avatar { position: relative; display: grid; place-items: center; width: 8rem; height: 8rem; overflow: hidden; border-radius: 1.25rem; background: var(--accent-soft); color: var(--accent); font-size: 2.25rem; font-weight: 750; }
.profile-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.profile-avatar img[hidden] { display: none; }
.profile-identity h1, .profile-edit-heading h1 { margin: 0; font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.035em; line-height: 1.2; overflow-wrap: anywhere; }
.profile-achievement-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: .75rem; }
.achievement-choice { display: grid; grid-template-rows: 1fr auto; gap: .55rem; padding: .65rem; border: 1px solid var(--line); border-radius: .85rem; }
.achievement-choice > span:first-child { display: flex; align-items: center; gap: .55rem; }
.achievement-choice .achievement-icon { flex-shrink: 0; }
.profile-contacts li { min-width: 0; }
.profile-contacts li + li { border-top: 1px solid var(--line); }
.profile-contact { display: grid; grid-template-columns: 1.75rem minmax(0, 1fr) auto; align-items: center; gap: .8rem; padding: .7rem .2rem; color: var(--ink); text-decoration: none; border-radius: .4rem; }
a.profile-contact:hover, a.profile-contact:focus-visible { color: var(--accent); background: var(--accent-soft); outline-offset: 2px; }
.contact-brand-icon { display: block; width: 1.75rem; height: 1.75rem; object-fit: contain; }
.profile-contact-text { display: grid; gap: .15rem; min-width: 0; overflow-wrap: anywhere; }
.profile-contact-text strong { font-size: .9rem; font-weight: 650; line-height: 1.35; }
.profile-contact-text small { font-size: .72rem; color: var(--placeholder); }
.profile-contact-arrow { color: var(--focus); font-size: .9rem; }
.profile-results-heading { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.profile-results-heading h2 { margin: 0; font-size: 1.2rem; }
.profile-results-heading h2 span { margin-left: .4rem; color: var(--placeholder); font-weight: 450; }
.profile-checkbox { display: flex; align-items: center; gap: .5rem; }
.profile-checkbox input { width: 1.1rem; height: 1.1rem; min-height: 0; padding: 0; margin: 0; accent-color: var(--accent); flex: 0 0 1.1rem; }
.profile-results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(18rem, 100%), 1fr)); gap: .9rem; }
.profile-results-grid .result-summary { width: 100%; }
.profile-edit-heading { margin-bottom: 1.5rem; }
.profile-edit-heading p { color: var(--muted); }
.profile-form-section { margin-bottom: 1rem; padding: 1.5rem; border: 1px solid var(--line); border-radius: 1rem; background: #fff; }
.profile-form-section h2 { font-size: 1.1rem; margin: 0 0 1rem; }
.profile-form label { font-size: .88rem; font-weight: 600; }
.profile-form input[type="text"], .profile-form input[type="url"], .profile-form input:not([type]), .profile-form textarea { display: block; width: 100%; min-height: 2.8rem; margin: .4rem 0 0; padding: .7rem; border: 1px solid var(--line-strong); border-radius: .65rem; font: inherit; font-weight: 400; background: #fff; color: var(--ink); }
.profile-form textarea { resize: vertical; }
.profile-form input:focus-visible, .profile-form textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.profile-photo-controls { display: grid; grid-template-columns: 8rem minmax(0, 1fr); align-items: center; gap: 1.25rem; margin-bottom: 1.4rem; }
.profile-photo-controls input[type="file"] { display: block; max-width: 100%; min-height: 0; padding: 0; border: 0; margin-top: .6rem; font: inherit; font-size: .8rem; }
.photo-picker { position: relative; display: inline-flex; }
.profile-form .photo-picker-button { min-height: 2.8rem; margin: 0; background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent); cursor: pointer; }
.photo-picker-button:hover { background: var(--accent-selected); }
.photo-picker input:focus-visible + .photo-picker-button { outline: 2px solid var(--accent); outline-offset: 3px; }
.photo-filename { display: block; margin-top: .55rem; color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.profile-handle-input { display: flex; align-items: center; min-width: 0; margin-top: .4rem; border: 1px solid var(--line-strong); border-radius: .65rem; overflow: hidden; }
.profile-handle-prefix { flex: 0 0 auto; padding-left: .7rem; color: var(--placeholder); font-size: .8rem; font-weight: 400; }
.profile-form .profile-handle-input input { min-width: 0; margin: 0; border: 0; border-radius: 0; padding-left: .3rem; }
.profile-handle-input:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.profile-form .profile-handle-input input:focus-visible { outline: 0; }
.profile-contact-fields { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
.profile-contact-row { min-width: 0; }
.profile-contact-row--other { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) auto; gap: .65rem; align-items: end; }
.profile-add-contact { margin-top: 1rem; color: var(--accent); border-color: var(--line); background: var(--surface-subtle); }
.profile-remove-contact { background: var(--surface-subtle); color: var(--muted); }
.profile-form-actions { display: flex; flex-wrap: wrap; gap: .65rem; margin: 1.25rem 0 2rem; }
.profile-details-fields > label { display: block; margin-top: 1rem; }
.profile-two-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.profile-two-columns > label { min-width: 0; }
.profile-distance-choices { display: flex; flex-wrap: wrap; gap: .45rem 1rem; min-width: 0; margin: 1rem 0 0; padding: 0; border: 0; }
.profile-distance-choices legend { margin-bottom: .25rem; padding: 0; font-size: .88rem; font-weight: 600; }
.profile-distance-choices label { min-height: 2rem; cursor: pointer; }

/* The profile uses one compact identity row, then independent content panels. */
.profile-intro { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr) auto; align-items: center; gap: 1.1rem; padding: 1.25rem; border: 1px solid var(--line); border-radius: 1rem; background: #fff; }
.profile-intro .profile-avatar { width: 5.5rem; height: 5.5rem; border-radius: 1rem; }
.profile-identity { display: grid; justify-items: start; gap: .5rem; min-width: 0; position: relative; }
.profile-name-row, .profile-identity-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .7rem; min-width: 0; }
.profile-identity-meta { font-size: .85rem; overflow-wrap: anywhere; }
.profile-identity .pacemaker-rank { margin: 0; padding: .25rem .55rem; border-radius: .5rem; background: var(--accent-soft); }
.profile-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }
.profile-actions .button { min-height: 2.65rem; padding: .55rem .85rem; font-size: .85rem; }
.profile-actions .profile-support:not(:hover) { box-shadow: none; }
#donation-hint a { color: var(--accent); }
.profile-location { color: var(--muted); }
.profile-preferred-distances { margin: 0; color: var(--muted); font-size: .85rem; }
.profile-public-link { color: var(--accent); font-size: .8rem; overflow-wrap: anywhere; text-underline-offset: .18em; }
.profile-secondary-action { border-color: var(--line); color: var(--accent); background: var(--surface-subtle); }
.profile-secondary-action:hover { background: var(--accent-soft); }
.profile-information { display: grid; grid-template-columns: minmax(0, 1fr) 18.5rem; align-items: start; gap: 1rem; margin-top: 1rem; }
.profile-information:not(:has(.profile-contact-panel)) { grid-template-columns: minmax(0, 1fr); }
.profile-story { display: grid; gap: 1rem; min-width: 0; }
.profile-panel { min-width: 0; padding: 1.1rem 1.25rem; border: 1px solid var(--line); border-radius: 1rem; background: #fff; }
.profile-panel h2 { font-size: 1rem; margin: 0 0 .75rem; }
.profile-about p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; color: var(--muted); font-size: .92rem; }
.profile-contacts { display: grid; grid-template-columns: minmax(0, 1fr); margin: 0; padding: 0; list-style: none; }
.profile-contact { padding-block: .6rem; }
.profile-contact-panel h2 { margin-bottom: .3rem; }
.profile-record-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
.profile-record { display: grid; gap: .25rem; min-width: 0; padding: .55rem .65rem; border-radius: .6rem; background: var(--surface-subtle); color: var(--accent); text-decoration: none; }
.profile-record:hover, .profile-record:focus-visible { background: var(--accent-soft); }
.profile-record > span { display: flex; justify-content: space-between; gap: .3rem; font-size: .75rem; color: var(--muted); }
.profile-record strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.profile-record small { color: var(--muted); font-size: .7rem; }
.profile-performances { margin-top: .5rem; }
.profile-form-actions .button:not(.button--primary) { color: var(--accent); background: var(--accent-soft); border-color: var(--line-strong); }
.profile-form-actions .button:not(.button--primary):hover { background: var(--accent-selected); }
.contact-field-hint { display: block; margin-top: .4rem; color: var(--muted); font-weight: 400; font-size: .75rem; line-height: 1.4; }
.profile-record-column-headings, .profile-record-edit-row { display: grid; grid-template-columns: 3.5rem 7.5rem 4.5rem minmax(0, 1fr); gap: .65rem; align-items: center; }
.profile-record-column-headings { padding-bottom: .4rem; color: var(--muted); font-size: .75rem; }
.profile-record-edit-row { padding-block: .4rem; border-top: 1px solid var(--line); }
.profile-record-edit-row label { min-width: 0; }
.profile-form .profile-record-edit-row input { margin: 0; min-width: 0; padding: .55rem; font-size: .85rem; }
.record-distance { font-size: .85rem; color: var(--muted); }
.record-distance small { font-size: .7rem; font-weight: 400; }
@media (max-width: 55rem) {
  .profile-information { grid-template-columns: minmax(0, 1fr) 16rem; }
  .profile-record-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 48rem) {
  .profile-intro { grid-template-columns: 4.25rem minmax(0, 1fr); padding: 1rem; gap: .85rem; }
  .profile-intro .profile-avatar { width: 4.25rem; height: 4.25rem; align-self: start; }
  .profile-actions { grid-column: 1 / -1; justify-content: flex-start; padding-top: .75rem; border-top: 1px solid var(--line); }
  .profile-actions .button { padding-inline: .55rem; }
  .profile-identity .pacemaker-rank { font-size: .8rem; }
}
@media (max-width: 42rem) {
  .profile-information { display: flex; flex-direction: column; }
  .profile-story { display: contents; }
  .profile-panel, .profile-performances { width: 100%; }
  .profile-contact-panel { order: 2; }
  .profile-performances { order: 3; }
  .profile-record-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 35rem) {
  .profile-name-row .achievement-icon { width: 1.625rem; height: 1.625rem; }
  .profile-photo-controls { grid-template-columns: 1fr; }
  .profile-contact-fields, .profile-details-fields .profile-two-columns { grid-template-columns: 1fr; }
  .profile-form-section, .profile-panel { padding: 1rem; }
  .profile-contact-row--other { grid-template-columns: minmax(0, 1fr) auto; }
  .profile-contact-row--other label:first-of-type { grid-column: 1 / -1; }
  .profile-record-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-record-column-headings { display: none; }
  .profile-record-edit-row { grid-template-columns: 3.5rem minmax(0, 1fr) 4.5rem; gap: .45rem; padding-block: .65rem; }
  .profile-record-edit-row .record-distance { grid-row: 1 / 3; align-self: center; }
  .profile-record-edit-row .record-source { grid-column: 2 / -1; }
}

.profile-form [data-photo-error][hidden] { display: none; }


.profile-qr {
  display: grid;
  justify-items: center;
  gap: .45rem;
  text-align: center;
}
.profile-contacts + .profile-qr { margin-top: .8rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.profile-qr-image { display: block; width: min(100%, 14rem); }
.profile-qr-image img { display: block; width: 100%; height: auto; }
.profile-qr-print-name, .profile-qr button[hidden] { display: none; }

@media print {
  body:has(.profile-qr) { min-width: 0; min-height: 0; background: white; }
  .app-shell:has(.profile-qr) > :not(.profile-information),
  .profile-information:has(.profile-qr) > :not(.profile-contact-panel),
  .profile-contact-panel:has(.profile-qr) > :not(.profile-qr),
  .profile-qr button, .profile-qr h2 { display: none; }
  .app-shell:has(.profile-qr),
  .profile-information:has(.profile-qr),
  .profile-contact-panel:has(.profile-qr) {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
  }
  .profile-contact-panel > .profile-qr { break-inside: avoid; margin: 0; padding: 8mm 0; border: 0; }
  .profile-qr-print-name { display: block; margin: 0; color: black; font-size: 18pt; font-weight: 700; }
  .profile-qr-image { width: 85mm; max-width: 100%; }
}

.profile-reviews { scroll-margin-top: 1rem; }
.review-summary { margin: .25rem 0 .75rem; color: var(--muted); }
.review-summary strong, .review-heading strong { color: var(--accent); }
.review-list { margin: 0 0 1rem; padding: 0; list-style: none; }
.review-list li { padding: .7rem 0; border-bottom: 1px solid var(--line); scroll-margin-top: 1rem; }
.review-list li:target { outline: 2px solid var(--accent-border); outline-offset: .25rem; border-radius: .25rem; }
.review-heading { display: flex; justify-content: space-between; gap: .6rem; font-size: .9rem; }
.review-heading span, .review-list p { overflow-wrap: anywhere; }
.review-heading strong { white-space: nowrap; }
.review-author { display: flex; align-items: center; gap: .55rem; margin-top: .55rem; font-size: .9rem; overflow-wrap: anywhere; }
.review-author-avatar { position: relative; display: grid; place-items: center; flex: 0 0 2rem; height: 2rem; border-radius: 50%; overflow: hidden; color: var(--accent); background: var(--accent-soft); font-size: .72rem; font-weight: 700; }
.review-author-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.review-list p { margin: .4rem 0 0; white-space: pre-wrap; }
.review-actions { display: flex; flex: none; align-items: center; gap: .3rem; margin-left: auto; }
.review-actions form { margin: 0; }
.review-action {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: #fff;
  color: var(--accent);
  cursor: pointer;
}
.review-action svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.review-action:hover, .review-action[aria-expanded="true"] { background: var(--accent-soft); }
.review-action:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.review-action--delete { color: var(--danger-ink); }
.review-action--delete:hover { background: var(--danger-soft); }
.review-comment-editor { margin-top: .65rem; }
.review-comment-editor[hidden] { display: none; }
.review-editor-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.review-form { display: grid; gap: .45rem; max-width: 34rem; }
.review-form label, .review-scores legend { font-size: .88rem; font-weight: 650; }
.review-form select, .review-form textarea { width: 100%; padding: .6rem; border: 1px solid var(--line-strong); border-radius: .6rem; font: inherit; background: #fff; color: inherit; }
.review-form select { appearance: none; padding-right: 2.8rem; min-height: 2.75rem; cursor: pointer; }
.review-form :is(select, textarea):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.review-form select:focus-visible { border-color: var(--accent); }
.review-form .event-note a { color: var(--accent); text-underline-offset: .18em; }
.review-form .event-note a:hover { color: var(--accent-strong); }
.review-form textarea { resize: vertical; }
.review-form .button { justify-self: start; margin-top: .3rem; }
.review-form .event-note { margin: .2rem 0; }
.review-scores { display: flex; gap: .35rem; margin: .3rem 0; border: 0; padding: 0; }
.review-scores label { position: relative; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: .55rem; cursor: pointer; }
.review-scores input { position: absolute; opacity: 0; }
.review-star {
  display: block;
  width: 1.95rem;
  height: 1.95rem;
  color: var(--star-color, var(--focus));
  fill: var(--star-fill, var(--surface-subtle));
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linejoin: round;
}
.review-scores label:where(:has(input:checked), :has(~ label input:checked)) {
  --star-color: var(--accent);
  --star-fill: var(--accent);
}
@media (hover: hover) {
  .review-scores:has(label:hover) label {
    --star-color: var(--focus);
    --star-fill: var(--surface-subtle);
  }
  .review-scores:has(label:hover) label:is(:hover, :has(~ label:hover)) {
    --star-color: var(--accent);
    --star-fill: var(--accent);
  }
  .review-scores label:hover { background: var(--accent-soft); }
}
.review-scores label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
