.scu-side-button {
    width: 40px;
    height: 40px;
    position: absolute;
    right: 2%;
    bottom: 120%;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 20px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    z-index: 1000;
}

.scu-side-button--filled {
    background: #c4c4c4;
    color: #fff;
}

#scu-gallery-button {
    bottom: 120%;
}

#scu-camera-button {
    bottom: 180%;
}

#scu-image-selector-button {
    bottom: 240%;
    background: transparent;
    color: #666;
    box-shadow: none;
}

#scu-image-selector-button.scu-image-selector-button--active {
    background: #ffe595;
    color: #704c00;
    box-shadow: 0 6px 12px rgba(255, 181, 71, 0.45);
}

#scu-image-selector-button::after {
    content: attr(data-selected-count);
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ff6b6b;
    color: #fff;
    font-size: 11px;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 18px;
    font-weight: 600;
}

#scu-image-selector-button[data-selected-count]:not([data-selected-count="0"])::after {
    display: flex;
}

.scu-image-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1500;
}

.scu-image-modal.is-visible {
    display: flex;
}

.scu-image-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.scu-image-modal__panel {
    position: relative;
    z-index: 1;
    width: min(440px, 90%);
    max-height: 85vh;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 25px 65px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    padding: 24px;
    gap: 16px;
}

.scu-upload-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1600;
}

.scu-upload-modal.is-visible {
    display: flex;
}

.scu-upload-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.scu-upload-modal__panel {
    position: relative;
    z-index: 1;
    width: min(520px, 92%);
    max-height: 85vh;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 25px 65px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px;
}

.scu-upload-modal__header h3 {
    margin: 0;
    font-size: 1.05rem;
    color: #1f1f1f;
}

.scu-upload-modal__subtitle {
    margin: 4px 0 0;
    font-size: 0.85rem;
    color: #6d6d6d;
}

.scu-upload-modal__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    gap: 10px;
    max-height: 320px;
    overflow: auto;
    padding: 6px;
    background: #f7f7f7;
    border-radius: 12px;
    border: 1px solid #ececec;
}

.scu-upload-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #e1e1e1;
    background: #fff;
    display: block;
}

.scu-upload-thumb--file {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    border: 1px dashed #cfcfcf;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px;
    gap: 4px;
    text-align: center;
    color: #555;
    font-size: 0.7rem;
}

.scu-upload-thumb__ext {
    font-weight: 600;
    font-size: 0.8rem;
    color: #333;
}

.scu-upload-thumb__name {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scu-upload-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.scu-image-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.scu-image-modal__header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #1f1f1f;
}

.scu-image-modal__subtitle {
    margin: 4px 0 0;
    font-size: 0.85rem;
    color: #6d6d6d;
}

.scu-image-modal__close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #7a7a7a;
}

.scu-image-modal__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.scu-image-modal__actions-left {
    display: flex;
    gap: 10px;
}

.scu-image-modal__tabs {
    display: flex;
    gap: 6px;
}

.scu-image-modal__tab {
    border: 1px solid #e1e1e1;
    background: #f8f8f8;
    color: #333;
    padding: 6px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.scu-image-modal__tab.is-active {
    background: #3a54f4;
    color: #fff;
    border-color: #3a54f4;
}

.scu-image-modal__action-button {
    border: none;
    border-radius: 999px;
    padding: 6px 16px;
    font-size: 0.85rem;
    cursor: pointer;
    background: #3a54f4;
    color: #fff;
    transition: opacity 0.2s ease;
}

.scu-image-modal__action-button:disabled {
    opacity: 0.5;
    cursor: default;
}

.scu-image-modal__action-button.scu-outline {
    background: transparent;
    border: 1px solid #d5d5d5;
    color: #555;
}

.scu-image-modal__counter {
    font-weight: 600;
    color: #333;
}

.scu-image-modal__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 200px;
}

.scu-entry-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 320px;
    padding-right: 4px;
}

