/* Public artist card */
.artistprofile-viewforum-layout,
.artistprofile-card,
.artistprofile-compact,
.artistprofile-revision-card {
    font-family: Scada, Verdana, Arial, Helvetica, sans-serif;
    font-size: 14px;
    font-weight: 400;
}

.artistprofile-viewforum-layout {
    display: grid;
    grid-template-columns: var(--artistprofile-profile-size, 150px) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    column-gap: 16px;
    align-items: start;
    margin: 0 0 14px;
}

.artistprofile-viewforum-layout > .forum-title {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    margin-top: 0;
    font-size: 21px;
    line-height: 1.2;
}

.artistprofile-title-photo {
    position: relative;
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: start;
}

.artistprofile-title-photo-fallback {
    float: left;
    margin: 0 16px 10px 0;
}

.artistprofile-card {
    margin: 4px 0 14px;
    padding: 0;
    min-width: 0;
}

.artistprofile-card-with-photo {
    display: flex;
    grid-column: 2;
    grid-row: 2;
    flex-direction: column;
    align-self: stretch;
    margin: 0;
    min-height: 0;
}

.artistprofile-card::after {
    content: "";
    display: block;
    clear: both;
}

.artistprofile-forum-image-link {
    display: inline-block;
    text-decoration: none;
}

.artistprofile-main-photo,
.artistprofile-forum-image {
    display: block;
    object-fit: cover;
    object-position: 50% 35%;
    border-radius: 5px;
}

.artistprofile-main-photo {
    width: var(--artistprofile-profile-size, 150px);
    height: var(--artistprofile-profile-size, 150px);
}

.artistprofile-forum-image {
    width: var(--artistprofile-forum-size, 100px);
    height: var(--artistprofile-forum-size, 100px);
}

.artistprofile-photo-count {
    position: absolute;
    right: 5px;
    bottom: 5px;
    padding: 2px 6px;
    border-radius: 10px;
    color: #fff;
    background: rgba(0, 0, 0, .7);
    font: 400 11px/1.4 Verdana, Arial, sans-serif;
}

.artistprofile-details {
    min-width: 0;
}

.artistprofile-people,
.artistprofile-compact {
    font-family: Scada, Verdana, Arial, Helvetica, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
}

.artistprofile-person {
    font-weight: 400;
}

.artistprofile-flag {
    width: auto;
    height: 18px;
    margin: 0 2px;
    vertical-align: middle;
}

.artistprofile-links,
.artistprofile-compact-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 14px;
}

.artistprofile-service {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    margin: 0 4px 4px 0;
    text-decoration: none;
}

.artistprofile-service img {
    display: block;
    width: 40px;
    height: 40px;
    max-width: 40px;
    max-height: 40px;
    object-fit: contain;
}

.artistprofile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
    margin: auto 0 0;
    padding: 10px 0 0;
    list-style: none;
}

.artistprofile-actions li {
    display: block;
    margin: 0;
    padding: 0;
}

.artistprofile-actions .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 25px;
    height: 24px;
    padding: 0 5px;
    font-size: 11px;
    line-height: 22px;
}

.artistprofile-actions .icon {
    margin: 0;
    font-size: 12px;
}

.artistprofile-pending {
    font-weight: 400;
}

.artistprofile-hidden-gallery {
    display: none;
}

/* Editor */
.artistprofile-form-section {
    margin-bottom: 14px;
}

.artistprofile-form-row {
    position: relative;
    margin: 0 0 10px;
    padding: 12px 118px 12px 12px;
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: 5px;
}

.artistprofile-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
}

.artistprofile-form-grid .full {
    grid-column: 1 / -1;
}

.artistprofile-form-grid label,
.artistprofile-person-mainline label,
.artistprofile-link-line label,
.artistprofile-russian-name label {
    display: block;
    margin-bottom: 3px;
    font-weight: 600;
}

.artistprofile-form-grid input[type="text"],
.artistprofile-form-grid input[type="url"],
.artistprofile-form-grid input[type="number"],
.artistprofile-form-grid select,
.artistprofile-form-grid textarea,
.artistprofile-person-mainline input,
.artistprofile-person-mainline select,
.artistprofile-link-line input,
.artistprofile-link-line select,
.artistprofile-russian-name input {
    box-sizing: border-box;
    width: 100%;
}

.artistprofile-person-mainline {
    display: grid;
    grid-template-columns: minmax(160px, 220px) max-content;
    gap: 10px 14px;
    align-items: end;
    justify-content: start;
}

