.pacemaker-name-link { color: inherit; text-decoration: none; }
.pacemaker-name-link:hover, .pacemaker-name-link:focus-visible { color: #176f59; text-decoration: underline; }
.profile-breadcrumb { margin: 1.4rem 0; font-size: .88rem; }
.profile-breadcrumb a { color: #52655d; text-decoration: none; }
.profile-avatar { position: relative; display: grid; place-items: center; width: 8rem; height: 8rem; overflow: hidden; border-radius: 1.25rem; background: #e5f2ed; color: #176f59; 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-achievements li { display: block; }
.achievement-badge { position: relative; display: inline-flex; width: 3.25rem; height: 3.25rem; border: 1px solid #dce6e2; border-radius: .75rem; background: #fff; vertical-align: middle; cursor: help; }
.achievement-image-window { display: block; width: 100%; height: 100%; overflow: hidden; border-radius: inherit; }
.achievement-image-window img { display: block; width: 145%; height: 145%; max-width: none; object-fit: contain; transform: translate(-15.52%, -15.52%); }
.achievement-tooltip { position: absolute; bottom: calc(100% + .5rem); left: 0; z-index: 5; width: max-content; max-width: min(17rem, 72vw); padding: .55rem .7rem; border-radius: .6rem; background: #243c32; color: #fff; font-size: .75rem; font-weight: 450; line-height: 1.4; box-shadow: 0 .3rem 1rem #17231f24; opacity: 0; visibility: hidden; pointer-events: none; }
.achievement-badge:hover .achievement-tooltip, .achievement-badge:focus-visible .achievement-tooltip, .achievement-choice:focus-within .achievement-tooltip { visibility: visible; opacity: 1; }
.achievement-badge:focus-visible { outline: 2px solid #176f59; outline-offset: 3px; }
.profile-achievement-choices { display: flex; flex-wrap: wrap; gap: 1rem; }
.achievement-choice { padding: .6rem; border: 1px solid #dce6e2; border-radius: .85rem; cursor: pointer; }
.achievement-choice:has(input:checked) { background: #edf7f1; border-color: #8ebdad; }
.achievement-choice .achievement-badge { cursor: inherit; }
.profile-contacts li { min-width: 0; }
.profile-contacts li + li { border-top: 1px solid #e7eeea; }
.profile-contact { display: grid; grid-template-columns: 1.75rem minmax(0, 1fr) auto; align-items: center; gap: .8rem; padding: .7rem .2rem; color: #263e33; text-decoration: none; border-radius: .4rem; }
a.profile-contact:hover, a.profile-contact:focus-visible { color: #176f59; background: #edf5f0; 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: #73847b; }
.profile-contact-arrow { color: #91a39a; 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: #71807b; font-weight: 450; }
.profile-average { color: var(--rating-color); background: var(--rating-bg); padding: .5rem .8rem; border-radius: .7rem; font-size: .85rem; }
.profile-average strong { margin-left: .5rem; font-size: 1.2rem; }
.profile-average small { margin-left: .2rem; }
.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: #176f59; 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: #52655d; }
.profile-form { max-width: 48rem; }
.profile-form-section { margin-bottom: 1rem; padding: 1.5rem; border: 1px solid #dce6e2; 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:not([type]), .profile-form textarea { display: block; width: 100%; min-height: 2.8rem; margin: .4rem 0 0; padding: .7rem; border: 1px solid #cddbd5; border-radius: .65rem; font: inherit; font-weight: 400; background: #fff; color: #17231f; }
.profile-form textarea { resize: vertical; }
.profile-form input:focus-visible, .profile-form textarea:focus-visible { outline: 2px solid #176f59; 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: #e9f4ee; border-color: #b9d7c8; color: #176f59; cursor: pointer; }
.photo-picker-button:hover { background: #dceee3; }
.photo-picker input:focus-visible + .photo-picker-button { outline: 2px solid #176f59; outline-offset: 3px; }
.photo-filename { display: block; margin-top: .55rem; color: #64756d; font-size: .8rem; overflow-wrap: anywhere; }
.profile-handle-input { display: flex; align-items: center; min-width: 0; margin-top: .4rem; border: 1px solid #cddbd5; border-radius: .65rem; overflow: hidden; }
.profile-handle-prefix { flex: 0 0 auto; padding-left: .7rem; color: #71807b; 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 #176f59; 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: #176f59; border-color: #dce6e2; background: #f5faf7; }
.profile-remove-contact { background: #f4f6f5; color: #64756d; }
.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; }

/* The profile uses one compact identity row, then independent content panels. */
.profile-shell { max-width: 74rem; margin-inline: auto; }
.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 #dce6e2; border-radius: 1rem; background: #fff; }
.profile-intro .profile-avatar { width: 5.5rem; height: 5.5rem; border-radius: 1rem; }
.profile-identity { min-width: 0; }
.profile-location { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin: .4rem 0; color: #52655d; font-size: .85rem; }
.profile-public-link { display: inline-block; margin-top: .25rem; color: #176f59; font-size: .8rem; overflow-wrap: anywhere; }
.profile-achievements { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: 0; padding: 0; }
.profile-achievements .achievement-badge { width: 2.4rem; height: 2.4rem; }
.profile-edit-link { align-self: start; border-color: #dce6e2; color: #176f59; background: #f3f8f5; font-size: .8rem; }
.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 #dce6e2; 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: #52655d; 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: #f2f7f4; color: #176f59; text-decoration: none; }
.profile-record:hover, .profile-record:focus-visible { background: #e5f2eb; }
.profile-record > span { display: flex; justify-content: space-between; gap: .3rem; font-size: .75rem; color: #64756d; }
.profile-record strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.profile-record small { color: #64756d; font-size: .7rem; }
.profile-performances { margin-top: .5rem; }
.profile-form-actions .button:not(.button--primary) { color: #176f59; background: #edf5f0; border-color: #cdded4; }
.profile-form-actions .button:not(.button--primary):hover { background: #dfede5; }
.contact-field-hint { display: block; margin-top: .4rem; color: #64756d; 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: #64756d; font-size: .75rem; }
.profile-record-edit-row { padding-block: .4rem; border-top: 1px solid #e7eeea; }
.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: #52655d; }
.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: 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-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-edit-link { grid-column: 1 / -1; justify-self: start; }
  .profile-record-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 35rem) {
  .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-identity-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; margin-top: .5rem; }
.profile-identity-meta:empty { display: none; }
.profile-identity-meta { position: relative; }
.profile-identity .achievement-badge { position: static; }
.profile-identity .achievement-tooltip { left: 0; right: auto; max-width: 100%; }
.profile-form [data-photo-error][hidden] { display: none; }