.scu-image-modal__message {
    font-size: 0.85rem;
    color: #a65e00;
}

.scu-image-modal__footer {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid #f1f1f1;
}

.scu-image-modal__auto {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #333;
}

.scu-image-modal__auto input {
    width: 16px;
    height: 16px;
    margin: 0;
}

.scu-image-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 320px;
    padding-right: 4px;
}

.scu-image-list__item {
    display: flex;
    align-items: stretch;
    gap: 12px;
    border: 1px solid #ededed;
    border-radius: 12px;
    padding: 8px 10px;
}

.scu-image-list__item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
}

.scu-image-list__thumb {
    width: 45%;
    max-width: 160px;
    min-width: 120px;
    height: auto;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e2e2;
    flex-shrink: 0;
    background: #f4f4f4;
    display: block;
    position: relative;
}

.scu-image-list__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}

.scu-image-list__thumb:hover img {
    transform: scale(1.02);
}

.scu-image-list__meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.8rem;
    flex: 1;
    min-width: 0;
}

.scu-image-list__name {
    font-weight: 600;
    color: #1f1f1f;
}

.scu-image-list__tag {
    align-self: flex-start;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #eef0ff;
    color: #3643c3;
    padding: 2px 8px;
    border-radius: 999px;
}

.scu-image-list__snippet {
    display: block;
    font-size: 0.85rem;
    color: #333;
    margin-top: 2px;
    line-height: 1.3;
    white-space: normal;
    overflow-wrap: anywhere;
}

.scu-image-list__info {
    color: #7a7a7a;
    font-size: 0.75rem;
}

.scu-image-list__item--disabled {
    opacity: 0.5;
}

.scu-image-list__item--latest {
    border-color: #3a54f4;
    box-shadow: 0 0 0 1px rgba(58, 84, 244, 0.1);
}

.scu-image-list__empty {
    padding: 36px 12px;
    text-align: center;
    border: 1px dashed #d7d7d7;
    border-radius: 12px;
    color: #7a7a7a;
    font-size: 0.95rem;
}

.scu-file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 320px;
    padding-right: 4px;
}

.scu-file-list__item {
    display: flex;
    gap: 10px;
    padding: 10px;
    border: 1px solid #ededed;
    border-radius: 12px;
    align-items: flex-start;
}

.scu-file-list__item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
}

.scu-file-list__content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.scu-file-list__name {
    font-weight: 600;
    color: #1f1f1f;
    font-size: 0.95rem;
    overflow-wrap: anywhere;
}

.scu-file-list__meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.82rem;
    color: #6a6a6a;
}

.scu-file-list__tag {
    background: #f1f3ff;
    color: #3a54f4;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
}

.scu-file-list__info {
    color: #7a7a7a;
}

.scu-file-list__snippet {
    font-size: 0.9rem;
    color: #333;
    overflow-wrap: anywhere;
    line-height: 1.3;
}

.scu-file-list__link {
    align-self: flex-start;
    font-size: 0.9rem;
    color: #3a54f4;
    text-decoration: none;
    font-weight: 600;
}

.scu-file-list__link:hover {
    text-decoration: underline;
}

.scu-file-list__item--active {
    border-color: #3a54f4;
    box-shadow: 0 0 0 1px rgba(58, 84, 244, 0.08);
}

.scu-file-list__empty {
    padding: 24px 12px;
    text-align: center;
    border: 1px dashed #d7d7d7;
    border-radius: 12px;
    color: #7a7a7a;
    font-size: 0.95rem;
}

.scu-entry-list__empty {
    padding: 24px 12px;
    text-align: center;
    border: 1px dashed #d7d7d7;
    border-radius: 12px;
    color: #7a7a7a;
    font-size: 0.95rem;
}

.scu-image-modal.is-loading .scu-image-modal__body {
    opacity: 0.6;
}

.scu-image-modal.is-busy .scu-image-modal__body {
    opacity: 0.7;
}

body.scu-modal-open {
    overflow: hidden;
}