.artistprofile-country-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    min-width: 0;
    overflow: visible;
    width: max-content;
    max-width: 100%;
    padding-bottom: 2px;
}

.artistprofile-country-fields {
    min-width: 0;
    width: max-content;
    max-width: 100%;
}

.artistprofile-country-item {
    display: grid;
    grid-template-columns: 24px minmax(115px, 165px) auto;
    gap: 5px;
    align-items: center;
    flex: 0 0 auto;
    min-width: 0;
}

.artistprofile-country-preview {
    display: block;
    width: 24px;
    height: 16px;
    object-fit: contain;
}

.artistprofile-country-preview[hidden] {
    visibility: hidden;
    display: block !important;
}

.artistprofile-country-select {
    min-height: 0;
}

.artistprofile-person-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.artistprofile-action-button .icon {
    margin-right: 5px;
}

.artistprofile-row-tools {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 6px;
    z-index: 2;
}

.artistprofile-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 30px;
    height: 28px;
    padding: 0 5px;
}

.artistprofile-icon-button .icon {
    margin: 0;
}

.artistprofile-icon-button:disabled {
    cursor: default;
    opacity: .4;
}

.artistprofile-russian-name {
    max-width: 320px;
    margin-top: 8px;
}

.artistprofile-inline-input {
    display: flex;
    align-items: center;
    gap: 5px;
}

.artistprofile-remove-country,
.artistprofile-remove-russian-name {
    flex: 0 0 auto;
}

.artistprofile-link-type-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.artistprofile-service-preview {
    display: block;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.artistprofile-link-line {
    display: grid;
    grid-template-columns: minmax(140px, 210px) minmax(260px, 540px) minmax(130px, 220px);
    gap: 10px 12px;
    align-items: end;
    justify-content: start;
}

/* Photo editor: compact cards in a row */
#artistprofile-media-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
}

.artistprofile-existing-photo {
    display: block;
    box-sizing: border-box;
    flex: 0 0 146px;
    width: 146px;
    margin: 0;
    padding: 45px 12px 12px;
}

.artistprofile-photo-tools {
    top: 8px;
    right: 8px;
    left: 8px;
    justify-content: center;
    gap: 4px;
}

.artistprofile-photo-preview {
    position: relative;
    width: 120px;
    margin: 0 auto;
}

.artistprofile-existing-photo img {
    display: block;
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
}

.artistprofile-photo-disabled .artistprofile-photo-preview img {
    opacity: .38;
    filter: grayscale(65%);
}

.artistprofile-primary-badge,
.artistprofile-disabled-badge {
    display: block;
    margin-top: 6px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
}

.artistprofile-primary-badge .icon,
.artistprofile-disabled-badge .icon,
.artistprofile-help .icon {
    margin-right: 4px;
}

.artistprofile-help {
    margin: 0 0 10px;
}

.artistprofile-upload-block {
    margin-top: 12px;
}

.artistprofile-sortable-list:empty {
    margin-bottom: 0;
}

.artistprofile-disabled-badge {
    display: block;
    margin-top: 6px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    opacity: .75;
}

.artistprofile-primary-badge[hidden],
.artistprofile-disabled-badge[hidden] {
    display: none !important;
}

