* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body.gallery-register-page {
    margin: 0;
    min-height: 100%;
    font-family: "Roboto", sans-serif;
    background: #f9f9f9;
    color: #0f0f0f;
}

body.gallery-register-page {
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

body.gallery-register-page::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(15, 15, 15, 0.56);
}

#galleryModal.modal[data-compose-embedded="true"] {
    font-family: "Roboto", sans-serif;
    font-size: 16px;
    color: #0f0f0f;
}

a {
    color: #065fd4;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button,
input {
    font: inherit;
}

svg {
    display: block;
    fill: currentColor;
}

#galleryModal.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 2202;
    width: 600px;
    max-width: calc(100vw - 48px);
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
    transform: translate(-50%, -50%);
    overflow: hidden;
}

#galleryModal.modal[data-compose-embedded="true"] {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    margin: 0;
}

#galleryModal .modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
    padding: 0 24px;
    border-bottom: 1px solid #dadce0;
}

#galleryModal .modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 400;
    line-height: 1.4;
}

#galleryModal .icon-btn,
#galleryModal .artwork-dialog .icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #0f0f0f;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

#galleryModal .icon-btn:hover,
#galleryModal .artwork-dialog .icon-btn:hover {
    background: rgba(15, 15, 15, 0.08);
}

.progress {
    height: 2px;
    background: rgba(6, 95, 212, 0.16);
}

.progress-bar {
    width: 36%;
    height: 100%;
    background: #065fd4;
}

#galleryModal .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 24px;
}

.field-wrap {
    margin-bottom: 24px;
}

