.profile-layout {
    display: grid;
    gap: 24px;
}

.profile-hero {
    display: grid;
    gap: 20px;
    align-items: start;
}

.profile-logo {
    width: 116px;
    height: 116px;
    border-radius: 26px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, #ffffff 0%, #eef5fc 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 14px 30px rgba(15, 61, 136, 0.08);
}

.profile-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-logo-fallback {
    color: var(--accent);
    font-size: 2rem;
    font-weight: 800;
}

.profile-intro {
    display: grid;
    gap: 14px;
}

.profile-kicker {
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 700;
    text-transform: uppercase;
}

.profile-summary {
    margin: 0;
    color: var(--text);
    font-size: 1rem;
    line-height: 1.72;
}

.profile-meta,
.profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.profile-type-pill {
    background: rgba(140, 165, 67, 0.16);
    border-color: rgba(140, 165, 67, 0.24);
    color: #6b8529;
}

.meta-pill i,
.status-tag i,
.fact-card i,
.section-heading i {
    width: 18px;
    flex: 0 0 18px;
    text-align: center;
    font-size: 0.98rem;
    line-height: 1;
}

.fact-card a,
.detail-value a {
    color: inherit;
    text-decoration: none;
}

.fact-card a:hover,
.detail-value a:hover {
    text-decoration: underline;
}

.fact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    align-items: stretch;
}

.fact-card {
    border-radius: 18px;
    height: 100%;
}

.fact-subvalue {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

.fact-card-header {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.profile-grid {
    display: grid;
    gap: 24px;
}

.profile-tab-shell {
    display: grid;
    gap: 18px;
}

.profile-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 0 4px;
}

.profile-tab-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid rgba(15, 61, 136, 0.12);
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    color: var(--text);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
    box-shadow: 0 12px 24px rgba(15, 61, 136, 0.04);
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.profile-tab-button:hover,
.profile-tab-button:focus-visible {
    background: #f7fbff;
    color: var(--accent);
    border-color: rgba(15, 61, 136, 0.18);
    box-shadow: 0 14px 28px rgba(15, 61, 136, 0.06);
    transform: translateY(-1px);
    outline: none;
}

.profile-tab-button.is-active {
    background: linear-gradient(180deg, #e8f1fc 0%, #dceafd 100%);
    border-color: rgba(15, 61, 136, 0.32);
    color: var(--accent);
    box-shadow: 0 14px 28px rgba(15, 61, 136, 0.1);
    transform: none;
}

.profile-tab-button i {
    line-height: 1;
}

.profile-tab-panel {
    display: grid;
    gap: 24px;
}

.profile-tab-panel.is-hidden {
    display: none;
}

.profile-panel-grid {
    display: grid;
    gap: 24px;
}

.profile-panel-column {
    display: grid;
    gap: 24px;
    align-content: start;
}

.profile-column,
.profile-section,
.detail-list {
    display: grid;
    gap: 16px;
}

.profile-column-main {
    order: 2;
}

.profile-column-aside {
    order: 1;
}

.group-membership-list {
    display: grid;
    gap: 12px;
}

.group-membership-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-radius: 14px;
}

.group-membership-name {
    margin: 0;
    color: var(--text);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
}

.group-membership-link {
    flex: 0 0 auto;
}

.organization-member-list {
    display: grid;
    gap: 12px;
}

.organization-member-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-radius: 14px;
}

.organization-member-content {
    min-width: 0;
}

.organization-member-name {
    margin: 0;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
}

.organization-member-meta {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.organization-member-link {
    flex: 0 0 auto;
}

.organization-needs-list {
    display: grid;
    gap: 12px;
}

.organization-needs-item {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 14px 16px;
    border: 1px solid rgba(15, 61, 136, 0.1);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 251, 255, 0.92) 100%);
}

.organization-needs-item i {
    color: var(--accent);
    font-size: 0.9rem;
    line-height: 1.4;
    text-align: center;
}

.organization-needs-item span {
    color: var(--text);
    line-height: 1.6;
}

.organization-matchmaking-description {
    display: grid;
    gap: 8px;
    margin-top: 16px;
    padding: 16px 18px;
    border-left: 4px solid rgba(15, 61, 136, 0.42);
    border-radius: 12px;
    background: rgba(15, 61, 136, 0.055);
}

.organization-matchmaking-description > span {
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.organization-matchmaking-description p {
    margin: 0;
    color: var(--text);
    line-height: 1.7;
}

.evidence-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.evidence-item {
    position: relative;
    padding: 12px 14px 12px 18px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(250, 252, 255, 0.96) 0%, rgba(244, 248, 253, 0.92) 100%);
    border: 1px solid rgba(15, 61, 136, 0.08);
    color: var(--text);
    line-height: 1.58;
}

.evidence-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 4px;
    border-radius: 999px;
    background: rgba(91, 152, 185, 0.72);
}

.member-representative-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(91, 152, 185, 0.14);
    color: var(--heading);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.profile-section h2 {
    margin-bottom: 0;
}

.detail-item {
    gap: 4px;
    border-radius: 14px;
}