.artistprofile-new-photo-name {
    display: block;
    margin-top: 6px;
    overflow: hidden;
    font-size: .88em;
    line-height: 1.3;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.artistprofile-upload-block input[type="file"] {
    max-width: 100%;
}

/* Revision and moderation previews */
.artistprofile-preview-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.artistprofile-preview-box {
    padding: 12px;
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: 5px;
}

.artistprofile-preview-people {
    font-family: Scada, Verdana, Arial, Helvetica, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
}

.artistprofile-preview-links {
    display: flex;
    flex-wrap: wrap;
    margin-top: 12px;
}

.artistprofile-preview-photos {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.artistprofile-preview-photos figure {
    margin: 0;
}

.artistprofile-preview-photos img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
}

.artistprofile-revision-card {
    display: grid;
    grid-template-columns: var(--artistprofile-profile-size, 150px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    margin: 0 0 16px;
    padding: 12px;
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: 5px;
}

.artistprofile-revision-card-no-photo {
    grid-template-columns: minmax(0, 1fr);
}

.artistprofile-revision-photo {
    position: relative;
}

.artistprofile-revision-photo img {
    display: block;
    width: var(--artistprofile-profile-size, 150px);
    height: var(--artistprofile-profile-size, 150px);
    object-fit: cover;
    border-radius: 5px;
}

.artistprofile-revision-details {
    min-width: 0;
}

.artistprofile-status-pending,
.artistprofile-status-approved {
    font-weight: 600;
}

.artistprofile-status-rejected {
    opacity: .8;
}

@media (max-width: 900px) {
    .artistprofile-link-type-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.artistprofile-service-preview {
    display: block;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.artistprofile-link-line {
        grid-template-columns: minmax(130px, 190px) minmax(220px, 1fr);
    }

    .artistprofile-link-label {
        grid-column: 1 / -1;
        max-width: 320px;
    }
}

@media (max-width: 700px) {
    .artistprofile-viewforum-layout,
    .artistprofile-revision-card {
        grid-template-columns: minmax(100px, var(--artistprofile-profile-size, 150px)) minmax(0, 1fr);
        column-gap: 12px;
    }

    .artistprofile-preview-columns,
    .artistprofile-form-grid,
    .artistprofile-person-mainline,
    .artistprofile-link-type-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.artistprofile-service-preview {
    display: block;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.artistprofile-link-line {
        grid-template-columns: 1fr;
    }

    .artistprofile-form-grid .full,
    .artistprofile-link-label {
        grid-column: auto;
    }

    .artistprofile-person-mainline,
    .artistprofile-russian-name {
        max-width: none;
    }

    .artistprofile-country-list {
        flex-wrap: nowrap;
        overflow-x: auto;
        width: 100%;
    }

    .artistprofile-country-fields {
        width: 100%;
    }

    .artistprofile-country-item {
        grid-template-columns: 24px minmax(115px, 165px) auto;
        width: auto;
    }

    .artistprofile-form-row:not(.artistprofile-existing-photo) {
        padding-right: 12px;
        padding-top: 48px;
    }

    .artistprofile-form-row:not(.artistprofile-existing-photo) > .artistprofile-row-tools {
        left: 10px;
        right: auto;
    }
}

/* Moderation navigation and MCP dashboard */
.artistprofile-review-navigation {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px;
}

.artistprofile-review-navigation-bottom {
    margin: 12px 0 0;
}

.artistprofile-review-navigation .button2 {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.artistprofile-review-navigation-placeholder {
    min-width: 1px;
}

.artistprofile-mcp-recent .artistprofile-status-pending,
.artistprofile-mcp-recent .artistprofile-status-approved,
.artistprofile-mcp-recent .artistprofile-status-rejected {
    white-space: nowrap;
}


.artistprofile-reset-history {
    margin-top: 14px;
}

.artistprofile-reset-history p {
    margin: 6px 0 10px;
}

.artistprofile-reset-history form {
    margin: 0;
}

/* 0.1.12: social icon polish and grouped service links */
.artistprofile-service img,
.artistprofile-service-preview {
    border-radius: 8px;
    opacity: .88;
    transition: opacity .15s ease;
}

.artistprofile-service:hover img,
.artistprofile-service:focus img,
.artistprofile-service-menu[open] > summary img,
.artistprofile-link-type-control:hover .artistprofile-service-preview {
    opacity: 1;
}

.artistprofile-service-menu {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    margin: 0 4px 4px 0;
}

.artistprofile-service-menu > summary {
    margin: 0;
    cursor: pointer;
    list-style: none;
}

.artistprofile-service-menu > summary::-webkit-details-marker {
    display: none;
}

.artistprofile-service-options {
    position: absolute;
    z-index: 1000;
    top: calc(100% + 5px);
    left: 0;
    box-sizing: border-box;
    min-width: 210px;
    max-width: min(340px, 80vw);
    padding: 5px;
    border: 1px solid rgba(0, 0, 0, .18);
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .22);
}

.artistprofile-service-options a {
    display: block;
    font-size: 12px;
    overflow: hidden;
    padding: 7px 9px;
    border-radius: 4px;
    color: inherit;
    line-height: 1.3;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.artistprofile-service-options a:hover,
.artistprofile-service-options a:focus {
    background: rgba(0, 0, 0, .07);
}

.artistprofile-link-row {
    padding-right: 154px;
}

.artistprofile-biography {
    clear: both;
    box-sizing: border-box;
    margin: 14px 0 18px;
    padding: 12px 14px;
    border-top: 1px solid rgba(0, 0, 0, .12);
    font-family: Scada, Verdana, Arial, Helvetica, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.55;
}

.artistprofile-biography > :first-child,
.artistprofile-preview-biography > :first-child {
    margin-top: 0;
}

.artistprofile-biography > :last-child,
.artistprofile-preview-biography > :last-child {
    margin-bottom: 0;
}

.artistprofile-preview-biography {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, .12);
}

.artistprofile-bbcode-toolbar {
    display: flex;
    gap: 5px;
    align-items: center;
    margin: 0 0 6px;
}

.artistprofile-bbcode-toolbar .button2 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 28px;
    padding: 0 6px;
}

.artistprofile-bbcode-toolbar .icon {
    margin: 0;
}

.artistprofile-biography-editor {
    box-sizing: border-box;
    width: 100%;
    min-height: 150px;
    resize: vertical;
}

@media (prefers-color-scheme: dark) {
    .artistprofile-service-options {
        border-color: rgba(255, 255, 255, .2);
        background: #252525;
    }

    .artistprofile-service-options a:hover,
    .artistprofile-service-options a:focus {
        background: rgba(255, 255, 255, .09);
    }
}

@media (max-width: 700px) {
    .artistprofile-link-row {
        padding-right: 12px;
    }

    .artistprofile-service-options {
        right: 0;
        left: auto;
    }
}

/* 0.1.14: portal grouped-service menus outside clipped forum rows */
.artistprofile-service-options.artistprofile-service-options-portal {
    position: fixed;
    z-index: 2147483000;
    margin: 0;
    visibility: hidden;
}


/* 0.1.15: selectable square crop for forum icons */
.artistprofile-crop-button {
    position: absolute;
    right: 4px;
    bottom: 4px;
    z-index: 2;
    min-width: 28px;
    height: 28px;
    padding: 0 5px;
    border-radius: 4px;
    background: rgba(255, 255, 255, .92);
}

.artistprofile-crop-button .icon {
    margin: 0;
}

.artistprofile-crop-dialog[hidden] {
    display: none !important;
}

.artistprofile-crop-dialog {
    position: fixed;
    z-index: 2147483200;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 20px;
}

.artistprofile-crop-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .72);
}

.artistprofile-crop-panel {
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    width: min(760px, 96vw);
    max-height: 94vh;
    overflow: auto;
    padding: 16px;
    border-radius: 8px;
    background: #f7f7f7;
    box-shadow: 0 12px 42px rgba(0, 0, 0, .45);
}

.artistprofile-crop-panel h3 {
    margin-top: 0;
}

.artistprofile-crop-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    padding: 10px;
    overflow: auto;
    border: 1px solid rgba(0, 0, 0, .2);
    border-radius: 6px;
    background: #222;
}