.label,
.section-title {
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

.small-label {
    margin-bottom: 6px;
    font-size: 12px;
    color: #606060;
}

.title-label {
    margin-bottom: 12px;
}

.section-title.small {
    margin-bottom: 10px;
}

.sub {
    margin: 6px 0 12px;
    color: #606060;
    font-size: 13px;
    line-height: 1.45;
}

.input-box {
    position: relative;
    border: 1px solid #c6c6c6;
    border-radius: 12px;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-box:focus-within {
    border-color: #0f0f0f;
    box-shadow: inset 0 0 0 1px #0f0f0f;
}

.inner-label {
    position: absolute;
    top: 10px;
    left: 16px;
    z-index: 1;
    color: black;
    font-size: 12px;
    line-height: 1.3;
    pointer-events: none;
}

.text-box {
    width: 100%;
    outline: none;
    padding: 30px 16px 8px;
    font-size: 14px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.title-box {
    min-height: 56px;
    max-height: 180px;
    overflow-y: auto;
    padding-top: 28px;
}

.desc-box {
    min-height: 104px;
    padding-top: 30px;
}

.title-box:empty::before {
    content: "예술관 이름을 입력하세요";
    color: #909090;
}

.desc-box:empty::before {
    content: "예술관 설명을 입력하세요";
    color: #909090;
}

.count {
    padding: 0 16px 10px;
    text-align: right;
    color: #606060;
    font-size: 12px;
    line-height: 1.2;
}

.error {
    margin-top: 8px;
    padding: 7px 12px;
    border-radius: 8px;
    background: #fce8e6;
    color: #c5221f;
    font-size: 12px;
    line-height: 1.4;
}

.thumb-area {
    position: relative;
}

.thumb-card {
    border: 1px dashed #c6c6c6;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

.thumb-btn {
    width: 100%;
    padding: 0;
    border: none;
    border-radius: 0;
    background: #fff;
    color: #0f0f0f;
    cursor: pointer;
    text-align: center;
    overflow: hidden;
}

.thumb-btn-main {
    position: relative;
    width: 100%;
    border: none;
    background: #fff;
    color: inherit;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 9;
    min-height: 0;
    padding: 24px 20px;
    border-bottom: 1px dashed #c6c6c6;
}

.thumb-btn-main:hover {
    background: #fff;
}

.thumb-preview-image {
    position: absolute;
    inset: 0;
    display: none;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #f1f3f4;
    pointer-events: none;
}

.thumb-btn.is-filled .thumb-preview-image {
    display: block;
}

.thumb-btn.is-filled .thumb-icon,
.thumb-btn.is-filled .thumb-btn-text,
.thumb-btn.is-filled .thumb-guide {
    display: none;
}

.thumb-link-meta {
    padding: 5px 23px;
    border-top: 1px dashed #c6c6c6;
}

.thumb-meta-row {
    position: relative;
    display: grid;
}

.thumb-meta-label {
    font-size: 12px;
    color: #606060;
}

.thumb-meta-link-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.thumb-meta-link-row a {
    display: block;
    min-width: 0;
    max-width: 100%;
    flex: 1 1 auto;
    color: #065fd4;
    font-size: 14px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.thumb-copy-button {
    position: relative;
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #606060;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.thumb-copy-button:hover {
    background: rgba(15, 15, 15, 0.08);
    color: #0f0f0f;
}

.thumb-copy-button svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.thumb-copy-tooltip {
    position: absolute;
    right: 50%;
    bottom: calc(100% + 6px);
    transform: translateX(50%);
    padding: 4px 8px;
    border-radius: 999px;
    background: #0f0f0f;
    color: #fff;
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease;
    pointer-events: none;
}

.thumb-copy-button:hover .thumb-copy-tooltip,
.thumb-copy-button:focus-visible .thumb-copy-tooltip {
    opacity: 1;
    visibility: visible;
}

.thumb-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    color: #606060;
}

.thumb-btn-text {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
}

.thumb-guide {
    display: block;
    color: #606060;
    font-size: 12px;
    line-height: 1.4;
}

.thumb-view {
    position: relative;
}

.thumb-preview {
    width: 100%;
    padding: 0;
    border: 1px solid #dadce0;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    cursor: pointer;
}

.thumb-preview img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: #f1f3f4;
}

.thumb-file {
    display: none;
}

.thumb-more {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    box-shadow: none;
    color: #fff;
}

.grid-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.tag-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    border: 1px solid #dadce0;
    border-radius: 12px;
    background: #fff;
    padding: 10px 14px;
}

.tag-field {
    position: relative;
}

.tag-box:focus-within {
    border-color: #0f0f0f;
    box-shadow: inset 0 0 0 1px #0f0f0f;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 999px;
    background: #f2f2f2;
    color: #0f0f0f;
    font-size: 13px;
    line-height: 1.2;
}

.tag-chip button {
    border: none;
    background: transparent;
    padding: 0;
    color: #606060;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}

.tag-input {
    flex: 1 1 160px;
    min-width: 160px;
    height: 24px;
    border: none;
    outline: none;
    background: transparent;
    color: #0f0f0f;
    font-size: 14px;
    padding: 0;
}

.tag-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    max-height: 220px;
    padding: 6px 0;
    border: 1px solid #dadce0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 15, 15, 0.14);
    overflow-y: auto;
}

.tag-suggestion-item {
    width: 100%;
    border: 0;
    background: transparent;
    padding: 10px 14px;
    text-align: left;
    color: #0f0f0f;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.tag-suggestion-item:hover,
.tag-suggestion-item.is-active {
    background: #f2f4f7;
}

.tag-suggestion-empty {
    padding: 10px 14px;
    color: #606060;
    font-size: 13px;
}

.select-box {
    position: relative;
    min-height: 64px;
    padding: 12px 16px;
    border: 1px solid #dadce0;
    border-radius: 12px;
    background: #fff;
}

.select-box::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 16px;
    width: 10px;
    height: 10px;
    border-right: 2px solid #606060;
    border-bottom: 2px solid #606060;
    transform: translateY(-70%) rotate(45deg);
}

.select-label {
    margin-bottom: 4px;
    color: #606060;
    font-size: 12px;
    line-height: 1.3;
}

.select-value {
    padding-right: 24px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
}

.sub-btn,
.main-btn {
    min-width: 64px;
    min-height: 36px;
    padding: 0 16px;
    border: none;
    border-radius: 18px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.sub-btn {
    background: #f2f2f2;
    color: #0f0f0f;
}

.sub-btn:hover {
    background: #e5e5e5;
}

.selected-artwork-links {
    margin-top: 12px;
    display: block;
    padding: 8px;
    border: 1px solid #dadce0;
    border-radius: 14px;
    background: #f8fafc;
}

.selected-artwork-link-item,
.selected-artwork-empty {
    padding: 12px 14px;
    border-radius: 12px;
    background: #fff;
    font-size: 13px;
    line-height: 1.4;
}

.selected-artwork-link-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.artwork-thumb-link {
    flex-basis: 96px;
    width: 96px;
}

.selected-artwork-link-content {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.selected-artwork-link-title {
    font-size: 14px;
    color: #0f0f0f;
    line-height: 1.4;
    word-break: break-word;
}

.selected-artwork-link-item a {
    color: #065fd4;
    word-break: break-all;
}

.selected-artwork-empty {
    color: #606060;
}

.main-btn {
    background: #0f0f0f;
    color: #fff;
}

.main-btn:hover:not(:disabled) {
    background: #272727;
}

.main-btn:disabled {
    background: #f2f2f2;
    color: #909090;
    cursor: default;
}

#galleryModal .modal-foot {
    display: flex;
    justify-content: flex-end;
    padding: 16px 24px 24px;
}

.artwork-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2204;
    background: rgba(15, 15, 15, 0.56);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.artwork-dialog {
    width: min(960px, calc(100vw - 48px));
    height: min(880px, calc((100vh - 48px) * 0.8));
    max-height: min(880px, calc((100vh - 48px) * 0.8));
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
    overflow: hidden;
}

.artwork-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 64px;
    padding: 0 24px;
    border-bottom: 1px solid #e5e5e5;
}

.artwork-dialog-title {
    margin: 0;
    font-size: 24px;
    font-weight: 500;
    line-height: 1.3;
}

.artwork-dialog-close {
    flex: 0 0 auto;
}

.artwork-dialog-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.artwork-picker {
    height: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
}

.artwork-picker-left,
.artwork-picker-right {
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.artwork-picker-left {
    border-right: 1px solid #e5e5e5;
}

.artwork-picker-tabs {
    padding: 16px 24px 0;
}

.artwork-picker-tab {
    min-height: 44px;
    padding: 0 14px;
    border: none;
    border-bottom: 2px solid #0f0f0f;
    background: transparent;
    color: #0f0f0f;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.artwork-search-wrap {
    padding: 16px 24px;
    border-bottom: 1px solid #e5e5e5;
}

.artwork-search-input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid #dadce0;
    border-radius: 10px;
    outline: none;
    background: #fff;
}

.artwork-list,
.artwork-selection-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.artwork-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    border-bottom: 1px solid #f1f3f4;
    cursor: pointer;
}

.artwork-row:hover {
    background: #fafafa;
}

.artwork-checkbox {
    margin-top: 2px;
}

.artwork-thumb {
    flex: 0 0 88px;
    width: 88px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 10px;
    background: #dfe3e8;
}

.artwork-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.artwork-row-main {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.artwork-row-title,
.artwork-selection-title {
    font-size: 14px;
    line-height: 1.4;
    color: #0f0f0f;
    word-break: break-word;
}

.artwork-row-meta {
    font-size: 12px;
    color: #606060;
}

.artwork-picker-right {
    background: #fafafa;
}

.artwork-selection-header {
    padding: 20px 20px 12px;
    font-size: 14px;
    font-weight: 500;
    color: #0f0f0f;
}

.artwork-selection-item,
.artwork-selection-empty {
    padding: 14px 20px;
    border-top: 1px solid #eceff1;
}

.artwork-selection-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.artwork-thumb-selection {
    flex-basis: 96px;
    width: 96px;
}

.artwork-selection-title {
    min-width: 0;
}

.artwork-selection-empty {
    color: #606060;
    font-size: 13px;
}

.artwork-dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px 24px;
    border-top: 1px solid #e5e5e5;
}

@media (max-width: 640px) {
    .modal {
        width: calc(100vw - 16px);
        max-height: calc(100vh - 16px);
        top: auto;
        bottom: 8px;
        transform: translateX(-50%);
    }

    .modal-head,
    .modal-body,
    .modal-foot {
        padding-left: 16px;
        padding-right: 16px;
    }

    .grid-two {
        grid-template-columns: 1fr;
    }

    .artwork-dialog-backdrop {
        padding: 16px 8px 8px;
        align-items: stretch;
    }

    .artwork-dialog {
        width: 100%;
        height: auto;
        max-height: none;
    }

    .artwork-picker {
        grid-template-columns: 1fr;
    }

    .artwork-picker-left {
        border-right: none;
        border-bottom: 1px solid #e5e5e5;
    }
}