.profile-hero-heading {
    display: flex;
    gap: 16px;
    justify-content: space-between;
    align-items: start;
}

.profile-title-with-action {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.profile-hero-heading h1 {
    margin-bottom: 0;
}

.profile-primary-action {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.profile-primary-action .button-link,
.profile-primary-action button {
    white-space: nowrap;
}

.organization-profile-print-button {
    gap: 8px;
    border-color: rgba(15, 61, 136, 0.24);
    background: rgba(15, 61, 136, 0.06);
    color: var(--accent);
    box-shadow: none;
}

.organization-profile-print-button:hover,
.organization-profile-print-button:focus-visible {
    border-color: rgba(15, 61, 136, 0.4);
    background: rgba(15, 61, 136, 0.12);
    color: var(--accent);
    box-shadow: none;
    transform: none;
}

.profile-print-section-title {
    display: none;
}

.profile-actions form {
    margin: 0;
}

.profile-actions button[disabled] {
    opacity: 0.72;
    cursor: not-allowed;
}

.activity-split {
    display: grid;
    gap: 16px;
}

.activity-status-grid {
    display: grid;
    gap: 12px;
    grid-column: 1 / -1;
}

.activity-status-grid .status-tag {
    width: 100%;
    justify-content: flex-start;
    border-radius: 16px;
    padding: 12px 14px;
}

@media (min-width: 860px) {
    .profile-hero {
        grid-template-columns: 132px minmax(0, 1fr);
    }

    .profile-panel-grid-overview {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: start;
    }

    .profile-panel-grid-experience {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    .profile-panel-grid-network {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: start;
    }

    .profile-grid {
        grid-template-columns: minmax(300px, 0.95fr) minmax(0, 1.15fr);
        align-items: start;
    }

    .activity-split {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .organization-needs-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .profile-tabs,
    .profile-tab-button {
        width: 100%;
    }

    .profile-tab-button {
        justify-content: center;
    }

    .profile-hero-heading {
        flex-direction: column;
        align-items: stretch;
    }

    .profile-primary-action .button-link,
    .profile-primary-action button,
    .profile-actions .button-link,
    .profile-actions button {
        width: 100%;
    }

    .group-membership-item {
        align-items: stretch;
        flex-direction: column;
    }

    .organization-member-item {
        align-items: stretch;
        flex-direction: column;
    }
}

@media print {
    @page {
        size: A4 portrait;
        margin: 12mm;
    }

    html,
    body {
        background: #ffffff !important;
        color: #17283d !important;
        font-size: 10pt;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .site-header,
    .site-footer,
    .skip-link,
    .page-back-link,
    .messages,
    .profile-tabs,
    .profile-primary-action,
    .profile-title-with-action .icon-button,
    .group-membership-link,
    .organization-member-link {
        display: none !important;
    }

    #main-content.shell {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0;
    }

    .profile-layout,
    .profile-tab-shell,
    .profile-tab-panel,
    .profile-panel-grid,
    .profile-panel-column {
        display: block !important;
        width: 100%;
    }

    .profile-tab-panel,
    .profile-tab-panel.is-hidden,
    .profile-tab-panel[hidden] {
        display: block !important;
    }

    .profile-tab-panel + .profile-tab-panel {
        margin-top: 9mm;
    }

    .profile-print-section-title {
        display: block;
        margin: 0 0 5mm;
        padding-bottom: 2.5mm;
        border-bottom: 2px solid #0f3d88;
        color: #0f3d88;
        font-size: 16pt;
        break-after: avoid;
        page-break-after: avoid;
    }

    .panel {
        border-color: #d5deea;
        border-radius: 10px;
        box-shadow: none !important;
    }

    .profile-hero {
        grid-template-columns: 30mm minmax(0, 1fr) !important;
        gap: 6mm;
        margin-bottom: 8mm;
        padding: 7mm;
        background: #f7fbff !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .profile-logo {
        width: 28mm;
        height: 28mm;
        border-radius: 8px;
        box-shadow: none;
    }

    .profile-hero-heading,
    .profile-title-with-action {
        display: block;
    }

    .profile-hero-heading h1 {
        margin: 0;
        font-size: 21pt;
        line-height: 1.15;
    }

    .profile-kicker {
        font-size: 8.5pt;
    }

    .profile-summary {
        font-size: 9.5pt;
        line-height: 1.55;
    }

    .fact-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 3mm;
    }

    .fact-card,
    .detail-item,
    .evidence-item,
    .group-membership-item,
    .organization-member-item {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .profile-section {
        display: grid;
        gap: 4mm;
        margin: 0 0 5mm;
        padding: 5mm;
        break-inside: avoid-page;
        page-break-inside: avoid;
    }

    .profile-section h2,
    .profile-section h3,
    .section-heading {
        break-after: avoid;
        page-break-after: avoid;
    }

    .detail-value,
    .profile-summary,
    .evidence-item,
    .organization-matchmaking-description p {
        overflow: visible !important;
        overflow-wrap: anywhere;
        word-break: normal;
    }

    .tag-list,
    .profile-meta,
    .program-description-meta {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    a {
        color: inherit !important;
        text-decoration: none !important;
    }
}
