.p7co-media { margin-top: 10px; }
.p7co-media {
    margin-top: 10px;
    --p7co-accent: #189578;
    --p7co-accent-strong: #0f6c54;
    --p7co-surface: #f6faf8;
    --p7co-border: #d7e6e1;
    --p7co-shadow: 0 10px 26px rgba(0, 0, 0, 0.06);
}

.p7co-media__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.p7co-media__title {
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: 0.01em;
    color: #102a2a;
}

.p7co-media__help {
    font-size: 1rem;
    color: #475569;
}

.p7co-media__hint {
    font-size: 0.98rem;
    color: #0f5132;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(24, 149, 120, 0.12), rgba(15, 81, 50, 0.12));
    border: 1px solid rgba(24, 149, 120, 0.2);
    border-radius: 12px;
    white-space: normal;
}

@media (max-width: 575px) {
    .p7co-media__header {
        flex-direction: column;
        align-items: flex-start;
    }
}

.p7co-media__hint .w-icon-check-solid {
    font-size: 1rem;
    color: var(--p7co-accent-strong);
}

.p7co-media__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    padding: 14px;
    background: radial-gradient(circle at 15% 20%, rgba(24, 149, 120, 0.05), transparent 30%),
        radial-gradient(circle at 80% 0%, rgba(24, 149, 120, 0.06), transparent 40%),
        #ffffff;
    border: 1px solid var(--p7co-border);
    border-radius: 14px;
    box-shadow: var(--p7co-shadow);
}

@media (max-width: 991px) {
    .p7co-media__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575px) {
    .p7co-media__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .p7co-media__grid {
        grid-template-columns: 1fr;
    }
}

.p7co-slot {
    position: relative;
    border: 1px solid var(--p7co-border);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    outline: none;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.04);
    transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

.p7co-slot[data-slot="0"]::after {
  content: "";
  position: absolute;
  bottom: 10px;
  left: 12px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--p7co-accent);
  background: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  pointer-events: none;
  z-index: 3;
}

.p7co-slot__badge {
  display: none;
}

.p7co-slot__badge:empty {
  display: none;
}

.p7co-slot:not([data-has-image]) .p7co-slot__badge {
    display: none;
}

.p7co-slot__preview {
    width: 100%;
    aspect-ratio: 1 / 1;
    position: relative;
    display: block;
    background: var(--p7co-surface);
    padding: 0;
    border: 0;
    cursor: pointer;
    overflow: hidden;
    border-bottom: 1px dashed rgba(24, 149, 120, 0.22);
}

.p7co-slot[data-has-image] .p7co-slot__preview {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: #fff;
}

.p7co-slot__preview img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
    background: #f7f7f7;
}

.p7co-slot__empty {
    position: absolute;
    inset: 0;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    padding: 16px;
    color: #1f2937;
}

.p7co-slot__plus {
    font-size: 1.8rem;
    color: var(--p7co-accent-strong);
    opacity: 0.85;
}

.p7co-slot__emptytext {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
}

.p7co-slot__emptytitle {
    font-weight: 700;
}

.p7co-slot__emptysub {
    font-size: 0.95rem;
    opacity: 0.78;
}

.p7co-slot__input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
    pointer-events: none;
}

.p7co-slot__badge,
.p7co-slot__actions,
.p7co-slot__meta {
    position: relative;
    z-index: 3;
}

.p7co-slot__actions {
    display: flex;
    gap: 12px;
    padding: 12px 12px 10px 12px;
    justify-content: center;
    align-items: center;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background: linear-gradient(180deg, rgba(24, 149, 120, 0.04), rgba(24, 149, 120, 0));
    min-height: 58px;
}

.p7co-btn {
    border: 1px solid var(--p7co-border);
    background: #fff;
    color: var(--p7co-accent-strong);
    border-radius: 999px;
    width: 40px;
    height: 40px;
    padding: 0;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s ease, background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

@media (prefers-reduced-motion: reduce) {
    .p7co-btn {
        transition: none;
    }
}

.p7co-btn span {
    font-size: 1rem;
    color: inherit;
}

.p7co-btn--ghost {
    opacity: 0.92;
}

.p7co-btn--danger {
    border-color: rgba(220, 53, 69, 0.35);
    color: #9f1239;
}

.p7co-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.p7co-btn:hover {
    background: rgba(24, 149, 120, 0.12);
    border-color: var(--p7co-accent);
    color: var(--p7co-accent-strong);
    transform: translateY(-1px) scale(1.01);
}

.p7co-btn--danger:hover {
    background: rgba(220, 53, 69, 0.1);
    border-color: rgba(220, 53, 69, 0.5);
    color: #7f112d;
}

.p7co-slot__meta {
    padding: 0 12px 12px 12px;
    font-size: 0.9rem;
    color: #374151;
    display: none;
}

.p7co-slot__meta span {
    min-width: 0;
}

.p7co-slot__meta [data-filename] {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.p7co-slot__meta [data-filesize] {
    white-space: nowrap;
}

.p7co-slot__meta.is-empty {
    opacity: 0.5;
}

.p7co-slot.dragging {
    opacity: 0.7;
}

.p7co-slot.dragover {
    box-shadow: inset 0 0 0 3px rgba(24, 149, 120, 0.32);
}

.p7co-slot__drop {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, rgba(24, 149, 120, 0.82), rgba(15, 81, 50, 0.88));
    color: #fff;
    z-index: 4;
    font-weight: 800;
    pointer-events: none;
    letter-spacing: 0.01em;
}

.p7co-slot.dragover .p7co-slot__drop {
    display: flex;
}

.p7co-slot.is-disabled {
    opacity: 0.45;
}

.p7co-slot.is-disabled .p7co-slot__preview {
    cursor: not-allowed;
}

.p7co-slot.is-disabled .p7co-slot__actions {
    opacity: 0.6;
    pointer-events: none;
}

.p7co-media__status {
    margin-top: 10px;
    font-size: 0.95rem;
}

.p7co-media__status.error {
    color: #dc3545;
}

.p7co-media__status.ok {
    color: #198754;
}

.p7co-media__toast {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    z-index: 9999;
    display: none;
    max-width: min(560px, calc(100vw - 24px));
    padding: 10px 14px;
    border-radius: 12px;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.p7co-media__toast.is-show {
    display: block;
    animation: p7coToastIn 0.12s ease-out;
}

.p7co-media__toast.is-ok {
    background: rgba(25, 135, 84, 0.95);
}

.p7co-media__toast.is-warn {
    background: rgba(255, 193, 7, 0.95);
    color: #111;
}

.p7co-media__toast.is-error {
    background: rgba(220, 53, 69, 0.95);
}

@keyframes p7coToastIn {
    from {
        transform: translateX(-50%) translateY(6px);
        opacity: 0;
    }

    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}