.artistprofile-crop-image-wrap {
    position: relative;
    display: inline-block;
    max-width: 100%;
    line-height: 0;
    touch-action: none;
    user-select: none;
}

.artistprofile-crop-image {
    display: block;
    max-width: min(680px, calc(96vw - 72px));
    max-height: 62vh;
    width: auto;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
}

.artistprofile-crop-box {
    position: absolute;
    box-sizing: border-box;
    cursor: move;
    border: 2px solid #fff;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, .56), 0 0 0 1px rgba(0, 0, 0, .65) inset;
    touch-action: none;
}

.artistprofile-crop-box::before,
.artistprofile-crop-box::after {
    content: '';
    position: absolute;
    pointer-events: none;
    background: rgba(255, 255, 255, .55);
}

.artistprofile-crop-box::before {
    top: 33.333%;
    bottom: 33.333%;
    left: 0;
    right: 0;
    border-top: 1px solid rgba(255, 255, 255, .55);
    border-bottom: 1px solid rgba(255, 255, 255, .55);
    background: none;
}

.artistprofile-crop-box::after {
    left: 33.333%;
    right: 33.333%;
    top: 0;
    bottom: 0;
    border-left: 1px solid rgba(255, 255, 255, .55);
    border-right: 1px solid rgba(255, 255, 255, .55);
    background: none;
}

.artistprofile-crop-controls {
    display: grid;
    grid-template-columns: auto minmax(180px, 1fr) auto;
    gap: 10px;
    align-items: center;
    margin-top: 12px;
}

.artistprofile-crop-controls input[type="range"] {
    width: 100%;
}

.artistprofile-crop-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    justify-content: flex-end;
    margin-top: 14px;
}

@media (prefers-color-scheme: dark) {
    .artistprofile-crop-panel {
        color: #ddd;
        background: #262626;
    }
    .artistprofile-crop-button {
        background: rgba(35, 35, 35, .92);
    }
}

@media (max-width: 520px) {
    .artistprofile-crop-dialog {
        padding: 8px;
    }
    .artistprofile-crop-panel {
        width: 100%;
        padding: 10px;
    }
    .artistprofile-crop-controls {
        grid-template-columns: 1fr;
    }
}

html.artistprofile-crop-open {
    overflow: hidden;
}
